fix: handle CAS batch result row ordering for ScyllaDB compatibility#9485
Merged
bergundy merged 2 commits intotemporalio:mainfrom Mar 16, 2026
Merged
fix: handle CAS batch result row ordering for ScyllaDB compatibility#9485bergundy merged 2 commits intotemporalio:mainfrom
bergundy merged 2 commits intotemporalio:mainfrom
Conversation
yycptt
approved these changes
Mar 11, 2026
bergundy
approved these changes
Mar 11, 2026
Member
bergundy
left a comment
There was a problem hiding this comment.
Thanks!
LGTM, but please fix the function name as suggested.
Cassandra returns CAS batch result rows in clustering key order, while ScyllaDB returns them in statement order. The nexus endpoint store assumed Cassandra's ordering, causing the partition-status and endpoint rows to be swapped on ScyllaDB. Add classifyBatchCASRows() that inspects the "type" column to assign rows to their correct roles regardless of iteration order. Reorder the DELETE batch so the table-version update comes first, satisfying both databases' ordering.
2015280 to
d48653f
Compare
birme
pushed a commit
to eyevinn-osaas/temporal
that referenced
this pull request
Mar 23, 2026
…emporalio#9485) Cassandra returns CAS batch result rows in clustering key order, while ScyllaDB returns them in statement order. The nexus endpoint store assumed Cassandra's ordering, causing the partition-status and endpoint rows to be swapped on ScyllaDB. ## What changed? Add classifyBatchCASRows() that inspects the "type" column to assign rows to their correct roles regardless of iteration order. Reorder the DELETE batch so the table-version update comes first, satisfying both databases' ordering. ## Why? See above. ## How did you test it? - [x] built - [x] run locally and tested manually - against both. - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks Verified it works well against both.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cassandra returns CAS batch result rows in clustering key order, while ScyllaDB returns them in statement order. The nexus endpoint store assumed Cassandra's ordering, causing the partition-status and endpoint rows to be swapped on ScyllaDB.
What changed?
Add classifyBatchCASRows() that inspects the "type" column to assign rows to their correct roles regardless of iteration order. Reorder the DELETE batch so the table-version update comes first, satisfying both databases' ordering.
Why?
See above.
How did you test it?
Potential risks
Verified it works well against both.