-
Notifications
You must be signed in to change notification settings - Fork 721
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
mcs, tso: timestamp fallback after merging #6686
Comments
I also meet the same problem, only stop and restart server.
There is a lot of log about |
|
there is a race condition. Target group was set merge state after handling target group's the put event at 2023/06/26 20:53:54.985. The entry "keyspace 1 -> group 1" was removed from lookup table at 20:53:54.978. The client (tsoServiceDiscovery.updateMember) periodically checks if a keyspace's group has changed with keyspace group 0 in the FindGroupByKeyspaceID request, the API will return keyspace group 0 which will be used in the next tso request. In short words, client could send tso requests with keyspace 1 and default group 0 to server before the server side processes the put event and set merge state. |
Enhancement Task
// split keyspace 1 from group 0 to group 1
root@serverless-cluster-pd-0:/# ./pd-ctl keyspace-group split 0 1 1
Success!
root@serverless-cluster-pd-0:/# ./pd-ctl keyspace-group merge 0 1
Failed! [500] "keyspace group is in split state"
// Send traffic to keyspace 1 to trigger finish split for group 1
root@tso-bench:/# ./pd-tso-bench -v -duration 250000s -pd "http://serverless-cluster-pd-0.serverless-cluster-pd-peer.tidb-serverless.svc:2379" -client 10 -c 3 -interval 30s -keyspace 1
// Now we can merge 1 to 0
root@serverless-cluster-pd-0:/# ./pd-ctl keyspace-group merge 0 1
Success!
// But pd-tso-bench reported time fallback immediately after above merging.
panic: global timestamp fallback, new ts (1687812834954, 1003) <= the last one (1687812834975, 50). keyspace: 1, keyspace group: 0
goroutine 693 [running]:
github.com/tikv/pd/client.(*tsoClient).compareAndSwapTS(0x4000439d40, {0x93f24b, 0x6}, 0x188f97c068a, 0x3eb, 0x0, 0x2)
/go/src/github.com/tikv/pd/client/tso_dispatcher.go:742 +0x244
github.com/tikv/pd/client.(*tsoClient).processRequests(0x4000439d40, {0xa6e3e0, 0x4000f94bd0}, {0x93f24b, 0x6}, 0x40000c50e0, {0x0?, 0x0, 0x4000160280?})
/go/src/github.com/tikv/pd/client/tso_dispatcher.go:720 +0x250
github.com/tikv/pd/client.(*tsoClient).handleDispatcher(0x4000439d40, {0xa79090?, 0x4000538040}, {0x93f24b, 0x6}, 0x40000c50e0)
/go/src/github.com/tikv/pd/client/tso_dispatcher.go:445 +0xde4
created by github.com/tikv/pd/client.(*tsoClient).createTSODispatcher
/go/src/github.com/tikv/pd/client/tso_dispatcher.go:290 +0x264
Here is the PD client log.
https://gist.githubusercontent.com/binshi-bing/68fadbf399dc5991e9c65341d7375636/raw/05de99538b8a5dc9d65ace1ddf8462928541c05a/gistfile1.txt
All Client/TSO log can be found https://gist.github.com/binshi-bing/68fadbf399dc5991e9c65341d7375636/edit
The text was updated successfully, but these errors were encountered: