diff --git a/go/vt/vttablet/tabletmanager/vreplication/engine.go b/go/vt/vttablet/tabletmanager/vreplication/engine.go index 76d26b7f869..f01dc7b5ec2 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/engine.go +++ b/go/vt/vttablet/tabletmanager/vreplication/engine.go @@ -153,7 +153,11 @@ func (vre *Engine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) { vre.dbName = dbcfgs.DBName // Ensure the schema is created as early as possible - go vre.Exec(warmUpQuery) + go func() { + vre.mu.Lock() + defer vre.mu.Unlock() + vre.Exec(warmUpQuery) + }() } // NewTestEngine creates a new Engine for testing.