Repository navigation
fix(frontend): keep stream pop count on callback error - #26116
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
16754e7 to
c84a977
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Found one blocking unhappy-path consistency issue at head c84a977.
[Q2] PopByVectorsStream still loses callback-undelivered in-memory rows, and its failure semantics depend on whether the rows are resident or spilled. shard.mem.collect(...) removes every matching row before the callback loop starts. With two rows for one key and removeAll=true, the new test returns removed == 2 after the callback was invoked only once and failed; the second payload has been deleted without ever being presented to the callback. The test currently codifies that loss. By contrast, collectSpillPopStream tombstones and invokes the callback one entry at a time, so the same first-callback failure removes only the first spilled entry.
Please make removal/delivery ordering consistent across memory and spill (for example, remove and invoke per row, stopping before deleting later rows, or restore rows not delivered after an error), then add the same-key multi-row callback-error truth table for both storage tiers. The returned count, ItemCount, callback invocation count, and remaining rows should agree in both cases. This also addresses the latest #26081 comment rather than only repairing the counter after data has already been lost.
Validation on the exact head: both new callback-error tests passed under race individually and with adaptive -count=19; the full pkg/frontend/databranchutils package also passed under race. The tests confirm the accounting fix, but the in-memory expectation itself demonstrates the blocker above.
|
Addressed the current-head callback-error consistency finding in The in-memory path now removes and accounts for one row immediately before each callback, matching the spill path. On the first callback error, later same-key rows remain available. The regression matrix now asserts callback count, returned removal count, Validation:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review completed on exact head 56a8e50. The previous callback-error consistency blocker is resolved: in-memory and spill paths now remove/account one delivered row at a time and preserve later undelivered rows. Focused adaptive race stress, full owning-package race/non-race tests, build/vet, and a frontend consumer regression passed.
Merge Queue Status
This pull request spent 1 hour 24 minutes 37 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #26116 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
Failing checks:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
…26116) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26081 ## What this PR does / why we need it: Finalize each `PopByVectorsStream` shard through one accounting-and-unlock path. If a callback fails after rows have already been removed, those rows now decrement `ItemCount()` and are included in the returned removal count before the original callback error is returned. Add regressions for both in-memory removal and an actual spilled-row tombstone, while retaining the existing success-path coverage. Validation: - `go test ./pkg/frontend/databranchutils -run '^TestBranchHashmapPopByVectorsStream(InMemory|Spilled)(CallbackError)?$' -count=3` - `go test -race ./pkg/frontend/databranchutils -run '^TestBranchHashmapPopByVectorsStream(InMemory|Spilled)(CallbackError)?$' -count=3` - `go test ./pkg/frontend/databranchutils -count=1` - `git diff upstream/main...HEAD --check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…26116) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26081 ## What this PR does / why we need it: Finalize each `PopByVectorsStream` shard through one accounting-and-unlock path. If a callback fails after rows have already been removed, those rows now decrement `ItemCount()` and are included in the returned removal count before the original callback error is returned. Add regressions for both in-memory removal and an actual spilled-row tombstone, while retaining the existing success-path coverage. Validation: - `go test ./pkg/frontend/databranchutils -run '^TestBranchHashmapPopByVectorsStream(InMemory|Spilled)(CallbackError)?$' -count=3` - `go test -race ./pkg/frontend/databranchutils -run '^TestBranchHashmapPopByVectorsStream(InMemory|Spilled)(CallbackError)?$' -count=3` - `go test ./pkg/frontend/databranchutils -count=1` - `git diff upstream/main...HEAD --check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…26116) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#26081 ## What this PR does / why we need it: Finalize each `PopByVectorsStream` shard through one accounting-and-unlock path. If a callback fails after rows have already been removed, those rows now decrement `ItemCount()` and are included in the returned removal count before the original callback error is returned. Add regressions for both in-memory removal and an actual spilled-row tombstone, while retaining the existing success-path coverage. Validation: - `go test ./pkg/frontend/databranchutils -run '^TestBranchHashmapPopByVectorsStream(InMemory|Spilled)(CallbackError)?$' -count=3` - `go test -race ./pkg/frontend/databranchutils -run '^TestBranchHashmapPopByVectorsStream(InMemory|Spilled)(CallbackError)?$' -count=3` - `go test ./pkg/frontend/databranchutils -count=1` - `git diff upstream/main...HEAD --check` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26081
What this PR does / why we need it:
Finalize each
PopByVectorsStreamshard through one accounting-and-unlock path. If a callback fails after rows have already been removed, those rows now decrementItemCount()and are included in the returned removal count before the original callback error is returned.Add regressions for both in-memory removal and an actual spilled-row tombstone, while retaining the existing success-path coverage.
Validation:
go test ./pkg/frontend/databranchutils -run '^TestBranchHashmapPopByVectorsStream(InMemory|Spilled)(CallbackError)?$' -count=3go test -race ./pkg/frontend/databranchutils -run '^TestBranchHashmapPopByVectorsStream(InMemory|Spilled)(CallbackError)?$' -count=3go test ./pkg/frontend/databranchutils -count=1git diff upstream/main...HEAD --check