From d6d8eedcf1f1e40d6c99507909262b97da795b15 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Mon, 1 Feb 2021 07:23:58 +0200 Subject: [PATCH] init schema in InitDBConfig() Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletmanager/vreplication/engine.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/vreplication/engine.go b/go/vt/vttablet/tabletmanager/vreplication/engine.go index aa5a16cc20a..76d26b7f869 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/engine.go +++ b/go/vt/vttablet/tabletmanager/vreplication/engine.go @@ -151,6 +151,9 @@ func (vre *Engine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) { return binlogplayer.NewDBClient(dbcfgs.FilteredWithDB()) } vre.dbName = dbcfgs.DBName + + // Ensure the schema is created as early as possible + go vre.Exec(warmUpQuery) } // NewTestEngine creates a new Engine for testing. @@ -194,9 +197,6 @@ func (vre *Engine) Open(ctx context.Context) { vre.cancelRetry = cancel go vre.retry(ctx, err) } - - // Ensure the schema exists - go vre.Exec(warmUpQuery) } func (vre *Engine) openLocked(ctx context.Context) error {