-
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
*: wait for binlog recovering when using HTTP API #13740
Conversation
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #13740 +/- ##
===============================================
- Coverage 80.135% 80.0579% -0.0771%
===============================================
Files 475 473 -2
Lines 117624 116387 -1237
===============================================
- Hits 94258 93177 -1081
+ Misses 15906 15856 -50
+ Partials 7460 7354 -106 |
sessionctx/binloginfo/binloginfo.go
Outdated
} | ||
|
||
// AddOneCommitter adds one committer to committerCounter. | ||
func AddOneCommitter() { |
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.
This is used for skipped binlog writer.
Better named to AddOneSkippedCommiter
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
LGTM |
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
} else { | ||
c.writeFinishBinlog(ctx, binlog.BinlogType_Commit, int64(c.commitTS)) | ||
} | ||
} | ||
}() | ||
|
||
binlogChan := c.prewriteBinlog(ctx) | ||
prewriteBo := NewBackoffer(ctx, PrewriteMaxBackoff).WithVars(c.txn.vars) |
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.
if panic happened after prewriteBinlog
before <-binlogChan
will miss RemoveOneSkippedCommitter
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.
Yes, can not avoid it, I've added a reset operation.
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.
if there is in-flight txn, calling reset will make SkippedCommitterCounter < 0 finally?
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.
Yes, reset
is used for troubleshooting, if sth wrong with it, e.g. counter != 0 forever after resetting, we could reset it once again. I think we could not avoid it to happen, but hopefully, it will never be used.
LGTM |
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
PTAL @lysu |
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
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
@GregoryIan PTAL |
@july2993 PTAL |
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
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
LGTM |
/merge |
/run-all-tests |
/run-cherry-pick |
cherry pick to release-3.0 failed |
Conflicts: store/tikv/2pc.go
What problem does this PR solve?
The current binlog/recover API does not wait for all transactions committed. We need to make the user knows when the binlog recovered for all running transactions.
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
Release note