Repository navigation
Description
Is there an existing issue for the same bug?
- I searched open and closed
matrixorigin/matrixoneissues forTestClearPersistTransferTable,TransferHashPage,SetPath, andClearPersistTable; no matching issue was found.
Branch Name
main
Commit ID
Other Environment Information
- GitHub Actions workflow:
MatrixOne ALL CI - Job:
Matrixone CI / UT Test on Ubuntu/x86 - Runner: Ubuntu x86, Go race detector enabled
- PR head tested:
1fd0b38f5c31b681acca920cd983b05779095b08
Actual Behavior
TestClearPersistTransferTable fails under the race detector because TransferHashPage.path is accessed concurrently without synchronization.
The detected write is:
github.com/matrixorigin/matrixone/pkg/vm/engine/tae/model.(*TransferHashPage).SetPath()
pkg/vm/engine/tae/model/pages.go:351
github.com/matrixorigin/matrixone/pkg/vm/engine/tae/db/test.TestClearPersistTransferTable.func1()
pkg/vm/engine/tae/db/test/db_test.go:11690
The concurrent read is:
github.com/matrixorigin/matrixone/pkg/vm/engine/tae/model.(*TransferHashPage).ClearPersistTable()
pkg/vm/engine/tae/model/pages.go:404
github.com/matrixorigin/matrixone/pkg/vm/engine/tae/model.(*TransferHashPage).Close()
github.com/matrixorigin/matrixone/pkg/vm/engine/tae/model.(*TransferTable).executeTTL()
The read runs from the transfer-table TTL cron goroutine while the test goroutine assigns the persisted path. The race detector terminates the test with race detected during execution of test.
This was observed while validating PR #26504, whose diff only changes Data Branch float SQL formatting and its regression tests; it does not touch TAE transfer pages or TTL lifecycle code.
Expected Behavior
Publication and consumption of a persisted transfer-page path must have a defined synchronization/ownership contract. SetPath, loading, TTL cleanup, close, and string/logging paths should not concurrently read and write TransferHashPage.path without synchronization, and the focused test should pass under -race.
Steps to Reproduce
- Check out commit
0b8b53dff3869dcd5e3ab52992852c9ea6545026or the tested PR head. - Run the focused TAE DB test with the race detector, using the repository's required CGo test environment:
go test -race ./pkg/vm/engine/tae/db/test -run '^TestClearPersistTransferTable$' -count=1
- If the timing does not trigger on the first attempt, repeat the focused test or run the full Ubuntu/x86 UT workflow.
- Observe the race between
TransferHashPage.SetPathandTransferHashPage.ClearPersistTablethrough the TTL cron job.
Additional information
The relevant field is a composite model.Path. A correct fix should cover all concurrent readers of page.path, not only the two race-detector frames shown above, and should preserve the transfer-page TTL and persisted-file cleanup semantics.
Activity