Skip to content

tso, server, tests: add a test case for tso allocation bug #2675

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

Merged
merged 3 commits into from
Jul 23, 2020

Conversation

JmPotato
Copy link
Member

@JmPotato JmPotato commented Jul 22, 2020

Signed-off-by: JmPotato [email protected]

What problem does this PR solve?

Previous PR #2665 tries to fix a bug that tso allocation may fail though it's already a PD leader, which lacks of a test case can cover this situation. This pr adds a test case and makes some slight changes than before.

According to these two TiDB jenkins tests, tso may still have some problems when leader changes. I need more logs to figure out why, so this pr also adds some log info when a tso request arrive.

What is changed and how it works?

  • Try to set lease as soon as possible in SyncTimestamp.
  • Add some new methods to Server for test purpose.
  • Add more logs.

Check List

Tests

  • Unit test
  • Integration test

Related changes

Release note

Add more tests and logs for TSO request.

@ti-srebot ti-srebot added the contribution This PR is from a community contributor. label Jul 22, 2020
@JmPotato JmPotato requested review from disksing and lhy1024 July 22, 2020 09:30
@JmPotato JmPotato added component/testing CI testing. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. labels Jul 22, 2020
@JmPotato JmPotato linked an issue Jul 22, 2020 that may be closed by this pull request
Signed-off-by: JmPotato <[email protected]>
@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 23, 2020
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jul 23, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 23, 2020
@nolouch
Copy link
Contributor

nolouch commented Jul 23, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 23, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 6dab049 into tikv:master Jul 23, 2020
ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Jul 23, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #2678

nolouch pushed a commit that referenced this pull request Jul 27, 2020
Signed-off-by: ti-srebot <[email protected]>

Co-authored-by: Haizhi Geng <[email protected]>
@JmPotato JmPotato deleted the tso_bug_test branch August 20, 2020 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/testing CI testing. contribution This PR is from a community contributor. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. 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.

TSO request may fail at the time of leader changing
4 participants