Skip to content

Conversation

@badrishc
Copy link
Collaborator

Fixes #1369

Copilot AI review requested due to automatic review settings November 11, 2025 17:50
Copilot finished reviewing on behalf of badrishc November 11, 2025 17:52
Copy link
Contributor

Copilot AI left a 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 IPUResult enum to differentiate between failed operations, successful modifications, and successful no-ops
  • Refactored InPlaceUpdaterWorker to return IPUResult instead of bool
  • Modified InPlaceUpdater to only increment watch version for IPUResult.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.NX is used with an existing expiry, the value is not modified (result is 0), so this should return IPUResult.NotUpdated instead of falling through to return IPUResult.Succeeded.
                    case ExpireOption.NX:
                        o->result1 = 0;
                        break;

libs/server/Storage/Functions/MainStore/PrivateMethods.cs:297

  • When replace is true in GT/XXGT options, the value is not modified (kept as-is), so this should return IPUResult.NotUpdated instead of continuing to the final return IPUResult.Succeeded.
                        if (replace)
                            o->result1 = 0;

libs/server/Storage/Functions/MainStore/PrivateMethods.cs:306

  • When replace is true in LT/XXLT options, the value is not modified (kept as-is), so this should return IPUResult.NotUpdated instead of continuing to the final return IPUResult.Succeeded.
                        if (replace)
                            o->result1 = 0;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot finished reviewing on behalf of badrishc November 12, 2025 01:54
Copy link
Contributor

Copilot AI left a 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.

@kevin-montrose kevin-montrose self-requested a review November 17, 2025 15:09
@badrishc badrishc merged commit e8aeb7d into main Nov 17, 2025
27 checks passed
@badrishc badrishc deleted the badrishc/fix-1369 branch November 17, 2025 15:19
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.

StackExchange.Redis's LockReleaseAsync fails even when given key has the specified value

3 participants