Skip to content

Conversation

@awln-temporal
Copy link
Contributor

@awln-temporal awln-temporal commented Nov 26, 2025

What changed?

Emit warn 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?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider making this a warning since we expect this to happen in certain conditions and it is not an error under our control unless we have a severe bug, but that should be covered in functional tests.

if err != nil {
return err
// INFO: To reach here, either the search attribute has been deregistered before task execution, which is valid behavior,
// or the upserted search attribute is incorrectly mapped, indicating possible bug in application code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYM incorrectly mapped? Do you mean that there's a bug in the frontend code?

There's another cause for this that we discussed earlier. The search attribute mapping may have propagation delays to the history node executing this task.
We already ensure that all search attributes are mappable on the frontend.

Copy link
Contributor Author

@awln-temporal awln-temporal Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the case of eager workflows, following executions bypassed frontend validators. error message is more specific now.

@awln-temporal awln-temporal force-pushed the chasm-visibility-task-deregistered-attribute branch from 5aa17eb to fdab724 Compare November 26, 2025 23:14
@awln-temporal awln-temporal merged commit 63a2849 into main Dec 1, 2025
94 of 96 checks passed
@awln-temporal awln-temporal deleted the chasm-visibility-task-deregistered-attribute branch December 1, 2025 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants