-
Notifications
You must be signed in to change notification settings - Fork 227
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
implement rollback for pipelined dml #1235
Conversation
Signed-off-by: you06 <[email protected]>
Signed-off-by: you06 <[email protected]>
Signed-off-by: you06 <[email protected]>
// TODO: implement cleanup. | ||
// resolveFlushedLocks resolves all locks in the given range [start, end) with the given status. | ||
// The resolve process is running in another goroutine so this function won't block. | ||
func (c *twoPhaseCommitter) resolveFlushedLocks(bo *retry.Backoffer, start, end []byte, commit bool) { | ||
const RESOLVE_CONCURRENCY = 8 | ||
var resolved atomic.Uint64 |
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.
I'm not sure if we need to choose lower concurrency for rollback.
Signed-off-by: you06 <[email protected]> address comment Signed-off-by: you06 <[email protected]>
@@ -334,6 +335,18 @@ func (c *twoPhaseCommitter) buildPipelinedResolveHandler(commit bool, resolved * | |||
maxBackOff = CommitSecondaryMaxBackoff | |||
} | |||
regionCache := c.store.GetRegionCache() | |||
// the handler function runs in a different goroutine, should copy the required values before it to avoid race. |
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.
As dicussed in above comments, this may not be a perfect solution, we still need to find a way to avoid race completely.
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.
Maybe set txn.committer
to nil
which disable further accessing to rollbacked committer.
Signed-off-by: you06 <[email protected]>
Signed-off-by: you06 <[email protected]>
ref tikv/tikv#16291
Now the locks of rollback pipelined DML need to be cleaned up by GC. With this PR, the locks can be cleanup faster.
Flush phase
Rollback phase
SQL client