-
Notifications
You must be signed in to change notification settings - Fork 188
syncer: don't clear online ddl if execute ddl failed #449
Conversation
This reverts commit 8083261.
@@ -192,6 +193,15 @@ func (conn *DBConn) querySQL(tctx *tcontext.Context, query string, args ...inter | |||
} | |||
|
|||
func (conn *DBConn) executeSQLWithIgnore(tctx *tcontext.Context, ignoreError func(error) bool, queries []string, args ...[]interface{}) (int, error) { | |||
|
|||
failpoint.Inject("ExecuteSQLWithIgnoreFailed", func(val failpoint.Value) { |
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.
will use this failpoint later
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
@@ -1054,9 +1055,9 @@ func (s *Syncer) Run(ctx context.Context) (err error) { | |||
s.tctx.L().Error("panic log", zap.Reflect("error message", err1), zap.Stack("statck")) | |||
err = terror.ErrSyncerUnitPanic.Generate(err1) | |||
} | |||
// flush the jobs channels, but if error occurred, we should not flush the checkpoints | |||
if err1 := s.flushJobs(); err1 != nil { |
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.
seems that don't need to execute theses sqls, if sync unit exit because of error or user pause the task, will cancel the context, and all sqls will execute failed.
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.
Do we need to s.jobWg.Wait()
all operation jobs to return?
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.
add in 20cfd53
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
Codecov Report
@@ Coverage Diff @@
## master #449 +/- ##
===========================================
Coverage ? 57.3182%
===========================================
Files ? 167
Lines ? 17265
Branches ? 0
===========================================
Hits ? 9896
Misses ? 6397
Partials ? 972 |
@csuzhangxc @lichunzhu PTAL |
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
1 similar comment
/run-all-tests tidb=release-3.0 |
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
@WangXiangUSTC should we need to add the label of @lichunzhu PTAL again. |
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
I add the tag |
cherry pick to release-1.0 failed |
@WangXiangUSTC Please cherry-pick this PR manually. |
What problem does this PR solve?
when execute ddl failed, ignore clean online ddl information
What is changed and how it works?
execErrorDetected
after add ddl job, ifexecErrorDetected
is true, return error forhandleQueryEvent
IsFreshJob
by the way, if have shard table's checkpoint information, the unit should not be fresh jobCheck List
Tests
Related changes