Repository navigation
feat(conflict): Add target signature and dictionary store contracts - #850
Merged
Merged
Conversation
manjari25
marked this pull request as draft
October 13, 2026 19:47
manjari25
force-pushed
the
manjari/tango-signature-entities-and-contracts
branch
from
October 14, 2026 02:03
5b5e9d2 to
5afc805
Compare
manjari25
marked this pull request as ready for review
October 14, 2026 02:26
manjari25
added this pull request to stack #872
October 14, 2026 21:02
behinddwalls
approved these changes
Oct 16, 2026
manjari25
force-pushed
the
manjari/tango-signature-entities-and-contracts
branch
from
October 16, 2026 18:39
842f382 to
5d2bc1e
Compare
DivyanshGarg380
pushed a commit
to DivyanshGarg380/submitqueue
that referenced
this pull request
Oct 17, 2026
## Why? Signatures are expensive to recompute, so the analyzer needs a durable source of truth keyed by batch. This PR implements the `SignatureStore` contract from the [previous PR](uber#850) on MySQL, as a package owned by the tango conflict extension. ## What? Everything is added under `submitqueue/extension/conflict/tango/mysql`: - Adds the `target_signature` table: - Primary key `(queue, batch_id)`, with no secondary index. - A row is written once and never updated. - `targets` is a `LONGBLOB`, because the largest signatures can be large. - Adds a queue-bound MySQL `SignatureStore`: - A duplicate create maps to `storage.ErrAlreadyExists`. - A signature whose queue differs from the bound queue is rejected. - `Get` reports a missing batch as `found=false`, not as an error. - Adds a small binary codec for the targets: an 8-byte big-endian ID followed by a signed varint distance per entry. The codec lives next to the MySQL store because the byte format is a storage detail, so callers only ever see `tango.TargetSignature`. - Adds the schema directory to the `queueshard` linter so the new table's primary key is checked. - Restricts the Bazel visibility of the MySQL package to the tango tree, the orchestrator service wiring, and its integration test. - Adds an integration suite with its own compose file, which runs the store against a real MySQL. It covers a large (100k-target) signature, a duplicate create keeping the first signature, and queue isolation. - The store is not added to the orchestrator `Storage` aggregate. Nothing constructs it yet, and wiring the schema into the compose stack, the e2e suites and the local init target is left for the PR that uses it. ## Test Plan `./tool/bazel test //submitqueue/extension/conflict/tango/mysql:go_default_test` `./tool/bazel test //test/integration/submitqueue/extension/conflict/tango/mysql/... --test_output=streamed` `make check-gazelle` `make check-mocks` `make lint` CI ## Issue
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.
Why?
The Tango-backed conflict analyzer needs to persist each batch's affected-target signature, and a dictionary that maps the 64-bit target IDs back to their labels. This is the first PR in a stack that builds that storage layer. It defines the vocabulary and contracts only.
What?
Everything is added under
submitqueue/extension/conflict/tango, the extension that owns the data:TargetSignature,SignatureTargetandTargetLabelentities.SignatureReaderandSignatureStore:Get: returns(signature, found, error).Create: write-once, returns an already-exists error on a repeat.SignatureStoreembedsSignatureReader, so a consumer such as conflict relaxation can take the read-only view and cannot write.DictionaryReaderandDictionaryStore, keyed by(queue, ID), with the same read/write split:Create: write-once, returns an already-exists error if the ID is already recorded, even with a different label, so the first label stays.Get: returns(label, found, error). A label that differs from the caller's means a hash collision.tangopackage, not amock/subpackage, so the analyzer's same-package tests do not create an import cycle.Test Plan
make check-gazellemake check-mocksmake lint./tool/bazel test //submitqueue/extension/conflict/...CI
Issue