Repository navigation
Add commit (poll -> process -> commit) to queue/v1 - #439
Merged
Merged
Conversation
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
2 times, most recently
from
July 21, 2026 13:02
ae2cb22 to
78bfc14
Compare
em3s
force-pushed
the
feat/queue-eviction
branch
2 times, most recently
from
July 21, 2026 13:39
207bd89 to
cf7684f
Compare
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 13:44
78bfc14 to
28c795c
Compare
em3s
force-pushed
the
feat/queue-eviction
branch
from
July 21, 2026 13:45
cf7684f to
d08e0e1
Compare
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 13:49
28c795c to
fc9987b
Compare
em3s
force-pushed
the
feat/queue-eviction
branch
from
July 21, 2026 13:50
d08e0e1 to
5af5def
Compare
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 13:58
fc9987b to
945a7ec
Compare
em3s
force-pushed
the
feat/queue-eviction
branch
from
July 21, 2026 13:59
5af5def to
b3aeb1c
Compare
1 task done
em3s
force-pushed
the
feat/immutable-edge-scan-delete
branch
from
July 21, 2026 14:48
945a7ec to
704c41b
Compare
em3s
force-pushed
the
feat/queue-eviction
branch
from
July 21, 2026 14:48
b3aeb1c to
f663df0
Compare
…offset
Add `DELETE /queue/v1/namespaces/{ns}/queues/{queue}/partitions/{partition}/messages?offset=X`.
A consumer polls a partition, processes the batch, then commits up to the batch's offset:
every message with `seq <= offset` is deleted. This is the poll -> process -> commit
lifecycle and doubles as retention/eviction (one op, since an immutable edge keeps no
per-message ack state — the delete is the state).
`QueueService.commit` loops the engine scan-and-delete (`MutationService.scanDelete`) in
pages of `COMMIT_BATCH` until the `seq <= offset` range is drained, returning the count
deleted. `offset` mirrors poll's forward cursor, so `commit(offset = polledPage.offset)`
deletes exactly the polled prefix.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
em3s
force-pushed
the
feat/queue-eviction
branch
from
July 21, 2026 14:58
f663df0 to
6f5999f
Compare
Contributor
Author
|
Optimistic |
1 task done
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.
Summary
Add commit to queue/v1: a consumer polls a partition, processes the batch, then commits up to that batch's offset — every message with
seq <= offsetis deleted.DELETE /queue/v1/namespaces/{ns}/queues/{queue}/partitions/{partition}/messages?offset=X.This completes the poll → process → commit lifecycle and doubles as retention/eviction. An immutable edge keeps no per-message ack state, so there is a single operation: the delete is the committed position.
offsetmirrors poll's forward cursor, socommit(offset = polledPage.offset)deletes exactly the prefix just polled.Stacked on #438 — base is
feat/immutable-edge-scan-delete; review/merge that first.commitis the queue-level use of #438's scan-and-delete primitive. (The immutable-edge constraint from #440 is already inmain.)Single consumer per partition: committing deletes the prefix, so it assumes one logical consumer advancing a partition (Kafka-style), not independent consumers sharing one.
Changes
QueueService.commit(namespace, queue, partition, offset)— loopsMutationService.scanDeletein pages ofCOMMIT_BATCHuntil theseq <= offsetrange is drained, returning the total deleted; validates the partition is in range.MessageController:DELETE .../partitions/{partition}/messages?offset=X→QueueCommitResponse{namespace, queue, partition, committed}.ReadOnlyRequestFilterclassifies the endpoint as a write (blocked in read-only mode).How to Test
./gradlew :server:test --tests "*queue.v1.*"— includes a lifecycle E2E: enqueue seq 1..5, poll a batch of 3,commit(offset = page.offset), assert 3 deleted and a re-poll from the start returns only 4/5, then commit the rest and the partition drains../gradlew :engine:spotlessCheck :server:spotlessCheck.AI Assistance