test: fix flaky DisaggReadSnapshot — skip background tasks during write+mergeDeltaAll (#10898) - #11035
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>
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
📝 WalkthroughWalkthroughThe ChangesDisaggReadSnapshot test setup
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
dbms/src/Storages/DeltaMerge/tests/gtest_segment_read_task.cpp (1)
656-657: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse camelCase for the scope guard variable.
Rename
fp_guardtofpGuard. The new local variable uses snake_case.As per coding guidelines, “Method and variable names should use
camelCase(e.g.,readBlock,totalBytes).”Proposed rename
- auto fp_guard + auto fpGuard🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dbms/src/Storages/DeltaMerge/tests/gtest_segment_read_task.cpp` around lines 656 - 657, Rename the local scope guard variable in the segment read test from fp_guard to fpGuard, leaving its fail-point disabling behavior unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@dbms/src/Storages/DeltaMerge/tests/gtest_segment_read_task.cpp`:
- Around line 656-657: Rename the local scope guard variable in the segment read
test from fp_guard to fpGuard, leaving its fail-point disabling behavior
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e6dcf79e-e5e6-451a-ba0c-5df416a2686b
📒 Files selected for processing (1)
dbms/src/Storages/DeltaMerge/tests/gtest_segment_read_task.cpp
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang, JinheLin 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:
|
|
/test pull-integration-test |
|
@ti-chi-bot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
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