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.

@you06 you06 force-pushed the tso/merge-last-ts branch from f07a0cd to 47a2c0b Compare November 9, 2023 07:05
@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 <[email protected]>

* add regression test

Signed-off-by: you06 <[email protected]>

* lazy init lastTSO

Signed-off-by: you06 <[email protected]>

* fix panic

Signed-off-by: you06 <[email protected]>

* address comment

Signed-off-by: you06 <[email protected]>

---------

Signed-off-by: you06 <[email protected]>
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 <[email protected]>

* add regression test

Signed-off-by: you06 <[email protected]>

* lazy init lastTSO

Signed-off-by: you06 <[email protected]>

* fix panic

Signed-off-by: you06 <[email protected]>

* address comment

Signed-off-by: you06 <[email protected]>

---------

Signed-off-by: you06 <[email protected]>
MyonKeminta pushed a commit to MyonKeminta/client-go that referenced this pull request Dec 10, 2024
* fix the issue that stale timestamp may be a future one

Signed-off-by: you06 <[email protected]>

* add regression test

Signed-off-by: you06 <[email protected]>

* lazy init lastTSO

Signed-off-by: you06 <[email protected]>

* fix panic

Signed-off-by: you06 <[email protected]>

* address comment

Signed-off-by: you06 <[email protected]>

---------

Signed-off-by: you06 <[email protected]>
ti-chi-bot bot pushed a commit that referenced this pull request Dec 12, 2024
 

Signed-off-by: you06 <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>

Co-authored-by: you06 <[email protected]>
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