From db55e969c6b867252912df24d32c658df1e09bac Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:39:19 +0200 Subject: [PATCH] Online DDL: recognize shorter vitess artifact table name Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/schema/name_test.go | 4 ++++ go/vt/schema/online_ddl.go | 2 +- go/vt/schema/online_ddl_test.go | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go/vt/schema/name_test.go b/go/vt/schema/name_test.go index ab72f80644e..bcf86b38082 100644 --- a/go/vt/schema/name_test.go +++ b/go/vt/schema/name_test.go @@ -36,6 +36,8 @@ func TestNameIsGCTableName(t *testing.T) { "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114014_ghc", "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114014_del", "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114013_new", + "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114013_vrepl", + "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114013_vrp", "_table_old", "__table_old", } @@ -63,6 +65,8 @@ func TestIsInternalOperationTableName(t *testing.T) { "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114014_ghc", "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114014_del", "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114013_new", + "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114013_vrepl", + "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114013_vrp", "_table_old", "__table_old", "_vt_DROP_6ace8bcef73211ea87e9f875a4d24e90_20200915120410", diff --git a/go/vt/schema/online_ddl.go b/go/vt/schema/online_ddl.go index a06866e996a..15f6e694833 100644 --- a/go/vt/schema/online_ddl.go +++ b/go/vt/schema/online_ddl.go @@ -32,7 +32,7 @@ import ( var ( onlineDdlUUIDRegexp = regexp.MustCompile(`^[0-f]{8}_[0-f]{4}_[0-f]{4}_[0-f]{4}_[0-f]{12}$`) - onlineDDLGeneratedTableNameRegexp = regexp.MustCompile(`^_[0-f]{8}_[0-f]{4}_[0-f]{4}_[0-f]{4}_[0-f]{12}_([0-9]{14})_(gho|ghc|del|new|vrepl)$`) + onlineDDLGeneratedTableNameRegexp = regexp.MustCompile(`^_[0-f]{8}_[0-f]{4}_[0-f]{4}_[0-f]{4}_[0-f]{12}_([0-9]{14})_(gho|ghc|del|new|vrepl|vrp)$`) ptOSCGeneratedTableNameRegexp = regexp.MustCompile(`^_.*_old$`) migrationContextValidatorRegexp = regexp.MustCompile(`^[\w:-]*$`) ) diff --git a/go/vt/schema/online_ddl_test.go b/go/vt/schema/online_ddl_test.go index c616d64a698..fd3194debb9 100644 --- a/go/vt/schema/online_ddl_test.go +++ b/go/vt/schema/online_ddl_test.go @@ -107,6 +107,7 @@ func TestIsOnlineDDLTableName(t *testing.T) { "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114014_del", "_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114013_new", "_84371a37_6153_11eb_9917_f875a4d24e90_20210128122816_vrepl", + "_84371a37_6153_11eb_9917_f875a4d24e90_20210128122816_vrp", "_table_old", "__table_old", } @@ -121,6 +122,7 @@ func TestIsOnlineDDLTableName(t *testing.T) { "_table_ghc", "_table_del", "_table_vrepl", + "_table_vrp", "table_old", } for _, tableName := range irrelevantNames {