Skip to content
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

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

harshit-kumar-v2
Copy link
Contributor

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:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@harshit-kumar-v2 harshit-kumar-v2 requested a review from a team as a code owner August 14, 2024 13:20
@harshit-kumar-v2 harshit-kumar-v2 changed the title ENG-48445: Added generic filter and condition upsert condition (for optimistic updates) ENG-48445: Added generic filter and optional upsert condition (for optimistic updates) Aug 14, 2024
Copy link

github-actions bot commented Aug 14, 2024

Test Results

122 tests   122 ✅  59s ⏱️
 29 suites    0 💤
 29 files      0 ❌

Results for commit cc5c1fe.

♻️ This comment has been updated with latest results.

@@ -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
Copy link
Contributor

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.

Suggested change
//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...

Copy link
Contributor Author

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)

Copy link
Contributor

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

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld left a comment

Choose a reason for hiding this comment

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

lgtm

@harshit-kumar-v2 harshit-kumar-v2 merged commit b5bb276 into main Aug 19, 2024
9 checks passed
@harshit-kumar-v2 harshit-kumar-v2 deleted the upsert-with-condition branch August 19, 2024 13:10
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.

2 participants