-
Notifications
You must be signed in to change notification settings - Fork 5
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
ENG-48445: Added generic filter and optional upsert condition (for optimistic updates) #226
Conversation
Test Results122 tests 122 ✅ 59s ⏱️ Results for commit cc5c1fe. ♻️ This comment has been updated with latest results. |
config-service-api/src/main/proto/org/hypertrace/config/service/v1/config_service.proto
Outdated
Show resolved
Hide resolved
config-service-api/src/main/proto/org/hypertrace/config/service/v1/config_service.proto
Outdated
Show resolved
Hide resolved
@@ -38,6 +38,9 @@ message UpsertConfigRequest { | |||
// optional - only required if config applies to a specific context. | |||
// If empty, specified config is associated with a default context. | |||
string context = 4; | |||
|
|||
//optional - only required when we want to have optimistic locking for update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe how this behaves if no config exists (the create side of upsert)? Does it always pass? always fail? And the optimistic locking is more of a use case description, i'd drop it.
//optional - only required when we want to have optimistic locking for update | |
// an optional condition that must pass in order for an update operation to succeed. If the target record does not exist... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am think to have this conditional update only when the Filter field is present (which uses doc store update method)
other case like create and update with no filter can work as it is (current uses doc store upsert method which is deprecated i can use createOrReplace method instead)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense. Just need to reject the create + filter case with validation
config-service-api/src/main/proto/org/hypertrace/config/service/v1/config_service.proto
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
Please include a summary of the change, motivation and context.
Testing
Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.
Checklist:
Documentation
Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.