Skip to content

tso: speed up tso update for release-8.5-20251204-v8.5.4#10693

Merged
bufferflies merged 2 commits into
tikv:release-8.5-20251204-v8.5.4from
bufferflies:release-8.5-20251204-v8.5.4-speed-up-tso
May 21, 2026
Merged

tso: speed up tso update for release-8.5-20251204-v8.5.4#10693
bufferflies merged 2 commits into
tikv:release-8.5-20251204-v8.5.4from
bufferflies:release-8.5-20251204-v8.5.4-speed-up-tso

Conversation

@bufferflies
Copy link
Copy Markdown
Contributor

@bufferflies bufferflies commented May 20, 2026

What problem does this PR solve?

Issue Number: Close #10138
cp link:https://github.com/tikv/pd/pull/10137/changes

What is changed and how does it work?

1. Advance the physical timestamp by the GetTs request, not only by the ticker.
2. Only the ticker can save the timestamp into the storage when it reaches the save time to avoid frequent updating. 

Check List

Tests

  • Unit test
  • manual test
tiup playground nightly --pd 1 --kv 1 --tiflash 0 --db 0 --pd.host 10.138.0.52 --pd.config pd.toml --pd.binpath ./pd/bin/pd-server
./bin/pd-tso-bench -pd 10.138.0.52:2379 -client 500 -duration 10m -c 10

Master(tso-update-physical-interval = "2s"):
image

This PR(tso-update-physical-interval = "2s")
image

Code changes

Side effects

Related changes

Release note

None.

Summary by CodeRabbit

  • New Features

    • Added an observability metric to surface when saving timestamps is disallowed.
  • Bug Fixes

    • Retry logging for timestamp updates now includes an overflow indicator and returns the final attempt outcome.
    • Timestamp persistence is gated to avoid unintended physical updates.
    • Improved synchronization to reduce unnecessary physical timestamp changes.
  • Tests

    • Added tests for timestamp generation, guarded-save behavior, logical overflow, and concurrent access.

close tikv#10138

1. Advance the physical timestamp by the GetTs request, not only by the ticker.
2. Only the ticker can save the timestamp into the storage when it reaches the save time to avoid frequent updating.

Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented May 20, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign overvenus for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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 dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Important

Review skipped

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

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 18289d22-3873-4d7c-8ca7-8e42f10d706c

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 and usage tips.

@ti-chi-bot ti-chi-bot Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 20, 2026
Signed-off-by: bufferflies <1045931706@qq.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 82.92683% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-8.5-20251204-v8.5.4@34c6617). Learn more about missing BASE report.

Additional details and impacted files
@@                      Coverage Diff                       @@
##             release-8.5-20251204-v8.5.4   #10693   +/-   ##
==============================================================
  Coverage                               ?   78.18%           
==============================================================
  Files                                  ?      469           
  Lines                                  ?    64493           
  Branches                               ?        0           
==============================================================
  Hits                                   ?    50426           
  Misses                                 ?    10421           
  Partials                               ?     3646           
Flag Coverage Δ
unittests 78.18% <82.92%> (?)

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.

@bufferflies bufferflies merged commit 250861a into tikv:release-8.5-20251204-v8.5.4 May 21, 2026
22 of 23 checks passed
bufferflies added a commit that referenced this pull request May 21, 2026
@bufferflies bufferflies deleted the release-8.5-20251204-v8.5.4-speed-up-tso branch May 21, 2026 07:56
@bufferflies bufferflies restored the release-8.5-20251204-v8.5.4-speed-up-tso branch May 21, 2026 07:57
@bufferflies
Copy link
Copy Markdown
Contributor Author

ref #10702

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant