Repository navigation
Skip the CAS write when an operation changes nothing - #6
Open
janbjorge wants to merge 2 commits into
Conversation
DirectQueue and GroupCommitLoop wrote back after every operation, even when the state was unchanged: a dequeue on an empty queue, a requeue_stale with nothing stale, a batch of only failed ops. Idle pollers paid a full object write per poll, bumped the etag, and caused CAS conflicts for concurrent writers doing real work. A dequeue against a missing object also created it. StateQueries replaces its state only when an op changes it, so compare the result to the decoded snapshot by identity and skip the write when they match. The snapshot just read is a valid linearization point for an op that changed nothing.
This was referenced Sep 28, 2026
This branch has not been deployed
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.
Stack 4/9, base #5.
Empty dequeues and similar no-ops still wrote the object, costing a PUT per poll and causing CAS conflicts for real writers. Now the write is skipped when state is unchanged.
Tests:
test_empty_dequeue_does_not_write,test_dequeue_on_missing_object_does_not_create_it,test_noop_batch_does_not_writefail on base;test_state_changing_ops_still_write,test_stale_sweep_alone_still_writespass on both.