From 1409a7547616922daea73119162edd36899098ac Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Wed, 16 Nov 2022 08:50:30 +0200 Subject: [PATCH] Online DDL: more scheduler triggering following successful operations (#11701) * Online DDL: more schedule triggers Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> * go mod tidy Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/onlineddl/executor.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/vt/vttablet/onlineddl/executor.go b/go/vt/vttablet/onlineddl/executor.go index 5233bc97f61..0632a656783 100644 --- a/go/vt/vttablet/onlineddl/executor.go +++ b/go/vt/vttablet/onlineddl/executor.go @@ -2168,6 +2168,7 @@ func (e *Executor) scheduleNextMigration(ctx context.Context) error { onlyScheduleOneMigration.Do(func() { err = e.updateMigrationStatus(ctx, uuid, schema.OnlineDDLStatusReady) log.Infof("Executor.scheduleNextMigration: scheduling migration %s; err: %v", uuid, err) + e.triggerNextCheckInterval() }) if err != nil { return err @@ -2552,6 +2553,7 @@ func (e *Executor) getCompletedMigrationByContextAndSQL(ctx context.Context, onl // failMigration marks a migration as failed func (e *Executor) failMigration(ctx context.Context, onlineDDL *schema.OnlineDDL, withError error) error { + defer e.triggerNextCheckInterval() _ = e.updateMigrationStatusFailedOrCancelled(ctx, onlineDDL.UUID) if withError != nil { _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, withError.Error()) @@ -3607,6 +3609,7 @@ func (e *Executor) reviewStaleMigrations(ctx context.Context) error { if err := e.updateMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusFailed); err != nil { return err } + defer e.triggerNextCheckInterval() _ = e.updateMigrationStartedTimestamp(ctx, uuid) // Because the migration is stale, it may not update completed_timestamp. It is essential to set completed_timestamp // as this is then used when cleaning artifacts