-
Notifications
You must be signed in to change notification settings - Fork 12
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
Draft: table level RAW #524
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
go/vt/vtgate/scatter_conn.go
Outdated
@@ -296,6 +296,9 @@ func (stc *ScatterConn) ExecuteMultiShard( | |||
if qr.SessionStateChanges != "" { | |||
session.SetReadAfterWriteGTID(qr.SessionStateChanges) | |||
stc.gateway.AddGtid(qr.SessionStateChanges) | |||
|
|||
tableName := primitive.GetTableName() | |||
session.latestGTIDForTable.UpdateGTID(tableName, qr.SessionStateChanges) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for network issues to cause a GTID rollback here?
For example:
SQL1 with GTID 1 is sent.
SQL2 with GTID 2 is sent.
MySQL server completes SQL1.
MySQL server completes SQL2.
Network error occurs.
Result 2 arrives at WeScale and triggers update_gtid(gtid2).
Result 1 arrives at WeScale and triggers update_gtid(gtid1).
The resulting GTID is 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since session.GetReadAfterWrite().GetReadAfterWriteGtid()
always stores the latest GTID at the session level. So, directly taking session.GetReadAfterWrite().GetReadAfterWriteGtid()
to update latestGTIDForTable
may avoid the problem of GTID rollback?
But I think what's more important here is that we should judge the sequence of the existing GTID and the GTID to be updated in latestGTIDForTable
.
Since there is only one MySQL instance performing write operations, I understand that the returned GTIDs should all have the same UUID. Can I directly take the transaction number in the GTID for comparison?
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: Terry Gao <[email protected]>
* add: latest_gtid_for_table.go Signed-off-by: Terry Gao <[email protected]> * deal: safe_session.go with LatestGTIDForTable Signed-off-by: Terry Gao <[email protected]> * deal: scatter_conn.go with LatestGTIDForTable Signed-off-by: Terry Gao <[email protected]> * fix: e2e test Signed-off-by: Terry Gao <[email protected]> * fix: tools version latest->0.24.0 Signed-off-by: Terry Gao <[email protected]> * fix: tools version latest->0.24.0 Signed-off-by: Terry Gao <[email protected]> * feat: update gtid Signed-off-by: Terry Gao <[email protected]> * update: query.proto Signed-off-by: Terry Gao <[email protected]> * update: .pb.go Signed-off-by: Terry Gao <[email protected]> * fix: go.mod go.sum Signed-off-by: Terry Gao <[email protected]> * feat: get gtid map Signed-off-by: Terry Gao <[email protected]> * update: vtgate.proto Signed-off-by: Terry Gao <[email protected]> * add: getReadAfterWriteGtid() Signed-off-by: Terry Gao <[email protected]> * update: init opts.TableReadAfterWriteGtidMap Signed-off-by: Terry Gao <[email protected]> * fix: gtid rollback issue Signed-off-by: Terry Gao <[email protected]> * fix: init latestGTIDForTable in safeSession Signed-off-by: Terry Gao <[email protected]> * fix: add latest_gtid_for_table in ReadAfterWrite Signed-off-by: Terry Gao <[email protected]> * fix: scatter_conn.go Signed-off-by: Terry Gao <[email protected]> * fix: vtgate.proto Signed-off-by: Terry Gao <[email protected]> * fix: vtgate.proto Signed-off-by: Terry Gao <[email protected]> * fix: vtgate.proto Signed-off-by: Terry Gao <[email protected]> * fix: query_executor.go Signed-off-by: Terry Gao <[email protected]> * fix: query_executor.go Signed-off-by: Terry Gao <[email protected]> * fix: query_executor.go Signed-off-by: Terry Gao <[email protected]> * fix: query_executor.go Signed-off-by: Terry Gao <[email protected]> * fix: query_executor.go Signed-off-by: Terry Gao <[email protected]> * fix: query_executor.go Signed-off-by: Terry Gao <[email protected]> * fix: scattor_conn.go Signed-off-by: Terry Gao <[email protected]> * fix: scattor_conn.go Signed-off-by: Terry Gao <[email protected]> * fix: scattor_conn.go Signed-off-by: Terry Gao <[email protected]> * fix: safe_session.go Signed-off-by: Terry Gao <[email protected]> * fix: safe_session.go Signed-off-by: Terry Gao <[email protected]> * fix: safe_session.go Signed-off-by: Terry Gao <[email protected]> * fix: getRAWGtid Signed-off-by: Terry Gao <[email protected]> * feat: support set table_level Signed-off-by: Terry Gao <[email protected]> * fix: getRAWGtid Signed-off-by: Terry Gao <[email protected]> --------- Signed-off-by: Terry Gao <[email protected]>
Signed-off-by: terry-xuan-gao <[email protected]>
Signed-off-by: terry-xuan-gao <[email protected]>
Signed-off-by: terry-xuan-gao <[email protected]>
Related Issue(s) & Descriptions
Checklist