Skip to content

test: fix flaky DisaggReadSnapshot — skip background tasks during write+mergeDeltaAll (#10898) - #10932

Merged
ti-chi-bot[bot] merged 2 commits into
pingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-10898-to-release-nextgen-202603
Jun 26, 2026
Merged

test: fix flaky DisaggReadSnapshot — skip background tasks during write+mergeDeltaAll (#10898)#10932
ti-chi-bot[bot] merged 2 commits into
pingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-10898-to-release-nextgen-202603

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #10898

What problem does this PR solve?

Issue Number: close #10897

Problem Summary:
DMStoreForSegmentReadTaskTest.DisaggReadSnapshot is flaky — the initial write(4096) schedules a background flush task
whose completion handler (placeDeltaIndex) and follow-up background merge delta both acquire is_updating on
DeltaValueSpace. When mergeDeltaAll() 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_update failpoint before the initial write(4096) + mergeDeltaAll() block in the test,
with a scoped guard that disables it on exit. This prevents checkSegmentUpdate from scheduling any background
flush/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 enable skip_check_segment_update via disableFlushCache() before their
write+mergeDeltaAll blocks.

Check List

Tests

  • Unit test

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Summary by CodeRabbit

  • Tests
    • Improved reliability of segment snapshot comparison tests by adding explicit control around the stable write/merge sequence used during setup, and ensuring that control is cleaned up afterward. This reduces flaky behavior during snapshot validation and makes test outcomes more consistent.

…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>
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202603 labels Jun 26, 2026
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • release-8.5
  • release-7.5
  • release-8.1

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2a9f03c2-a955-4c3a-a48e-4214e54b87d9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot ti-chi-bot Bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 26, 2026
@JaySon-Huang
JaySon-Huang requested review from JinheLin and yongman June 26, 2026 02:08
@ti-chi-bot

ti-chi-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [JaySon-Huang,yongman]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 26, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

[LGTM Timeline notifier]

Timeline:

  • 2026-06-26 02:08:14.820322853 +0000 UTC m=+258978.483548366: ☑️ agreed by JaySon-Huang.
  • 2026-06-26 02:16:40.184789139 +0000 UTC m=+259483.848014662: ☑️ agreed by yongman.

@JaySon-Huang

Copy link
Copy Markdown
Contributor

/hold
let other PR get merged first

@ti-chi-bot ti-chi-bot Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 26, 2026
@JaySon-Huang

Copy link
Copy Markdown
Contributor

/unhold

@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 26, 2026
@ti-chi-bot
ti-chi-bot Bot merged commit b72b022 into pingcap:release-nextgen-202603 Jun 26, 2026
6 checks passed
@ti-chi-bot
ti-chi-bot Bot deleted the cherry-pick-10898-to-release-nextgen-202603 branch June 26, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202603

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants