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: merge lastTS and lastArrivalTS into an atomic pointer #1054

Merged
merged 6 commits into from
Nov 15, 2023

Conversation

you06
Copy link
Contributor

@you06 you06 commented Nov 9, 2023

close #1053

The update of lastTS and lastArrivalTS should be atomic, unless we may get new lateTS with old lastArrivalTS when calling GetStaleTimestamp which may lead to a future TSO.

This PR merge lastTS and lastArrivalTS into an atomic pointer and fix the future stale TSO bug.

Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
@disksing
Copy link
Collaborator

@JmPotato Please take a look

oracle/oracles/pd.go Outdated Show resolved Hide resolved
oracle/oracles/pd.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cfzjywxk cfzjywxk left a comment

Choose a reason for hiding this comment

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

LGTM

@cfzjywxk cfzjywxk merged commit 7c96dfd into tikv:master Nov 15, 2023
10 checks passed
you06 added a commit to you06/client-go that referenced this pull request Nov 20, 2023
* fix the issue that stale timestamp may be a future one

Signed-off-by: you06 <you1474600@gmail.com>

* add regression test

Signed-off-by: you06 <you1474600@gmail.com>

* lazy init lastTSO

Signed-off-by: you06 <you1474600@gmail.com>

* fix panic

Signed-off-by: you06 <you1474600@gmail.com>

* address comment

Signed-off-by: you06 <you1474600@gmail.com>

---------

Signed-off-by: you06 <you1474600@gmail.com>
disksing pushed a commit that referenced this pull request Nov 20, 2023
you06 added a commit to you06/client-go that referenced this pull request Nov 20, 2023
* fix the issue that stale timestamp may be a future one

Signed-off-by: you06 <you1474600@gmail.com>

* add regression test

Signed-off-by: you06 <you1474600@gmail.com>

* lazy init lastTSO

Signed-off-by: you06 <you1474600@gmail.com>

* fix panic

Signed-off-by: you06 <you1474600@gmail.com>

* address comment

Signed-off-by: you06 <you1474600@gmail.com>

---------

Signed-off-by: you06 <you1474600@gmail.com>
disksing pushed a commit that referenced this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetStaleTimestamp may return future TSO
4 participants