diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index 840d5920a4d..fcc30f631df 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -822,6 +822,10 @@ func (tsv *TabletServer) execute(ctx context.Context, target *querypb.Target, sq if err != nil { return err } + if plan.PlanID == planbuilder.PlanDDL { + // DDLs (especially ALTER TABLE, OPTIMIZE TABLE) can run for a very long time, so we don't want to enforce a specific timeout. + ctx = context.WithoutCancel(ctx) + } qre := &QueryExecutor{ query: query, marginComments: comments,