-
Notifications
You must be signed in to change notification settings - Fork 623
Increment watch version only on actual modifications #1434
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
Conversation
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.
Pull Request Overview
This PR fixes issue #1369 by ensuring the watch version is only incremented when data is actually modified, not just when an operation succeeds. The change introduces an IPUResult enum with three states: Failed, Succeeded, and NotUpdated to distinguish between operations that modify data vs those that complete successfully without modifications.
- Introduced
IPUResultenum to differentiate between failed operations, successful modifications, and successful no-ops - Refactored
InPlaceUpdaterWorkerto returnIPUResultinstead ofbool - Modified
InPlaceUpdaterto only increment watch version forIPUResult.Succeeded(actual modifications)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| libs/server/Storage/Functions/MainStore/RMWMethods.cs | Added IPUResult enum and refactored InPlaceUpdaterWorker return type from bool to IPUResult, updated all return statements throughout the method to use the new enum |
| libs/server/Storage/Functions/MainStore/PrivateMethods.cs | Updated EvaluateExpireInPlace return type from bool to IPUResult and changed return statements to use the new enum values |
Comments suppressed due to low confidence (3)
libs/server/Storage/Functions/MainStore/PrivateMethods.cs:286
- When
ExpireOption.NXis used with an existing expiry, the value is not modified (result is 0), so this should returnIPUResult.NotUpdatedinstead of falling through to returnIPUResult.Succeeded.
case ExpireOption.NX:
o->result1 = 0;
break;
libs/server/Storage/Functions/MainStore/PrivateMethods.cs:297
- When
replaceis true in GT/XXGT options, the value is not modified (kept as-is), so this should returnIPUResult.NotUpdatedinstead of continuing to the finalreturn IPUResult.Succeeded.
if (replace)
o->result1 = 0;
libs/server/Storage/Functions/MainStore/PrivateMethods.cs:306
- When
replaceis true in LT/XXLT options, the value is not modified (kept as-is), so this should returnIPUResult.NotUpdatedinstead of continuing to the finalreturn IPUResult.Succeeded.
if (replace)
o->result1 = 0;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #1369