Open shlomi-noach opened 1 year ago
version 21 or later: stop recognizing the old formats.
Postponing the hard removal, keeping the soft removal of old format for a while longer (new tables created in new format, but old format is still respected).
Today, Vitess recognizes these formats as internal names:
GC table names
_vt_HOLD_6ace8bcef73211ea87e9f875a4d24e90_20200915120410
_vt_PURGE_6ace8bcef73211ea87e9f875a4d24e90_20200915120410
_vt_EVAC_6ace8bcef73211ea87e9f875a4d24e90_20200915120410
_vt_DROP_6ace8bcef73211ea87e9f875a4d24e90_20200915120410
Online DDL table names
_84371a37_6153_11eb_9917_f875a4d24e90_20210128122816_vrepl
_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114014_gho
_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114014_ghc
_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114014_del
_4e5dcf80_354b_11eb_82cd_f875a4d24e90_20201203114013_new
As well as
pt-osc
names like_table_old
or__table_old
. We ignorept-osc
names for the sake of this discussion.In the list above we have two different format types, and three different lengths of tables. Compare:
The latter, longest table name, is
58
characters long. This leaves no room for default foreign key name suffix such as_ibfk_1
. See https://github.com/vitessio/vitess/issues/14570.We want to unify the internal naming format like so:
[0]
or from end of name.56
characters, leaving enough space for a two digit default name foreign key suffix such as_ibfk_12
.36
character encoding, but readability is important for generalk purpose debugging and just observations of the processes.Suggested format
The following is a
56
character length format:where:
hld
- GC HOLD stateprg
- GC PURGE stateevc
- GC EVAC statedrp
- GC DROP statevrp
- Online DDL / vreplication tablegho
-gh-ost
tableghc
-gh-ost
changelog tabledel
-gh-ost
deleted tableThe prefix
_vt_
suggests that this might be a vitess table, before we even validate the exact format. The suffix_
suggests this might be a vitess table, again before we fully validate.Two version rollout
This will have to rollout over multiple versions:
19
will recognize this new format on top of existing formats, as internal table format, and all processes will recognize the relevant tables (e.g.tablegc
will recognize_vt_drp_6ace8bcef73211ea87e9f875a4d24e90_20200915120410_
as a DROP table)20
will actually start creating tables with the new naming.21
or later: stop recognizing the old formats.The reason why we have to split this over
19
and20
is that if we create e.g. a_vt_drp_...
table in aPRIMARY
, and the replica does not yet recognize that as a DROP table, then if the replica gets promoted as a newPRIMARY
it will not handle the table correctly.