From 6a25b35292a31582efbb8447ef4a06c2eaa74461 Mon Sep 17 00:00:00 2001 From: xia Date: Tue, 4 Sep 2018 19:16:14 +0800 Subject: [PATCH 1/3] ddl: update create table interval --- ddl/ddl.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ddl/ddl.go b/ddl/ddl.go index 21af80eca9649..b482871fe0bb6 100644 --- a/ddl/ddl.go +++ b/ddl/ddl.go @@ -447,6 +447,9 @@ func checkJobMaxInterval(job *model.Job) time.Duration { if job.Type == model.ActionAddIndex { return 3 * time.Second } + if job.Type == model.ActionCreateTable { + return 500 * time.Millisecond + } return 1 * time.Second } From f529324a89edbe038713b14b276a91af41815c02 Mon Sep 17 00:00:00 2001 From: xia Date: Tue, 4 Sep 2018 19:23:44 +0800 Subject: [PATCH 2/3] ddl: update a comment --- ddl/ddl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddl/ddl.go b/ddl/ddl.go index b482871fe0bb6..0b9dd5bb95d5d 100644 --- a/ddl/ddl.go +++ b/ddl/ddl.go @@ -487,7 +487,7 @@ func (d *ddl) doDDLJob(ctx sessionctx.Context, job *model.Job) error { jobID := job.ID // For a job from start to end, the state of it will be none -> delete only -> write only -> reorganization -> public // For every state changes, we will wait as lease 2 * lease time, so here the ticker check is 10 * lease. - // But we use etcd to speed up, normally it takes less than 1s now, so we use 1s or 3s as the max value. + // But we use etcd to speed up, normally it takes less than 0.5s now, so we use 0.5s or 1s or 3s as the max value. ticker := time.NewTicker(chooseLeaseTime(10*d.lease, checkJobMaxInterval(job))) startTime := time.Now() metrics.JobsGauge.WithLabelValues(job.Type.String()).Inc() From 07de43bc2de2c5e52c85811af5fdd95381df1553 Mon Sep 17 00:00:00 2001 From: xia Date: Tue, 11 Sep 2018 17:13:10 +0800 Subject: [PATCH 3/3] ddl: address comments --- ddl/ddl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddl/ddl.go b/ddl/ddl.go index 0b9dd5bb95d5d..96e4f83a51fa3 100644 --- a/ddl/ddl.go +++ b/ddl/ddl.go @@ -447,7 +447,7 @@ func checkJobMaxInterval(job *model.Job) time.Duration { if job.Type == model.ActionAddIndex { return 3 * time.Second } - if job.Type == model.ActionCreateTable { + if job.Type == model.ActionCreateTable || job.Type == model.ActionCreateSchema { return 500 * time.Millisecond } return 1 * time.Second