Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tso: improve skipping sync condition and add more logs #7139

Merged
merged 6 commits into from
Sep 25, 2023

Conversation

JmPotato
Copy link
Member

@JmPotato JmPotato commented Sep 22, 2023

What problem does this PR solve?

Issue Number: Close #7138.

What is changed and how does it work?

Only skip the sync if the following conditions are met:

1. The timestamp in memory has been initialized.
2. The last saved timestamp in etcd is not zero.
3. The last saved timestamp in memory is not zero.
4. The last saved timestamp in etcd is equal to the last saved timestamp in memory.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

@JmPotato JmPotato added the component/tso Timestamp Oracle. label Sep 22, 2023
@JmPotato JmPotato requested review from lhy1024 and rleungx September 22, 2023 06:24
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 22, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024
  • rleungx

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed do-not-merge/needs-triage-completed labels Sep 22, 2023
@JmPotato JmPotato force-pushed the enhance_SyncTimestamp branch from 6a32123 to 65f2a17 Compare September 22, 2023 06:28
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Merging #7139 (84536fc) into master (e6c8841) will increase coverage by 0.02%.
Report is 5 commits behind head on master.
The diff coverage is 52.63%.

❗ Current head 84536fc differs from pull request most recent head 48682cc. Consider uploading reports for the commit 48682cc to get more accurate results

@@            Coverage Diff             @@
##           master    #7139      +/-   ##
==========================================
+ Coverage   74.31%   74.33%   +0.02%     
==========================================
  Files         440      440              
  Lines       47217    47194      -23     
==========================================
- Hits        35088    35083       -5     
+ Misses       9034     9010      -24     
- Partials     3095     3101       +6     
Flag Coverage Δ
unittests 74.33% <52.63%> (+0.02%) ⬆️

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

pkg/tso/tso.go Outdated Show resolved Hide resolved
@JmPotato JmPotato force-pushed the enhance_SyncTimestamp branch from 65f2a17 to c441471 Compare September 25, 2023 05:12
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 25, 2023
@JmPotato JmPotato requested a review from rleungx September 25, 2023 05:16
@JmPotato JmPotato force-pushed the enhance_SyncTimestamp branch from c441471 to 9409d62 Compare September 25, 2023 05:18
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 25, 2023
Signed-off-by: JmPotato <[email protected]>
@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 25, 2023
@JmPotato
Copy link
Member Author

/merge

1 similar comment
@lhy1024
Copy link
Contributor

lhy1024 commented Sep 25, 2023

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2023

@JmPotato: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions 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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2023

@lhy1024: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions 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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 545363b

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 25, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 545363b

@CabinfeverB
Copy link
Member

/hold

@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 Sep 25, 2023
@JmPotato
Copy link
Member Author

/hold

@JmPotato JmPotato removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 25, 2023
@JmPotato
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2023

@JmPotato: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions 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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2023

@JmPotato: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions 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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit 7e6cd0a into tikv:master Sep 25, 2023
19 checks passed
@JmPotato JmPotato deleted the enhance_SyncTimestamp branch September 25, 2023 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tso Timestamp Oracle. 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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SyncTimestamp might be skipped unexpectedly
4 participants