relay: retry for upstream bad connection#265
Conversation
…24f4b6f38e3e4ed1037a1a05acd GO111MODULE=on go mod tidy
Codecov Report
@@ Coverage Diff @@
## master #265 +/- ##
================================================
- Coverage 60.2806% 59.9918% -0.2888%
================================================
Files 134 134
Lines 14965 14742 -223
================================================
- Hits 9021 8844 -177
+ Misses 5099 5052 -47
- Partials 845 846 +1 |
|
/run-all-tests |
1 similar comment
|
/run-all-tests |
|
@GregoryIan @amyangfei PTAL |
| } | ||
|
|
||
| unsupportedSQLs := []string{ | ||
| "alter table bar ADD FULLTEXT INDEX `fulltext` (`name`) WITH PARSER ngram", |
There was a problem hiding this comment.
remove two supported cases handy?
There was a problem hiding this comment.
YES, because parser also updated when executing
GO111MODULE=on go get -u github.com/siddontang/go-mysql@f52d30c9fcb7824f4b6f38e3e4ed1037a1a05acd
| return false | ||
| } | ||
|
|
||
| for lrt := rr.lastRetryTime; time.Since(lrt) > rr.cfg.BackoffRollback; lrt = lrt.Add(rr.cfg.BackoffRollback) { |
There was a problem hiding this comment.
can we this logic code into backoff pkg? but not now
There was a problem hiding this comment.
and a function like func (b *Backoff) Adjust() to adjust/rollback cwnd?
If so, maybe too many things backoff can do?
what your opinion? @amyangfei
There was a problem hiding this comment.
I prefer not to add this logic into backoff pkg, but maybe we can add a function like RollbackN?
| } | ||
|
|
||
| r.tctx.L().Info("receive retryable error for binlog reader", log.ShortError(err)) | ||
| err = reader2.Close() // close the previous reader |
There was a problem hiding this comment.
can we close reader2 twice?
There was a problem hiding this comment.
YES, we can close Reader any times, but it will return a can not close error except the first one.
In this place, we only close a reader2 instance once. this L298 close the previous one, and in the defer in L260 ~ L265, it may close the first one (without retry) or the latest one (with retry).
|
Rest LGTM |
|
LGTM |
| }, | ||
| BinLogName: clone.RelayBinLogName, | ||
| BinlogGTID: clone.RelayBinlogGTID, | ||
| ReaderRetry: rr.ReaderRetryConfig{ // we use config for TaskChecker now |
There was a problem hiding this comment.
| ReaderRetry: rr.ReaderRetryConfig{ // we use config for TaskChecker now | |
| ReaderRetry: rr.ReaderRetryConfig{ // we use config from TaskChecker now |
| User: cfg.From.User, | ||
| Password: cfg.From.Password, | ||
| }, | ||
| ReaderRetry: rr.ReaderRetryConfig{ // we use config for TaskChecker now |
What problem does this PR solve?
What is changed and how it works?
Check List
Tests
KILLconnection for the relay unitSide effects