Repository navigation
[AI-3477] Pin the source usage id of a request moved on twice - #2234
Merged
Merged
Conversation
A request sent home after a third hop (A to B to C to A) must be one row where it was recorded. Taking source_usage_id from the sent usage_id instead of the origin left this uncovered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kanat
commented
Nov 23, 2026
kanat
left a comment
Collaborator
Author
There was a problem hiding this comment.
No findings at 972e9ba.
Verdict: GO.
Checked, on the head merged onto current main (2c52b62, unchanged since the branch point):
- The diff is
datamove_test.goonly (+25); no production code changes. - The test walks a real A -> B -> C -> A path:
s.moveinto the destination, thenImportRowinto another customer there, thenImportRowback into the source. It asserts one row at A and its usage id equals the one the request first had, not only the count. - It passes on the head 5 of 5 runs (
-count=1) and the wholeTestDataMoveSuitepasses. - Mutant N3 (
picked[j] = "r.usage_id", datamove.go:761) fails it 5 of 5 (2 rows, expected 1). A second mutant,picked[j] = "r.source_usage_id", also fails it 5 of 5. Swapping theCOALESCEorder oforiginfails it together with its two neighbours. - The request id comes from
crypto/randand every test truncates first, so ids cannot collide with another test or suite. - A merge-tree of this head with #2208, #2221 and #2230 (each alone, then all three) is clean, and
go vet -tags integration ./internal/store/passes on the combined tree.
CI: this is a draft, so the Go jobs are skipped; they run at gh pr ready.
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.
Test only, no code change. There is no production caller: the PR pins code that is already on main.
Problem
#2189 round-2 review, finding R2.2: mutant N3 survives the whole
DataMoveSuiteon main. N3 changespicked[j] = origintopicked[j] = "r.usage_id"atacceleration/internal/store/datamove.go:761, the line that keeps the first recorded usage id assource_usage_idof a copy. A request that moves on twice and comes back (A -> B -> C -> A) is then two rows at A.Test
TestARequestMovedOnTwiceAndBackIsOneRowWhereItWasRecorded, next toTestARequestMovedOnFromACopyIsOneRowWhereverItLands:Expected: one row at A, with the usage id it had first. The request id is random (
crypto/rand).Mutation
picked[j] = "r.usage_id"(datamove.go:761)go test -tags integration ./internal/store/ -run TestDataMoveSuite: pass on the head (33 s).🤖 Generated with Claude Code