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 added 4 commits November 9, 2023 16:05
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>
@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

Signed-off-by: you06 <you1474600@gmail.com>
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
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
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 <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>
ti-chi-bot bot pushed a commit that referenced this pull request Dec 12, 2024
 

Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

Co-authored-by: you06 <you1474600@gmail.com>
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