-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search attribute validation toggling #5033
Search attribute validation toggling #5033
Conversation
…lag check before performing validation
…or level validation
…rlese-instaclustr/cadence into search-attribute-validation-toggling Merging upstream updates into feature branch .
Code and idea look good. One question: did you test out the case of different data types and whether that caused any breaking errors in Opensearch? (I think you may have covered this with TEST2, but wanted to double-check) |
Hi @ZackLK , thanks for the review. The worst behaviour I've seen is when passing a string i.e. "hello" when the key expects a numerical value when starting a workflow. The workflow seemingly gets accepted by the CLI, e.g.
However Cadence logs will show that the So, not a breaking error by any means, but a slightly confusing behaviour (albeit one that only arises if users are misusing their search attribute keys). Do you have any suggestions about modifications that should be made to address this, if at all? Cheers |
ty for the solid PR and docs |
…rlese-instaclustr/cadence into search-attribute-validation-toggling Merge with upstream changes
Head branch was pushed to by a user without write access
Hi @ZackLK , Found that there was a unit test case failing as I missed adding the new config property to that one; hopefully all is well now. Also, please let me know if there's any recommended action on my point about edge case handling, above. Thanks! If you're happy with the change, could I also please request support with re-enabling auto-merge? Thanks. |
…rlese-instaclustr/cadence into search-attribute-validation-toggling Merging upstream into working branch in order to push handling fix for failing integration test
Hi @ZackLK , Apologies that this has taken a couple of rounds, I'm still learning my way around the integration tests. But I believe I've fixed the issue -- seeing the tests pass locally now -- so if you would be able to provide one more approval if you're happy that'd be great, thanks! |
frontend.enableQueryAttributeValidation
. This parameter istrue
by default, and when it istrue
there is no change to the current Cadence behaviour.false
, the following changes in behaviour have been made:frontend.validSearchAttributes
map before being used to query from Elasticsearch/OpenSearch.frontend.validSearchAttributes
map before attempting to write to Elasticsearch/OpenSearch. Similarly, the datatype of the attribute value will not be checked against the validation map.Addresses issue #4948
When running Cadence in a multi-node setup, updates to the
frontend.validSearchAttributes
map in the dynamic config is required on every node every time a new custom search attribute is introduced. It may be desirable to be able to add custom search attributes and not have to subsequently update the map in some cases. For example, this can be limiting if the dev. seeking to add the search attributes does not have the requisite access to the node configs; this could create limiting interdependencies hindering development.Setting this dynamic config to disable validation on custom search attributes may therefore be appropriate in certain Cadence use cases.
How did you test it?
Tested locally by running Cadence with Cassandra, Kafka, and OpenSearch. Ran the following operation tests to confirm none of them caused issues for Cadence or OpenSearch:
true
)false
frontend.validSearchAttributes
map.Potential risks
This change will pose no risk for all running clusters unless they specifically set the new
frontend.EnableQueryAttributeValidation
value tofalse
, because it defaults totrue
andtrue
will produce no change in behaviour.When used, the new property/behaviour should not pose significant risk. Tests have been done to check that the removal of the validation does not lead to Cadence or OpenSearch crashing with unexpected inputs or edge case user behaviour. Obviously, without the validation being active, the onus will be on the user to be diligent in remembering what search attributes are available to be set and their correct datatypes, however as mentioned this will only be the case if they actively opt in to using this feature, at which point they should be well-informed about its effect.
No, because the default value of the property produces no change in behaviour
Documentation Changes
Generated automatically with this change.