Repository navigation
fix(tae): synchronize transfer page paths - #26527
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? |
|
Valid and fixed in 084774a. The physical file is now owned by one shared publication cohort rather than by any individual page: publication is sealed only after every page has accepted or rejected its path, and the file is deleted exactly once after sealing when the last live page releases it. This also covers a page closing after acceptance but before later siblings are published. Both normal write success and FileAlreadyExists use the same cohort helper. TestWriteTransferPage_ClosedPagePublication deterministically covers mixed and all-closed two-page batches on both branches; focused lifecycle tests passed with -race -count=100, the original regression passed with -race -count=14, and the full model and TAE DB test packages passed with and without -race. Scoped go vet also passed. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Approved exact head 084774a after full lifecycle re-review.
The two prior blockers are closed. Path publication and terminal cleanup are linearized per page, while the shared physical file is owned by one sealed cohort: publication cannot delete the file mid-batch, partial closure preserves live siblings, and the last live page triggers exactly one deletion after sealing. File-service I/O stays outside page/cohort locks. Q1-Q3 review found no remaining leak, wait-cycle, or unbounded-growth defect.
Local validation on the exact head:
- all four focused lifecycle tests passed under race independently at count=100;
- full pkg/vm/engine/tae/model passed under race;
- the original TestClearPersistTransferTable regression passed under race;
- scoped go vet passed.
The added mutexes are confined to path publication, disk fallback, and terminal cleanup; the in-memory Transfer hot path is unchanged. UT/SCA CI were still running when this review was submitted, so merge remains gated on CI.
Merge Queue Status
This pull request spent 48 minutes 36 seconds in the queue, including 48 minutes 9 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26523
What this PR does / why we need it:
TransferHashPage.pathwas a composite value written bySetPathwhile loading, logging, and TTL cleanup read it without synchronization. The page TTL goroutine could therefore race path publication and observe a mixed path.Path publication and terminal cleanup also form one resource-lifecycle state machine. A page may close before its persisted path is published, and one
WriteTransferPagebatch stores several pages in the same physical file. Page-local deletion is therefore insufficient: a late publisher can leak a file, while deleting for one closed page can invalidate still-live sibling pages.This PR:
FileAlreadyExistsrecovery;BVT is not applicable because this is an in-process Go concurrency and file-ownership bug with no SQL-visible semantic change.
Validation after the final code change and merge from
main(using the repository CGo include/library environment):-race -count=100go test -race ./pkg/vm/engine/tae/db/test -run '^TestClearPersistTransferTable$' -count=14go test -race ./pkg/vm/engine/tae/model -count=1go test -race ./pkg/vm/engine/tae/db/test -count=1go test ./pkg/vm/engine/tae/model ./pkg/vm/engine/tae/db/test -count=1go vet ./pkg/vm/engine/tae/model ./pkg/vm/engine/tae/db/testAPI, on-disk format, TTL timing, and transfer-file naming are unchanged. Cohort ownership may retain a shared file until its last page reaches terminal cleanup, which is required to keep live sibling pages loadable. File-service deletion errors retain the existing logged-error and temporary-file GC behavior.