test: fix flaky DisaggReadSnapshot — skip background tasks during write+mergeDeltaAll (#10898) - #10932
Conversation
…g setup skip_check_segment_update prevents write() from scheduling background flush/merge tasks, avoiding a race where background placeDeltaIndex or merge delta holds is_updating and causes mergeDeltaAll() to fail silently, resulting in 5 persisted column files instead of the expected 4. Close pingcap#10897.
Signed-off-by: JaySon-Huang <tshent@qq.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang, yongman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/hold |
|
/unhold |
b72b022
into
pingcap:release-nextgen-202603
This is an automated cherry-pick of #10898
What problem does this PR solve?
Issue Number: close #10897
Problem Summary:
DMStoreForSegmentReadTaskTest.DisaggReadSnapshotis flaky — the initialwrite(4096)schedules a background flush taskwhose completion handler (
placeDeltaIndex) and follow-up background merge delta both acquireis_updatingonDeltaValueSpace. WhenmergeDeltaAll()runs before these background tasks release the lock, it fails silently,leaving 5 persisted column files instead of the expected 4.
What is changed and how it works?
Enable
skip_check_segment_updatefailpoint before the initialwrite(4096)+mergeDeltaAll()block in the test,with a scoped guard that disables it on exit. This prevents
checkSegmentUpdatefrom scheduling any backgroundflush/merge tasks during the setup phase, eliminating the race entirely.
This is consistent with other tests in the same file (
fetchPagesNoTinyNoInMem,fetchPagesTinyNoInMem,fetchPagesTinyInMem) which already enableskip_check_segment_updateviadisableFlushCache()before theirwrite+mergeDeltaAll blocks.
Check List
Tests
Side effects
Documentation
Release note
Summary by CodeRabbit