Skip to content

Commit 63a2849

Browse files
Emit error log if deregistered search attribute in chasm vis task (#8715)
## What changed? Emit error log if deregistered search attribute in chasm vis task. Original thread: #8662 (comment) ## Current State If user deregisters search attributes while the task is getting processed, current code leads to task failure. In ES, if the search attribute has been deregistered, upsert SA task execution would still fail when generating the ES Doc and attempting to decode the value. In the SQL implementation, since these fields are constant and always attached to the NameTypeMap/ClusterMetadata, Upserting these fields would succeed, so there is a discrepancy between these stores. ## Why? Once we have parity between ES and SQL for preallocated columns, we should not throw an error if a search attribute gets deregistered when executing the CHASM vis task and just do a best effort upsert call. User deregistering search attributes after archetype execution is a valid use case. A valid concern is if the visibility component somehow has an incorrect search attribute (eg. field name). There was an issue the past caught because errors were thrown during translation, which showed search attribute already translated to field name before hitting the translation layer (due to application code bug). However, Error logs should be sufficient to debug. ## How did you test it? - [X] built - [X] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s)
1 parent b096c97 commit 63a2849

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

service/history/visibility_queue_task_executor.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"go.temporal.io/server/common/definition"
1414
"go.temporal.io/server/common/dynamicconfig"
1515
"go.temporal.io/server/common/log"
16+
"go.temporal.io/server/common/log/tag"
1617
"go.temporal.io/server/common/metrics"
1718
"go.temporal.io/server/common/namespace"
1819
"go.temporal.io/server/common/payload"
@@ -409,7 +410,10 @@ func (t *visibilityQueueTaskExecutor) processChasmTask(
409410
for alias, value := range aliasedSearchAttributes {
410411
fieldName, err := searchAttributesMapper.GetFieldName(alias, namespaceEntry.Name().String())
411412
if err != nil {
412-
return err
413+
// To reach here, either the search attribute has been deregistered before task execution, which is valid behavior,
414+
// or there are delays in propagating search attribute mappings to History.
415+
t.logger.Warn("Failed to get field name for alias, ignoring search attribute", tag.NewStringTag("alias", alias), tag.Error(err))
416+
continue
413417
}
414418
searchattributes[fieldName] = value
415419
}

0 commit comments

Comments
 (0)