Skip to content

fix(orchestrator): mint distinct message IDs for cancel re-publishes - #505

Merged
behinddwalls merged 1 commit into
mainfrom
preetam/speculation-cancel-msgid
Aug 7, 2026
Merged

fix(orchestrator): mint distinct message IDs for cancel re-publishes#505
behinddwalls merged 1 commit into
mainfrom
preetam/speculation-cancel-msgid

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why?

The cancel controller published its speculate hand-off with the bare batch ID as the message ID. The queue deduplicates on (topic, partition key, message ID) against every row it has not garbage-collected yet, consumed ones included, so a redelivery's re-publish for the same batch was a silent no-op — leaving a batch stuck Cancelling with nothing driving it to terminal. Same class of bug as b1f5795 in stovepipe.

What?

publishBatchID now goes through submitqueue/core/publish: publish.UniqueID mints a distinct message ID per publish (and documents the dedup rule once), and publish.Message owns the registry-lookup plumbing the controller previously hand-rolled. The batch-path test now asserts the payload still carries the batch ID while the message ID is distinct per publish, and the multi-batch tests assert on the payload's batch ID for the same reason.

Test Plan

bazel test //submitqueue/orchestrator/controller/cancel/...

Issues

@behinddwalls
behinddwalls marked this pull request as ready for review August 4, 2026 01:53
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners August 4, 2026 01:53
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from 733a5fd to f2e6633 Compare August 4, 2026 01:58
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from c2d441b to 37428c4 Compare August 4, 2026 01:58
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from f2e6633 to dda3dd3 Compare August 4, 2026 05:11
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch 2 times, most recently from c33a2d6 to 6cabb60 Compare August 5, 2026 03:15
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from dda3dd3 to 96feaf5 Compare August 5, 2026 03:15
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from 6cabb60 to 8a077b1 Compare August 5, 2026 03:26
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from 96feaf5 to d450509 Compare August 5, 2026 03:26
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from 8a077b1 to 492d1cb Compare August 5, 2026 03:38
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from d450509 to 9227c40 Compare August 5, 2026 03:38
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from 492d1cb to 65aad34 Compare August 5, 2026 03:43
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from 9227c40 to dbd61ed Compare August 5, 2026 03:44
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from 65aad34 to 3e3666f Compare August 5, 2026 04:11
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch 2 times, most recently from baf15bf to 82985ad Compare August 5, 2026 04:57
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from 3e3666f to 7f2f2fe Compare August 5, 2026 04:57
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch 2 times, most recently from b2a17a5 to bf0df7a Compare August 5, 2026 19:05
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from fd83d99 to 64f7e91 Compare August 5, 2026 19:05
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from bf0df7a to a6b5f8d Compare August 6, 2026 02:15
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from 64f7e91 to d51250d Compare August 6, 2026 02:15
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from a6b5f8d to 60970f0 Compare August 6, 2026 02:34
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from d51250d to 650a0d2 Compare August 6, 2026 02:34
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from 60970f0 to e780560 Compare August 6, 2026 03:04
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from 650a0d2 to a351b6b Compare August 6, 2026 03:04
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from e780560 to 4142ca7 Compare August 6, 2026 03:17
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from a351b6b to 04e65c5 Compare August 6, 2026 03:17
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from 4142ca7 to bd68e1f Compare August 6, 2026 03:32
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch 2 times, most recently from c167e22 to b2e22cc Compare August 7, 2026 03:15
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch 2 times, most recently from ae3dfa9 to c28713b Compare August 7, 2026 03:30
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from b2e22cc to 10ac3fc Compare August 7, 2026 03:30
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from 10ac3fc to fc33bc5 Compare August 7, 2026 19:48
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch 2 times, most recently from 350d26d to ee4fcaa Compare August 7, 2026 19:54
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from fc33bc5 to b8131db Compare August 7, 2026 19:54
@behinddwalls
behinddwalls force-pushed the preetam/speculation-buildsignal-paths branch from ee4fcaa to 6331c0f Compare August 7, 2026 20:13
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from b8131db to 17bbf48 Compare August 7, 2026 20:13
## Summary

### Why?

The cancel controller published its speculate hand-off with the bare batch ID as the message ID. The queue deduplicates on (topic, partition key, message ID) against every row it has not garbage-collected yet, consumed ones included, so a redelivery's re-publish for the same batch was a silent no-op — leaving a batch stuck Cancelling with nothing driving it to terminal. Same class of bug as b1f5795 in stovepipe.

### What?

`publishBatchID` now goes through `submitqueue/core/publish`: `publish.UniqueID` mints a distinct message ID per publish (and documents the dedup rule once), and `publish.Message` owns the registry-lookup plumbing the controller previously hand-rolled. The batch-path test now asserts the payload still carries the batch ID while the message ID is distinct per publish, and the multi-batch tests assert on the payload's batch ID for the same reason.

## Test Plan

✅ `bazel test //submitqueue/orchestrator/controller/cancel/...`

# Conflicts:
#	submitqueue/orchestrator/controller/cancel/BUILD.bazel
#	submitqueue/orchestrator/controller/cancel/cancel.go

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# interactive rebase in progress; onto 8548220f
# Last command done (1 command done):
#    pick c167e22 # fix(orchestrator): mint distinct message IDs for cancel re-publishes
# No commands remaining.
# You are currently rebasing branch 'preetam/speculation-cancel-msgid' on '8548220f'.
#
# Changes to be committed:
#	modified:   submitqueue/orchestrator/controller/cancel/BUILD.bazel
#	modified:   submitqueue/orchestrator/controller/cancel/cancel.go
#	modified:   submitqueue/orchestrator/controller/cancel/cancel_test.go
#
@behinddwalls
behinddwalls force-pushed the preetam/speculation-cancel-msgid branch from 17bbf48 to 288ee84 Compare August 7, 2026 20:14
@behinddwalls
behinddwalls changed the base branch from preetam/speculation-buildsignal-paths to main August 7, 2026 20:14
@behinddwalls
behinddwalls merged commit 66307af into main Aug 7, 2026
13 of 15 checks passed
@behinddwalls
behinddwalls deleted the preetam/speculation-cancel-msgid branch August 7, 2026 20:23
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.

2 participants