Skip to content

Skip the CAS write when an operation changes nothing - #6

Open
janbjorge wants to merge 2 commits into
claude/code-review-bugs-vokwlk-03-s3-conditional-createfrom
claude/code-review-bugs-vokwlk-04-skip-noop-writes
Open

janbjorge wants to merge 2 commits into
claude/code-review-bugs-vokwlk-03-s3-conditional-createfrom
claude/code-review-bugs-vokwlk-04-skip-noop-writes

Conversation

@janbjorge

@janbjorge janbjorge commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

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_write fail on base; test_state_changing_ops_still_write, test_stale_sweep_alone_still_writes pass on both.

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 branch has not been deployed

No deployments
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.

1 participant