-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: add auto_random id cache for statement retrying and table recover #14711
Conversation
|
||
func (r *retryInfoAutoIDs) next() (int64, error) { | ||
if r.currentOffset >= len(r.autoIDs) { | ||
return 0, errCantGetValidID |
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.
The error message of errCantGetValidID
is "cannot get valid auto-increment id in retry"
. I suggest to modify it to "Cannot get a valid auto-ID when retrying the statement"
, what do you think?
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.
Rest LGTM
sessionctx/variable/session.go
Outdated
|
||
// AddAutoIncrementID adds id to autoIncrementIDs. | ||
func (r *RetryInfo) AddAutoIncrementID(id int64) { | ||
r.autoIncrementIDs.add(id) |
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 think should be directly r.autoRandomIDs.autoIDs = append(r.autoRandomIDs.autoIDs, id)
here.
AddAutoIncrementID()->add()->append() may be too deep.
/run-check_dev_2 |
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.
No test for those features?
lgtm |
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.
LGTM
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.
Rest LGTM
should resolve the conflict. |
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.
LGTM
/merge |
/run-all-tests |
@tangenta merge failed. |
/run-unit-test |
/merge |
/run-all-tests |
What problem does this PR solve?
This is a patch for #13127.
What is changed and how it works?
Add retry and recover table cache support for
auto_random
.Check List
Tests
Code changes
Side effects
Related changes
Release note