Skip to content

Fix ObjectOutput.result1 corruption in RMW retries#1836

Merged
kevin-montrose merged 2 commits into
mainfrom
users/kmontrose/outputResultFixes
May 29, 2026
Merged

Fix ObjectOutput.result1 corruption in RMW retries#1836
kevin-montrose merged 2 commits into
mainfrom
users/kmontrose/outputResultFixes

Conversation

@kevin-montrose

@kevin-montrose kevin-montrose commented May 28, 2026

Copy link
Copy Markdown
Contributor

A number of "object" commands mutate ObjectOutput.result1 in response to a InitialUpdater call.

However these calls can be retried under contention, so any mutation that assumes an initial value (typically 0) will produce incorrect results. I've audited uses of result1 and fixed all the places where this can happen.

This fixes #1833

I did a separate pass through StringOutput and UnifiedOutput, and I think we're all fine there.

…where retries in Tsavorites InitialUpdater would cause incorrect responses
Copilot AI review requested due to automatic review settings May 28, 2026 20:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@mgravell mgravell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can't opine on any missing cases, but the ones shown make sense. Kudos for looking wider than the initial report.

@mgravell

mgravell commented May 29, 2026

Copy link
Copy Markdown
Contributor

Genuine question from a mostly-outside-observer who doesn't know anything about the complexity involved: is this amenable to unit testing? Is there some reusable setup/invoke/observe test loop that could be applied to all the operation implementations in a generic way simulating both success and failure (retry), to prevent recurrence/oversight?

@kevin-montrose kevin-montrose merged commit 89247a6 into main May 29, 2026
267 of 269 checks passed
@kevin-montrose kevin-montrose deleted the users/kmontrose/outputResultFixes branch May 29, 2026 13:57
@kevin-montrose

Copy link
Copy Markdown
Contributor Author

Genuine question from a mostly-outside-observer who doesn't know anything about the complexity involved: is this amenable to unit testing? Is there some reusable setup/invoke/observe test loop that could be applied to all the operation implementations in a generic way simulating both success and failure (retry), to prevent recurrence/oversight?

I was thinking on that this morning - it's tricky because the logic is actually split between ObjectSessionFunctions, GarnetObjectBase, and the data type classes. ObjectSessionFunctions is the hard part there, as we'd ways to manufacture consistent-ish LogRecords.

If we run into more of these (I think I got them all) or similar issues we could harden the code by refactoring to either a) add a Reset() method to TOutput or b) introduce a TOutputFactory type to get fresh TOutputs on retries.

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.

SADD returning illegal result under concurrent load (for example, 2 when adding 1 item)

4 participants