Skip to content

Conversation

@MyonKeminta
Copy link
Contributor

@MyonKeminta MyonKeminta commented Jun 13, 2025

What problem does this PR solve?

Issue Number: ref #8978

The UpdateServiceGCSafePoint(V2) methods are going to be deprecated and replaced by a compatibility layer over the GCStatesManager, which is expected to be done in #9292. However it's not sure when #9292 can be merged. Now, there still exist usages of UpdateServiceGCSafePoint(V2), but TiDB won't register the service safe point of "gc_worker" anymore. This causes that when other components tries to register their service safe points, the "gc_worker"'s service safe point may be automatically initialized as 0, allowing data access that breaks the constraint of txn safe point.

This PR is a temporary solution to this problem, and should be finally cleaned up in #9292. This PR makes the service safe point of "gc_worker" always be initalized to the same value as the current txn safe point.

What is changed and how does it work?

This PR makes the initialization of the service safe point of gc_worker to consider the txn safe point.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

…th the new txn safe point mechanism

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 13, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 13, 2025
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta
Copy link
Contributor Author

/retest

@codecov
Copy link

codecov bot commented Jun 13, 2025

Codecov Report

Attention: Patch coverage is 59.09091% with 9 lines in your changes missing coverage. Please review.

Project coverage is 76.20%. Comparing base (ecb09cc) to head (69fcf70).
Report is 1 commits behind head on master.

❌ Your patch status has failed because the patch coverage (59.09%) is below the target coverage (74.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9407      +/-   ##
==========================================
+ Coverage   76.16%   76.20%   +0.04%     
==========================================
  Files         478      478              
  Lines       74782    74794      +12     
==========================================
+ Hits        56954    56999      +45     
+ Misses      14296    14276      -20     
+ Partials     3532     3519      -13     
Flag Coverage Δ
unittests 76.20% <59.09%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MyonKeminta MyonKeminta marked this pull request as ready for review June 13, 2025 07:30
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 13, 2025
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jun 13, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 13, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: okJiang, rleungx

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:

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 13, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 13, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-06-13 08:08:46.587854269 +0000 UTC m=+601704.816169530: ☑️ agreed by rleungx.
  • 2025-06-13 08:36:12.589831427 +0000 UTC m=+603350.818146691: ☑️ agreed by okJiang.

@MyonKeminta
Copy link
Contributor Author

/retest

4 similar comments
@MyonKeminta
Copy link
Contributor Author

/retest

@MyonKeminta
Copy link
Contributor Author

/retest

@MyonKeminta
Copy link
Contributor Author

/retest

@MyonKeminta
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 49c177a into tikv:master Jun 13, 2025
54 of 82 checks passed
@MyonKeminta MyonKeminta deleted the m/service-safe-point-compatibility-temp-solution branch June 13, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants