From 1004173ceb69adb2cefd0e88440a00ad6f2cea60 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:27:05 +0300 Subject: [PATCH] TabletServer: execute DDLs without timeout Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletserver/tabletserver.go | 4 ++++ 1 file changed, 4 insertions(+) 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,