From b43152499d70e82e714a8895c5a1575dd500ec79 Mon Sep 17 00:00:00 2001 From: Tommy Reilly Date: Wed, 31 Aug 2022 09:22:57 -0400 Subject: [PATCH 1/8] sql: fix COPY internal error in optimizer Statistics builder code to evaluate distinct count had a typo and would crash if there were more rows than columns. Fix bug and rewrite to be a little clearer. Fixes: #87011 Release justification: low-risk high priority fix to new funcationality Release note: None --- .../logictest/testdata/logic_test/copyfrom | 37 +++++++++++++++++++ pkg/sql/opt/memo/statistics_builder.go | 8 ++-- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/pkg/sql/logictest/testdata/logic_test/copyfrom b/pkg/sql/logictest/testdata/logic_test/copyfrom index 635566631f73..d204939abb4e 100644 --- a/pkg/sql/logictest/testdata/logic_test/copyfrom +++ b/pkg/sql/logictest/testdata/logic_test/copyfrom @@ -479,3 +479,40 @@ SELECT id, data AS got, array[chr(id)] AS want FROM test_copy_array WHERE data ! ---- subtest end + +# Regression test for #87011 +statement ok +CREATE TABLE tab ( + col1 STRING, + col2 STRING, + col3 STRING, + col4 STRING, + col5 STRING, + col6 STRING NOT NULL, index(col5) where col3 like '%ride%', index ((col2 || col3)), + PRIMARY KEY (col1, col2, col3, col4, col5) using hash, + UNIQUE (col5, col6) +); +CREATE TABLE tab_child ( + col1 STRING, + col2 STRING, + col3 STRING, + col4 STRING, + col5 STRING, + col6 STRING NOT NULL, index(col5) where col3 like '%ride%', index ((col2 || col3)), + PRIMARY KEY (col1, col2, col3, col4, col5) using hash, + FOREIGN KEY (col5, col6) REFERENCES tab (col5, col6) +) + +copy-error +COPY tab_child FROM STDIN + +'high' 'straight' 'writer' 'develop' 'shells' 'bean' +'basic' 'tent' 'compound' 'it' 'future' 'held' +'bite' 'bring' 'taught' 'world' 'themselves' 'airplane' +'island' 'number' 'has' 'blow' 'prize' 'cookies' +'hole' 'wear' 'way' 'troops' 'eye' 'sure' +'thick' 'joy' 'impossible' 'area' 'ordinary' 'piano' +'grabbed' 'reader' 'number' 'serve' 'fill' 'wonderful' +'tower' 'former' 'mainly' 'point' 'class' 'idea' +---- +insert on table "tab_child" violates foreign key constraint "tab_child_col5_col6_fkey" diff --git a/pkg/sql/opt/memo/statistics_builder.go b/pkg/sql/opt/memo/statistics_builder.go index bad48e8005aa..0af72129d267 100644 --- a/pkg/sql/opt/memo/statistics_builder.go +++ b/pkg/sql/opt/memo/statistics_builder.go @@ -2134,13 +2134,13 @@ func (sb *statisticsBuilder) colStatLiteralValues( // Determine null count by looking at tuples that have only NullOps in them. nullCount := 0 - for i := 0; i < values.Len(); i++ { + for rowIndex := 0; rowIndex < values.Len(); rowIndex++ { var h hasher h.Init() hasNonNull := false - for j := 0; j < len(values.Cols); j++ { - if colSet.Contains(values.Cols[i]) { - elem := values.Rows.Rows.Get(i, j).(tree.Datum) + for colIndex, col := range values.Cols { + if colSet.Contains(col) { + elem := values.Rows.Rows.Get(rowIndex, colIndex).(tree.Datum) if elem.ResolvedType().Family() == types.UnknownFamily { hasNonNull = true } From c20ba1b055def2d33dcc1e31b78e7cbfbbef74d2 Mon Sep 17 00:00:00 2001 From: Oliver Tan Date: Thu, 1 Sep 2022 09:33:37 +1000 Subject: [PATCH 2/8] sql: plumb isCopy down to event log Previously, we relied on the `txn` being filled to log `COPY` statements. This is however inaccurate - `txn` may be nil if `COPY` is the first statement encountered. This meant that the first COPY encountered would not be logged. Instead, plumb down `isCopy` and use `timeutil.Now()` if it is a COPY related statement. Release justification: logging related critical fix Release note: None --- pkg/sql/conn_executor.go | 1 + pkg/sql/conn_executor_exec.go | 1 + pkg/sql/event_log.go | 8 +++++++- pkg/sql/exec_log.go | 5 ++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/sql/conn_executor.go b/pkg/sql/conn_executor.go index 8cb4cbc1bb1a..8cd443842381 100644 --- a/pkg/sql/conn_executor.go +++ b/pkg/sql/conn_executor.go @@ -2457,6 +2457,7 @@ func (ex *connExecutor) execCopyIn( ex.planner.maybeLogStatement( ctx, ex.executorType, + true, /* isCopy */ int(ex.state.mu.autoRetryCounter), ex.extraTxnState.txnCounter, numInsertedRows, diff --git a/pkg/sql/conn_executor_exec.go b/pkg/sql/conn_executor_exec.go index 1b629524d061..18fd8aed7ef4 100644 --- a/pkg/sql/conn_executor_exec.go +++ b/pkg/sql/conn_executor_exec.go @@ -1070,6 +1070,7 @@ func (ex *connExecutor) dispatchToExecutionEngine( planner.maybeLogStatement( ctx, ex.executorType, + false, /* isCopy */ int(ex.state.mu.autoRetryCounter), ex.extraTxnState.txnCounter, res.RowsAffected(), diff --git a/pkg/sql/event_log.go b/pkg/sql/event_log.go index 1a747ef18465..258dc72a9bd5 100644 --- a/pkg/sql/event_log.go +++ b/pkg/sql/event_log.go @@ -164,6 +164,9 @@ type eventLogOptions struct { // Additional redaction options, if necessary. rOpts redactionOptions + + // isCopy notes whether the current event is related to COPY. + isCopy bool } // redactionOptions contains instructions on how to redact the SQL @@ -276,7 +279,10 @@ func logEventInternalForSQLStatements( ) error { // Inject the common fields into the payload provided by the caller. injectCommonFields := func(event logpb.EventPayload) error { - if txn != nil { + if opts.isCopy { + // No txn is set for COPY, so use now instead. + event.CommonDetails().Timestamp = timeutil.Now().UnixNano() + } else { event.CommonDetails().Timestamp = txn.ReadTimestamp().WallTime } sqlCommon, ok := event.(eventpb.EventWithCommonSQLPayload) diff --git a/pkg/sql/exec_log.go b/pkg/sql/exec_log.go index 6280af624553..f65762aa550c 100644 --- a/pkg/sql/exec_log.go +++ b/pkg/sql/exec_log.go @@ -154,6 +154,7 @@ var sqlPerfInternalLogger log.ChannelLogger = log.SqlInternalPerf func (p *planner) maybeLogStatement( ctx context.Context, execType executorType, + isCopy bool, numRetries, txnCounter, rows int, err error, queryReceived time.Time, @@ -162,12 +163,13 @@ func (p *planner) maybeLogStatement( stmtFingerprintID roachpb.StmtFingerprintID, queryStats *topLevelQueryStats, ) { - p.maybeLogStatementInternal(ctx, execType, numRetries, txnCounter, rows, err, queryReceived, hasAdminRoleCache, telemetryLoggingMetrics, stmtFingerprintID, queryStats) + p.maybeLogStatementInternal(ctx, execType, isCopy, numRetries, txnCounter, rows, err, queryReceived, hasAdminRoleCache, telemetryLoggingMetrics, stmtFingerprintID, queryStats) } func (p *planner) maybeLogStatementInternal( ctx context.Context, execType executorType, + isCopy bool, numRetries, txnCounter, rows int, err error, startTime time.Time, @@ -373,6 +375,7 @@ func (p *planner) maybeLogStatementInternal( // see a copy of the execution on the DEV Channel. dst: LogExternally | LogToDevChannelIfVerbose, verboseTraceLevel: execType.vLevel(), + isCopy: isCopy, }, &eventpb.QueryExecute{CommonSQLExecDetails: execDetails}) } From c3025707093fa0503a3c9dcd3b5d3d93ff59cf02 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Tue, 16 Aug 2022 01:02:10 -0400 Subject: [PATCH 3/8] sql/schemachanger: add back TXN_DROPPED, stop using OFFLINE We added the `OFFLINE` and performed write operations during drops to move the descriptor into that state in order to deal with the fact that synthetically dropped descriptors would not appear so in virtual tables. Fortunately, this shortcoming has been rectified. We now revive the TXN_DROPPED state. This proves to be important because the `OFFLINE` state is not backwards compatible, and the `TXN_DROPPED` state is. Ideally we'd find a way to move the descriptors straight to `DROPPED` in the pre-commit case for all the cases we today support, but doing that would require an overhaul of the dependency rules which,at this point in the cycle, feels risky. Fixes #86626 Release justification: Fixes a release-blocking backwards incompatibility. Release note: None --- .../testdata/benchmark_expectations | 26 +-- .../backup-dropped-descriptors-declarative | 32 ++-- .../testdata/end_to_end/create_index | 8 - .../drop_database_multiregion_primary_region | 166 +++--------------- .../end_to_end/drop_table_multiregion | 38 ++-- .../drop_table_multiregion_primary_region | 38 ++-- .../drop_database_multiregion_primary_region | 132 +++++++------- .../testdata/explain/drop_table_multiregion | 66 +++---- .../drop_table_multiregion_primary_region | 52 +++--- .../drop_database_multiregion_primary_region | 35 ++-- .../explain_verbose/drop_table_multiregion | 7 +- .../drop_table_multiregion_primary_region | 7 +- .../testdata/logic_test/new_schema_changer | 23 ++- pkg/sql/schemachanger/scdeps/exec_deps.go | 69 ++++---- .../scdeps/sctestdeps/test_deps.go | 46 ++--- .../scdeps/sctestdeps/test_state.go | 29 +++ pkg/sql/schemachanger/scexec/dependencies.go | 1 + pkg/sql/schemachanger/scexec/exec_mutation.go | 4 +- .../scexec/mocks_generated_test.go | 12 ++ .../scexec/scmutationexec/dependencies.go | 13 ++ .../scexec/scmutationexec/drop.go | 10 +- .../scexec/scmutationexec/scmutationexec.go | 4 +- pkg/sql/schemachanger/scop/mutation.go | 6 +- .../scop/mutation_visitor_generated.go | 6 +- pkg/sql/schemachanger/scpb/scpb.proto | 7 +- .../scplan/internal/opgen/opgen_alias_type.go | 9 +- .../scplan/internal/opgen/opgen_database.go | 9 +- .../scplan/internal/opgen/opgen_enum_type.go | 9 +- .../scplan/internal/opgen/opgen_schema.go | 9 +- .../scplan/internal/opgen/opgen_sequence.go | 9 +- .../scplan/internal/opgen/opgen_table.go | 9 +- .../scplan/internal/opgen/opgen_view.go | 9 +- .../scplan/internal/rules/assertions_test.go | 2 +- .../scplan/testdata/alter_table_drop_column | 14 +- .../scplan/testdata/drop_database | 98 +++++------ .../schemachanger/scplan/testdata/drop_index | 7 +- .../scplan/testdata/drop_owned_by | 63 +++---- .../schemachanger/scplan/testdata/drop_schema | 70 ++++---- .../scplan/testdata/drop_sequence | 14 +- .../schemachanger/scplan/testdata/drop_table | 28 ++- .../schemachanger/scplan/testdata/drop_type | 14 +- .../schemachanger/scplan/testdata/drop_view | 42 ++--- .../testdata/end_to_end/add_column_no_default | 8 - .../alter_table_add_primary_key_drop_rowid | 8 - .../alter_table_alter_primary_key_drop_rowid | 8 - .../alter_table_alter_primary_key_vanilla | 8 - .../testdata/end_to_end/create_index | 8 - .../testdata/end_to_end/drop_column_basic | 8 - .../end_to_end/drop_column_computed_index | 8 - ...op_column_create_index_separate_statements | 8 - .../end_to_end/drop_column_unique_index | 8 - .../end_to_end/drop_column_with_index | 8 - .../end_to_end/drop_index_hash_sharded_index | 8 - .../drop_index_partial_expression_index | 8 - .../end_to_end/drop_index_vanilla_index | 8 - .../drop_multiple_columns_separate_statements | 7 - .../testdata/end_to_end/drop_schema | 31 ++-- .../testdata/end_to_end/drop_table | 38 ++-- .../testdata/explain/drop_schema | 16 +- .../schemachanger/testdata/explain/drop_table | 72 ++++---- .../testdata/explain_verbose/drop_schema | 7 +- .../testdata/explain_verbose/drop_table | 7 +- 62 files changed, 618 insertions(+), 916 deletions(-) diff --git a/pkg/bench/rttanalysis/testdata/benchmark_expectations b/pkg/bench/rttanalysis/testdata/benchmark_expectations index bdfdb1772794..9c448964a81a 100644 --- a/pkg/bench/rttanalysis/testdata/benchmark_expectations +++ b/pkg/bench/rttanalysis/testdata/benchmark_expectations @@ -31,22 +31,22 @@ exp,benchmark 16,CreateRole/create_role_with_2_options 19,CreateRole/create_role_with_3_options 14,CreateRole/create_role_with_no_options -15,DropDatabase/drop_database_0_tables -17,DropDatabase/drop_database_1_table -19,DropDatabase/drop_database_2_tables -21,DropDatabase/drop_database_3_tables +13,DropDatabase/drop_database_0_tables +15,DropDatabase/drop_database_1_table +17,DropDatabase/drop_database_2_tables +19,DropDatabase/drop_database_3_tables 19,DropRole/drop_1_role 27,DropRole/drop_2_roles 35,DropRole/drop_3_roles -17,DropSequence/drop_1_sequence -19,DropSequence/drop_2_sequences -21,DropSequence/drop_3_sequences -18,DropTable/drop_1_table -21,DropTable/drop_2_tables -24,DropTable/drop_3_tables -19,DropView/drop_1_view -20,DropView/drop_2_views -20,DropView/drop_3_views +15,DropSequence/drop_1_sequence +17,DropSequence/drop_2_sequences +19,DropSequence/drop_3_sequences +16,DropTable/drop_1_table +19,DropTable/drop_2_tables +22,DropTable/drop_3_tables +17,DropView/drop_1_view +18,DropView/drop_2_views +18,DropView/drop_3_views 13,Grant/grant_all_on_1_table 14,Grant/grant_all_on_2_tables 14,Grant/grant_all_on_3_tables diff --git a/pkg/ccl/backupccl/testdata/backup-restore/backup-dropped-descriptors-declarative b/pkg/ccl/backupccl/testdata/backup-restore/backup-dropped-descriptors-declarative index c2b868df679c..2890ed938e41 100644 --- a/pkg/ccl/backupccl/testdata/backup-restore/backup-dropped-descriptors-declarative +++ b/pkg/ccl/backupccl/testdata/backup-restore/backup-dropped-descriptors-declarative @@ -24,34 +24,34 @@ DROP DATABASE dd CASCADE; ---- job paused at pausepoint -# At this point, we have a descriptor entry for `dd` in an OFFLINE state. +# At this point, we have a descriptor entry for `dd` in a dropped state. query-sql WITH tbls AS ( SELECT id, crdb_internal.pb_to_json('cockroach.sql.sqlbase.Descriptor', descriptor) AS orig FROM system.descriptor ) SELECT orig->'database'->'name', orig->'database'->'state' FROM tbls WHERE id = 107; ---- -"dd" "OFFLINE" +"dd" "DROP" -# A database backup should fail since we are explicitly targeting an offline +# A database backup should fail since we are explicitly targeting a dropped # object. exec-sql BACKUP DATABASE dd INTO 'nodelocal://0/dropped-database'; ---- -pq: failed to resolve targets specified in the BACKUP stmt: database "dd" does not exist +pq: failed to resolve targets specified in the BACKUP stmt: database "dd" does not exist, or invalid RESTORE timestamp: supplied backups do not cover requested time # A cluster backup should succeed. exec-sql BACKUP INTO 'nodelocal://0/cluster/dropped-database'; ---- -# The offline descriptors should end up in the cluster backup. +# The dropped descriptors should not end up in the cluster backup. query-sql SELECT count(*) FROM [SHOW BACKUP LATEST IN 'nodelocal://0/cluster/dropped-database'] WHERE object_name IN ('dd', 'foo', 's'); ---- -3 +0 subtest end @@ -99,7 +99,7 @@ WITH tbls AS ( ) SELECT orig->'schema'->'name', orig->'schema'->'state' FROM tbls WHERE id = 112; ---- -"s" "OFFLINE" +"s" "DROP" query-sql WITH tbls AS ( @@ -107,10 +107,10 @@ WITH tbls AS ( ) SELECT orig->'type'->'name', orig->'type'->'state' FROM tbls WHERE id = 110 OR id = 111; ---- -"typ" "OFFLINE" -"_typ" "OFFLINE" +"typ" "DROP" +"_typ" "DROP" -# A database backup should succeed and should include the offline schema, +# A database backup should succeed and should not include the dropped schema, # type, and table. exec-sql BACKUP DATABASE d2 INTO 'nodelocal://0/dropped-schema-in-database'; @@ -121,9 +121,9 @@ SELECT count(*) FROM [SHOW BACKUP LATEST IN 'nodelocal://0/dropped-schema-in-database'] WHERE object_name IN ('s', 't', 'typ', '_typ'); ---- -4 +0 -# A cluster backup should succeed but should include the offline schema, +# A cluster backup should succeed but should not include the dropped schema, # type, and table. exec-sql BACKUP INTO 'nodelocal://0/cluster/dropped-schema-in-database'; @@ -134,7 +134,7 @@ SELECT count(*) FROM [SHOW BACKUP LATEST IN 'nodelocal://0/cluster/dropped-schema-in-database'] WHERE object_name IN ('s', 't', 'typ', '_typ'); ---- -4 +0 # Restore the backups to check they are valid. exec-sql @@ -145,12 +145,11 @@ exec-sql USE d3; ---- -# We expect to see the offline schema 's'. +# We expect to not see the dropped schema 's'. query-sql SELECT schema_name FROM [SHOW SCHEMAS]; ---- public -s crdb_internal information_schema pg_catalog @@ -161,7 +160,6 @@ query-sql SELECT schema_name, table_name FROM [SHOW TABLES]; ---- public t2 -s t exec-sql RESTORE DATABASE d2 FROM LATEST IN 'nodelocal://0/cluster/dropped-schema-in-database' WITH new_db_name ='d4'; @@ -175,7 +173,6 @@ query-sql SELECT schema_name FROM [SHOW SCHEMAS]; ---- public -s crdb_internal information_schema pg_catalog @@ -185,6 +182,5 @@ query-sql SELECT schema_name, table_name FROM [SHOW TABLES]; ---- public t2 -s t subtest end diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index b/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index index 61adab89e8e9..6790909c9fd9 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index @@ -125,14 +125,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 104 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - direction: ADD ... create job #1 (non-cancelable: false): "CREATE INDEX id1 ON defaultdb.public.t1 (id, name) STORING (money) PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1))" descriptor IDs: [104] diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region index 0959657c4b31..fedc118447bf 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region @@ -19,94 +19,11 @@ begin transaction #1 checking for feature: DROP DATABASE increment telemetry for sql.schema.drop_database ## StatementPhase stage 1 of 1 with 5 MutationType ops -upsert descriptor #104 - database: - id: 104 - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: multi_region_test_db - + offlineReason: DROP DATABASE multi_region_test_db CASCADE - privileges: - ownerProto: root - ... - public: - id: 106 - - version: "1" - + state: OFFLINE - + version: "2" -upsert descriptor #105 - ... - id: 105 - kind: MULTIREGION_ENUM - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: crdb_internal_region - + offlineReason: DROP DATABASE multi_region_test_db CASCADE - parentId: 104 - parentSchemaId: 106 - ... - primaryRegion: us-east1 - zoneConfigExtensions: {} - - version: "2" - + state: OFFLINE - + version: "3" -upsert descriptor #106 - schema: - id: 106 - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: public - + offlineReason: DROP DATABASE multi_region_test_db CASCADE - parentId: 104 - privileges: - ... - withGrantOption: 2 - version: 2 - - version: "1" - + state: OFFLINE - + version: "2" -upsert descriptor #107 - ... - id: 107 - kind: ALIAS - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: _crdb_internal_region - + offlineReason: DROP DATABASE multi_region_test_db CASCADE - parentId: 104 - parentSchemaId: 106 - ... - withGrantOption: 2 - version: 2 - - version: "1" - + state: OFFLINE - + version: "2" -upsert descriptor #108 - ... - regionalByTable: - region: us-east2 - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: table_regional_by_table - nextColumnId: 2 - ... - nextIndexId: 2 - nextMutationId: 1 - + offlineReason: DROP DATABASE multi_region_test_db CASCADE - parentId: 104 - primaryIndex: - ... - replacementOf: - time: {} - + state: OFFLINE - unexposedParentSchemaId: 106 - - version: "1" - + version: "2" +added synthetic descriptor: name:"multi_region_test_db" id:104 modification_time:<> version:2 privileges: users: users: owner_proto:"root" version:2 > schemas: > state:DROP offline_reason:"" region_config: +added synthetic descriptor: name:"crdb_internal_region" id:105 version:3 modification_time:<> privileges: users: users: owner_proto:"root" version:2 > parent_id:104 parent_schema_id:106 array_type_id:107 state:DROP offline_reason:"" kind:MULTIREGION_ENUM referencing_descriptor_ids:108 enum_members: enum_members: enum_members: region_config: secondary_region:"" > +added synthetic descriptor: name:"public" id:106 state:DROP offline_reason:"" modification_time:<> version:2 parent_id:104 privileges: users: users: owner_proto:"admin" version:2 > +added synthetic descriptor: name:"_crdb_internal_region" id:107 version:2 modification_time:<> privileges: users: users: owner_proto:"root" version:2 > parent_id:104 parent_schema_id:106 array_type_id:0 state:DROP offline_reason:"" kind:ALIAS alias: > time_precision_is_set: false > +added synthetic descriptor: name:"table_regional_by_table" id:108 version:2 modification_time:<> parent_id:104 unexposed_parent_schema_id:106 columns: nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:2 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:1640995200000000000 constraint_id:1 not_visible:false > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false refresh_view_required:false drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time: temporary:false locality_config: > partition_all_by:false exclude_data_from_backup:false next_constraint_id:2 import_start_wall_time:0 # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 6 MutationType ops @@ -125,12 +42,12 @@ upsert descriptor #104 + targetRanks: + targets: id: 104 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - name: multi_region_test_db - offlineReason: DROP DATABASE multi_region_test_db CASCADE + modificationTime: {} ... + public: + id: 106 + - state: DROP + version: "2" upsert descriptor #105 type: arrayTypeId: 107 @@ -149,14 +66,10 @@ upsert descriptor #105 enumMembers: - logicalRepresentation: us-east1 ... - id: 105 - kind: MULTIREGION_ENUM - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - name: crdb_internal_region - offlineReason: DROP DATABASE multi_region_test_db CASCADE - ... + primaryRegion: us-east1 + zoneConfigExtensions: {} + - state: DROP + version: "3" upsert descriptor #106 schema: + declarativeSchemaChangerState: @@ -172,12 +85,12 @@ upsert descriptor #106 + targetRanks: + targets: id: 106 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - name: public - offlineReason: DROP DATABASE multi_region_test_db CASCADE + modificationTime: {} ... + withGrantOption: 2 + version: 2 + - state: DROP + version: "2" upsert descriptor #107 ... family: ArrayFamily @@ -196,12 +109,11 @@ upsert descriptor #107 + targets: id: 107 kind: ALIAS - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - name: _crdb_internal_region - offlineReason: DROP DATABASE multi_region_test_db CASCADE ... + withGrantOption: 2 + version: 2 + - state: DROP + version: "2" upsert descriptor #108 ... createAsOfTime: @@ -221,14 +133,11 @@ upsert descriptor #108 families: - columnIds: ... - regionalByTable: - region: us-east2 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - name: table_regional_by_table - nextColumnId: 2 - ... + replacementOf: + time: {} + - state: DROP + unexposedParentSchemaId: 106 + version: "2" create job #1 (non-cancelable: true): "DROP DATABASE multi_region_test_db CASCADE" descriptor IDs: [104 105 106 107 108] # end PreCommitPhase @@ -252,13 +161,10 @@ upsert descriptor #104 - wallTime: "1640995200000000001" + modificationTime: {} name: multi_region_test_db - - offlineReason: DROP DATABASE multi_region_test_db CASCADE privileges: - ownerProto: root ... public: id: 106 - - state: OFFLINE - version: "2" + state: DROP + version: "3" @@ -270,13 +176,10 @@ upsert descriptor #105 - wallTime: "1640995200000000001" + modificationTime: {} name: crdb_internal_region - - offlineReason: DROP DATABASE multi_region_test_db CASCADE parentId: 104 - parentSchemaId: 106 ... primaryRegion: us-east1 zoneConfigExtensions: {} - - state: OFFLINE - version: "3" + state: DROP + version: "4" @@ -288,13 +191,10 @@ upsert descriptor #106 - wallTime: "1640995200000000001" + modificationTime: {} name: public - - offlineReason: DROP DATABASE multi_region_test_db CASCADE parentId: 104 - privileges: ... withGrantOption: 2 version: 2 - - state: OFFLINE - version: "2" + state: DROP + version: "3" @@ -306,13 +206,10 @@ upsert descriptor #107 - wallTime: "1640995200000000001" + modificationTime: {} name: _crdb_internal_region - - offlineReason: DROP DATABASE multi_region_test_db CASCADE parentId: 104 - parentSchemaId: 106 ... withGrantOption: 2 version: 2 - - state: OFFLINE - version: "2" + state: DROP + version: "3" @@ -331,16 +228,9 @@ upsert descriptor #108 + modificationTime: {} name: table_regional_by_table nextColumnId: 2 - ... - nextIndexId: 2 - nextMutationId: 1 - - offlineReason: DROP DATABASE multi_region_test_db CASCADE - parentId: 104 - primaryIndex: ... replacementOf: time: {} - - state: OFFLINE + state: DROP unexposedParentSchemaId: 106 - version: "2" diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion index 9614c8d31349..54d22979e8e0 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion @@ -19,28 +19,13 @@ begin transaction #1 checking for feature: DROP TABLE increment telemetry for sql.schema.drop_table ## StatementPhase stage 1 of 1 with 1 MutationType op -upsert descriptor #108 - ... - localityConfig: - regionalByRow: {} - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: table_regional_by_row - nextColumnId: 3 - ... - nextIndexId: 2 - nextMutationId: 1 - + offlineReason: DROP TABLE multi_region_test_db.public.table_regional_by_row - parentId: 104 - partitionAllBy: true +add synthetic descriptor #108: ... replacementOf: time: {} - + state: OFFLINE + + state: DROP unexposedParentSchemaId: 106 - - version: "1" - + version: "2" + version: "1" # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 4 MutationType ops @@ -107,12 +92,16 @@ upsert descriptor #108 ... localityConfig: regionalByRow: {} - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" + - modificationTime: + - wallTime: "1640995200000000000" + + modificationTime: {} name: table_regional_by_row nextColumnId: 3 ... + time: {} + unexposedParentSchemaId: 106 + - version: "1" + + version: "2" create job #1 (non-cancelable: true): "DROP TABLE multi_region_test_db.public.table_regional_by_row" descriptor IDs: [105 107 108] # end PreCommitPhase @@ -174,16 +163,9 @@ upsert descriptor #108 + modificationTime: {} name: table_regional_by_row nextColumnId: 3 - ... - nextIndexId: 2 - nextMutationId: 1 - - offlineReason: DROP TABLE multi_region_test_db.public.table_regional_by_row - parentId: 104 - partitionAllBy: true ... replacementOf: time: {} - - state: OFFLINE + state: DROP unexposedParentSchemaId: 106 - version: "2" diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region index f559d0ec7d16..1e7c52f0b478 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region @@ -19,28 +19,13 @@ begin transaction #1 checking for feature: DROP TABLE increment telemetry for sql.schema.drop_table ## StatementPhase stage 1 of 1 with 1 MutationType op -upsert descriptor #108 - ... - regionalByTable: - region: us-east2 - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: table_regional_by_table - nextColumnId: 2 - ... - nextIndexId: 2 - nextMutationId: 1 - + offlineReason: DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE - parentId: 104 - primaryIndex: +add synthetic descriptor #108: ... replacementOf: time: {} - + state: OFFLINE + + state: DROP unexposedParentSchemaId: 106 - - version: "1" - + version: "2" + version: "1" # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 3 MutationType ops @@ -89,12 +74,16 @@ upsert descriptor #108 ... regionalByTable: region: us-east2 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" + - modificationTime: + - wallTime: "1640995200000000000" + + modificationTime: {} name: table_regional_by_table nextColumnId: 2 ... + time: {} + unexposedParentSchemaId: 106 + - version: "1" + + version: "2" create job #1 (non-cancelable: true): "DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE" descriptor IDs: [105 108] # end PreCommitPhase @@ -140,16 +129,9 @@ upsert descriptor #108 + modificationTime: {} name: table_regional_by_table nextColumnId: 2 - ... - nextIndexId: 2 - nextMutationId: 1 - - offlineReason: DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE - parentId: 104 - primaryIndex: ... replacementOf: time: {} - - state: OFFLINE + state: DROP unexposedParentSchemaId: 106 - version: "2" diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region index 130e5c8346b7..92bbc2d28595 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region @@ -11,21 +11,21 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE; ├── StatementPhase │ └── Stage 1 of 1 in StatementPhase │ ├── 9 elements transitioning toward ABSENT - │ │ ├── PUBLIC → OFFLINE Database:{DescID: 104} - │ │ ├── PUBLIC → OFFLINE Schema:{DescID: 106} - │ │ ├── PUBLIC → OFFLINE EnumType:{DescID: 105} - │ │ ├── PUBLIC → OFFLINE AliasType:{DescID: 107} - │ │ ├── PUBLIC → OFFLINE Table:{DescID: 108} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ └── PUBLIC → VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → TXN_DROPPED Database:{DescID: 104} + │ │ ├── PUBLIC → TXN_DROPPED Schema:{DescID: 106} + │ │ ├── PUBLIC → TXN_DROPPED EnumType:{DescID: 105} + │ │ ├── PUBLIC → TXN_DROPPED AliasType:{DescID: 107} + │ │ ├── PUBLIC → TXN_DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ └── PUBLIC → VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} │ └── 5 Mutation operations - │ ├── MarkDescriptorAsOffline {"DescID":104,"Reason":"DROP DATABASE mu..."} - │ ├── MarkDescriptorAsOffline {"DescID":106,"Reason":"DROP DATABASE mu..."} - │ ├── MarkDescriptorAsOffline {"DescID":105,"Reason":"DROP DATABASE mu..."} - │ ├── MarkDescriptorAsOffline {"DescID":107,"Reason":"DROP DATABASE mu..."} - │ └── MarkDescriptorAsOffline {"DescID":108,"Reason":"DROP DATABASE mu..."} + │ ├── MarkDescriptorAsSyntheticallyDropped {"DescID":104} + │ ├── MarkDescriptorAsSyntheticallyDropped {"DescID":106} + │ ├── MarkDescriptorAsSyntheticallyDropped {"DescID":105} + │ ├── MarkDescriptorAsSyntheticallyDropped {"DescID":107} + │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase │ └── 6 Mutation operations @@ -38,58 +38,58 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE; └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 52 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 104} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: root} - │ │ ├── OFFLINE → DROPPED Database:{DescID: 104} - │ │ ├── PUBLIC → ABSENT DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} - │ │ ├── PUBLIC → ABSENT DatabaseRegionConfig:{DescID: 104, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: public, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} - │ │ ├── OFFLINE → DROPPED Schema:{DescID: 106} - │ │ ├── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 105, Name: crdb_internal_region, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 105} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: root} - │ │ ├── OFFLINE → DROPPED EnumType:{DescID: 105} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east1} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east2} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east3} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 105, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: _crdb_internal_region, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} - │ │ ├── OFFLINE → DROPPED AliasType:{DescID: 107} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── OFFLINE → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 104} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Database:{DescID: 104} + │ │ ├── PUBLIC → ABSENT DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} + │ │ ├── PUBLIC → ABSENT DatabaseRegionConfig:{DescID: 104, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: public, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Schema:{DescID: 106} + │ │ ├── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 105, Name: crdb_internal_region, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 105} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: root} + │ │ ├── TXN_DROPPED → DROPPED EnumType:{DescID: 105} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east1} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east2} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east3} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 105, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: _crdb_internal_region, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} + │ │ ├── TXN_DROPPED → DROPPED AliasType:{DescID: 107} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} │ └── 20 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":104} │ ├── RemoveDatabaseRoleSettings {"DatabaseID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion index 2170e4d25738..4fe14de4e023 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion @@ -11,14 +11,14 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab ├── StatementPhase │ └── Stage 1 of 1 in StatementPhase │ ├── 6 elements transitioning toward ABSENT - │ │ ├── PUBLIC → OFFLINE Table:{DescID: 108} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 2} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ └── PUBLIC → VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → TXN_DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 2} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ └── PUBLIC → VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} │ └── 1 Mutation operation - │ └── MarkDescriptorAsOffline {"DescID":108,"Reason":"DROP TABLE multi..."} + │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase │ └── 4 Mutation operations @@ -29,32 +29,32 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 26 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── OFFLINE → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalityRegionalByRow:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: k, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 108, ColumnID: 2} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ ├── PUBLIC → ABSENT IndexPartitioning:{DescID: 108, IndexID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_row_pkey, IndexID: 1} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalityRegionalByRow:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: k, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 108, ColumnID: 2} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → ABSENT IndexPartitioning:{DescID: 108, IndexID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_row_pkey, IndexID: 1} │ └── 11 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":108} │ ├── RemoveAllTableComments {"TableID":108} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region index 2919846f9d13..369a03a7ffbe 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region @@ -11,13 +11,13 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab ├── StatementPhase │ └── Stage 1 of 1 in StatementPhase │ ├── 5 elements transitioning toward ABSENT - │ │ ├── PUBLIC → OFFLINE Table:{DescID: 108} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ └── PUBLIC → VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → TXN_DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ └── PUBLIC → VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} │ └── 1 Mutation operation - │ └── MarkDescriptorAsOffline {"DescID":108,"Reason":"DROP TABLE multi..."} + │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase │ └── 3 Mutation operations @@ -27,26 +27,26 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 20 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── OFFLINE → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} │ └── 7 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":108} │ ├── RemoveAllTableComments {"TableID":108} diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region index 53bfdcd28f21..7aa126612805 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region @@ -16,19 +16,19 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ ├── • 9 elements transitioning toward ABSENT │ │ │ │ │ ├── • Database:{DescID: 104} -│ │ │ PUBLIC → OFFLINE +│ │ │ PUBLIC → TXN_DROPPED │ │ │ │ │ ├── • Schema:{DescID: 106} -│ │ │ PUBLIC → OFFLINE +│ │ │ PUBLIC → TXN_DROPPED │ │ │ │ │ ├── • EnumType:{DescID: 105} -│ │ │ PUBLIC → OFFLINE +│ │ │ PUBLIC → TXN_DROPPED │ │ │ │ │ ├── • AliasType:{DescID: 107} -│ │ │ PUBLIC → OFFLINE +│ │ │ PUBLIC → TXN_DROPPED │ │ │ │ │ ├── • Table:{DescID: 108} -│ │ │ PUBLIC → OFFLINE +│ │ │ PUBLIC → TXN_DROPPED │ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ │ PUBLIC → WRITE_ONLY @@ -56,25 +56,20 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ └── • 5 Mutation operations │ │ -│ ├── • MarkDescriptorAsOffline +│ ├── • MarkDescriptorAsSyntheticallyDropped │ │ DescID: 104 -│ │ Reason: DROP DATABASE multi_region_test_db CASCADE │ │ -│ ├── • MarkDescriptorAsOffline +│ ├── • MarkDescriptorAsSyntheticallyDropped │ │ DescID: 106 -│ │ Reason: DROP DATABASE multi_region_test_db CASCADE │ │ -│ ├── • MarkDescriptorAsOffline +│ ├── • MarkDescriptorAsSyntheticallyDropped │ │ DescID: 105 -│ │ Reason: DROP DATABASE multi_region_test_db CASCADE │ │ -│ ├── • MarkDescriptorAsOffline +│ ├── • MarkDescriptorAsSyntheticallyDropped │ │ DescID: 107 -│ │ Reason: DROP DATABASE multi_region_test_db CASCADE │ │ -│ └── • MarkDescriptorAsOffline +│ └── • MarkDescriptorAsSyntheticallyDropped │ DescID: 108 -│ Reason: DROP DATABASE multi_region_test_db CASCADE │ ├── • PreCommitPhase │ │ @@ -169,7 +164,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Database:{DescID: 104} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ ├── • DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} │ │ │ │ PUBLIC → ABSENT @@ -232,7 +227,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Schema:{DescID: 106} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ ├── • SchemaParent:{DescID: 106, ReferencedDescID: 104} │ │ │ │ PUBLIC → ABSENT @@ -289,7 +284,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • EnumType:{DescID: 105} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ ├── • EnumTypeValue:{DescID: 105, Name: us-east1} │ │ │ │ PUBLIC → ABSENT @@ -373,7 +368,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • AliasType:{DescID: 107} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ ├── • ObjectParent:{DescID: 107, ReferencedDescID: 106} │ │ │ │ PUBLIC → ABSENT @@ -421,7 +416,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Table:{DescID: 108} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} │ │ │ │ PUBLIC → ABSENT diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion index bb3167762916..e583c718f24a 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion @@ -16,7 +16,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ ├── • 6 elements transitioning toward ABSENT │ │ │ │ │ ├── • Table:{DescID: 108} -│ │ │ PUBLIC → OFFLINE +│ │ │ PUBLIC → TXN_DROPPED │ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ │ PUBLIC → WRITE_ONLY @@ -50,9 +50,8 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • 1 Mutation operation │ │ -│ └── • MarkDescriptorAsOffline +│ └── • MarkDescriptorAsSyntheticallyDropped │ DescID: 108 -│ Reason: DROP TABLE multi_region_test_db.public.table_regional_by_row │ ├── • PreCommitPhase │ │ @@ -127,7 +126,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Table:{DescID: 108} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} │ │ │ │ PUBLIC → ABSENT diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region index b4fb0300d297..ce9a70f51316 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region @@ -16,7 +16,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ ├── • 5 elements transitioning toward ABSENT │ │ │ │ │ ├── • Table:{DescID: 108} -│ │ │ PUBLIC → OFFLINE +│ │ │ PUBLIC → TXN_DROPPED │ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ │ PUBLIC → WRITE_ONLY @@ -44,9 +44,8 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • 1 Mutation operation │ │ -│ └── • MarkDescriptorAsOffline +│ └── • MarkDescriptorAsSyntheticallyDropped │ DescID: 108 -│ Reason: DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE │ ├── • PreCommitPhase │ │ @@ -117,7 +116,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Table:{DescID: 108} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} │ │ │ │ PUBLIC → ABSENT diff --git a/pkg/sql/logictest/testdata/logic_test/new_schema_changer b/pkg/sql/logictest/testdata/logic_test/new_schema_changer index 901df3d8dbee..63b8aeff5625 100644 --- a/pkg/sql/logictest/testdata/logic_test/new_schema_changer +++ b/pkg/sql/logictest/testdata/logic_test/new_schema_changer @@ -560,6 +560,27 @@ DROP TABLE defaultdb.ttyp; statement ok DROP TYPE defaultdb.typ; +# Demonstrate that descriptors dropped in a transaction figure appropriately +# into virtual tables. Most virtual tables omit the dropped descriptors, some +# show their status. + +query I +SELECT count(*) + FROM information_schema.tables + WHERE table_schema = 'public' + AND table_name LIKE '%typ%'; +---- +0 + +query TT + SELECT name, state + FROM crdb_internal.tables + WHERE schema_name = 'public' + AND name LIKE '%typ%' + ORDER BY name; +---- +ttyp DROP + statement ok COMMIT; @@ -727,7 +748,7 @@ BEGIN statement ok DROP DATABASE db1 CASCADE -statement error database "db1" is offline: DROP DATABASE db1 CASCADE +statement error pgcode 3D000 database "db1" does not exist SELECT * from db1.sc1.v1 statement ok diff --git a/pkg/sql/schemachanger/scdeps/exec_deps.go b/pkg/sql/schemachanger/scdeps/exec_deps.go index 90c0d06d650b..64f2f3108866 100644 --- a/pkg/sql/schemachanger/scdeps/exec_deps.go +++ b/pkg/sql/schemachanger/scdeps/exec_deps.go @@ -138,21 +138,23 @@ func (d *txnDeps) MustReadImmutableDescriptors( AvoidLeased: true, IncludeOffline: true, IncludeDropped: true, + AvoidSynthetic: true, } return d.descsCollection.GetImmutableDescriptorsByID(ctx, d.txn, flags, ids...) } // GetFullyQualifiedName implements the scmutationexec.CatalogReader interface func (d *txnDeps) GetFullyQualifiedName(ctx context.Context, id descpb.ID) (string, error) { - objectDesc, err := d.descsCollection.GetImmutableDescriptorByID(ctx, - d.txn, - id, - tree.CommonLookupFlags{ - Required: true, - IncludeOffline: true, - IncludeDropped: true, - AvoidLeased: true, - }) + flags := tree.CommonLookupFlags{ + Required: true, + IncludeOffline: true, + IncludeDropped: true, + AvoidLeased: true, + AvoidSynthetic: true, + } + objectDesc, err := d.descsCollection.GetImmutableDescriptorByID( + ctx, d.txn, id, flags, + ) if err != nil { return "", err } @@ -160,44 +162,30 @@ func (d *txnDeps) GetFullyQualifiedName(ctx context.Context, id descpb.ID) (stri // we can fetch the fully qualified names. if objectDesc.DescriptorType() != catalog.Database && objectDesc.DescriptorType() != catalog.Schema { - _, databaseDesc, err := d.descsCollection.GetImmutableDatabaseByID(ctx, - d.txn, - objectDesc.GetParentID(), - tree.CommonLookupFlags{ - Required: true, - IncludeOffline: true, - IncludeDropped: true, - AvoidLeased: true, - }) + _, databaseDesc, err := d.descsCollection.GetImmutableDatabaseByID( + ctx, d.txn, objectDesc.GetParentID(), flags, + ) if err != nil { return "", err } - schemaDesc, err := d.descsCollection.GetImmutableSchemaByID(ctx, d.txn, objectDesc.GetParentSchemaID(), - tree.SchemaLookupFlags{ - Required: true, - IncludeOffline: true, - IncludeDropped: true, - AvoidLeased: true, - }) + schemaDesc, err := d.descsCollection.GetImmutableSchemaByID( + ctx, d.txn, objectDesc.GetParentSchemaID(), flags, + ) if err != nil { return "", err } - name := tree.MakeTableNameWithSchema(tree.Name(databaseDesc.GetName()), + name := tree.MakeTableNameWithSchema( + tree.Name(databaseDesc.GetName()), tree.Name(schemaDesc.GetName()), - tree.Name(objectDesc.GetName())) + tree.Name(objectDesc.GetName()), + ) return name.FQString(), nil } else if objectDesc.DescriptorType() == catalog.Database { return objectDesc.GetName(), nil } else if objectDesc.DescriptorType() == catalog.Schema { _, databaseDesc, err := d.descsCollection.GetImmutableDatabaseByID(ctx, - d.txn, - objectDesc.GetParentID(), - tree.CommonLookupFlags{ - Required: true, - IncludeOffline: true, - IncludeDropped: true, - AvoidLeased: true, - }) + d.txn, objectDesc.GetParentID(), flags, + ) if err != nil { return "", err } @@ -213,6 +201,12 @@ func (d *txnDeps) MustReadMutableDescriptor( return d.descsCollection.GetMutableDescriptorByID(ctx, d.txn, id) } +// AddSyntheticDescriptor is part of the +// scmutationexec.SyntheticDescriptorStateUpdater interface. +func (d *txnDeps) AddSyntheticDescriptor(desc catalog.Descriptor) { + d.descsCollection.AddSyntheticDescriptor(desc) +} + // NewCatalogChangeBatcher implements the scexec.Catalog interface. func (d *txnDeps) NewCatalogChangeBatcher() scexec.CatalogChangeBatcher { return &catalogChangeBatcher{ @@ -338,8 +332,9 @@ func (d *txnDeps) GetResumeSpans( ) ([]roachpb.Span, error) { table, err := d.descsCollection.GetImmutableTableByID(ctx, d.txn, tableID, tree.ObjectLookupFlags{ CommonLookupFlags: tree.CommonLookupFlags{ - Required: true, - AvoidLeased: true, + Required: true, + AvoidLeased: true, + AvoidSynthetic: true, }, }) if err != nil { diff --git a/pkg/sql/schemachanger/scdeps/sctestdeps/test_deps.go b/pkg/sql/schemachanger/scdeps/sctestdeps/test_deps.go index 6927648172b9..4adb6122152d 100644 --- a/pkg/sql/schemachanger/scdeps/sctestdeps/test_deps.go +++ b/pkg/sql/schemachanger/scdeps/sctestdeps/test_deps.go @@ -34,11 +34,9 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/privilege" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdeps" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdeps/sctestutils" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec/scmutationexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/scviz" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun" "github.com/cockroachdb/cockroach/pkg/sql/sem/catconstants" "github.com/cockroachdb/cockroach/pkg/sql/sem/eval" @@ -48,7 +46,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" "github.com/cockroachdb/cockroach/pkg/util/log/logpb" - "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/cockroachdb/cockroach/pkg/util/uuid" "github.com/cockroachdb/errors" "github.com/lib/pq/oid" @@ -560,13 +557,25 @@ func (s *TestState) MustReadDescriptor(ctx context.Context, id descpb.ID) catalo return desc } +var _ scmutationexec.SyntheticDescriptorStateUpdater = (*TestState)(nil) + +// AddSyntheticDescriptor is part of the +// scmutationexec.SyntheticDescriptorStateUpdater interface. +func (s *TestState) AddSyntheticDescriptor(desc catalog.Descriptor) { + s.LogSideEffectf("add synthetic descriptor #%d:\n%s", desc.GetID(), s.descriptorDiff(desc)) +} + // mustReadImmutableDescriptor looks up a descriptor and returns a immutable // deep copy. func (s *TestState) mustReadImmutableDescriptor(id descpb.ID) (catalog.Descriptor, error) { - if u := s.uncommitted.LookupDescriptorEntry(id); u != nil { - return u.NewBuilder().BuildImmutable(), nil + mut, err := s.mustReadMutableDescriptor(id) + if err != nil { + if errors.Is(err, catalog.ErrDescriptorNotFound) { + return nil, errors.Wrapf(catalog.ErrDescriptorNotFound, "reading immutable descriptor #%d", id) + } + return nil, err } - return nil, errors.Wrapf(catalog.ErrDescriptorNotFound, "reading immutable descriptor #%d", id) + return mut.ImmutableCopy(), nil } // mustReadMutableDescriptor looks up a descriptor and returns a mutable @@ -768,30 +777,7 @@ func (b *testCatalogChangeBatcher) ValidateAndRun(ctx context.Context) error { b.s.uncommitted.DeleteNamespaceEntry(nameInfo) } for _, desc := range b.descs { - var old protoutil.Message - if d, _ := b.s.mustReadImmutableDescriptor(desc.GetID()); d != nil { - old = d.DescriptorProto() - } - diff := sctestutils.ProtoDiff(old, desc.DescriptorProto(), sctestutils.DiffArgs{ - Indent: " ", - CompactLevel: 3, - }, func(i interface{}) { - scviz.RewriteEmbeddedIntoParent(i) - if m, ok := i.(map[string]interface{}); ok { - ds, exists := m["declarativeSchemaChangerState"].(map[string]interface{}) - if !exists { - return - } - for _, k := range []string{ - "currentStatuses", "targetRanks", "targets", - } { - if _, kExists := ds[k]; kExists { - ds[k] = "" - } - } - } - }) - b.s.LogSideEffectf("upsert descriptor #%d\n%s", desc.GetID(), diff) + b.s.LogSideEffectf("upsert descriptor #%d\n%s", desc.GetID(), b.s.descriptorDiff(desc)) b.s.uncommitted.UpsertDescriptorEntry(desc) } for _, deletedID := range b.descriptorsToDelete.Ordered() { diff --git a/pkg/sql/schemachanger/scdeps/sctestdeps/test_state.go b/pkg/sql/schemachanger/scdeps/sctestdeps/test_state.go index 512acecf32f5..3b1603fe2bd9 100644 --- a/pkg/sql/schemachanger/scdeps/sctestdeps/test_state.go +++ b/pkg/sql/schemachanger/scdeps/sctestdeps/test_state.go @@ -28,13 +28,16 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/descmetadata" "github.com/cockroachdb/cockroach/pkg/sql/faketreeeval" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdeps/sctestutils" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/scviz" "github.com/cockroachdb/cockroach/pkg/sql/sem/catid" "github.com/cockroachdb/cockroach/pkg/sql/sem/eval" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" "github.com/cockroachdb/cockroach/pkg/util/hlc" + "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/cockroachdb/redact" ) @@ -261,3 +264,29 @@ func (s *TestState) DescriptorCommentCache() scbuild.CommentCache { func (s *TestState) ClientNoticeSender() eval.ClientNoticeSender { return &faketreeeval.DummyClientNoticeSender{} } + +func (s *TestState) descriptorDiff(desc catalog.Descriptor) string { + var old protoutil.Message + if d, _ := s.mustReadImmutableDescriptor(desc.GetID()); d != nil { + old = d.DescriptorProto() + } + return sctestutils.ProtoDiff(old, desc.DescriptorProto(), sctestutils.DiffArgs{ + Indent: " ", + CompactLevel: 3, + }, func(i interface{}) { + scviz.RewriteEmbeddedIntoParent(i) + if m, ok := i.(map[string]interface{}); ok { + ds, exists := m["declarativeSchemaChangerState"].(map[string]interface{}) + if !exists { + return + } + for _, k := range []string{ + "currentStatuses", "targetRanks", "targets", + } { + if _, kExists := ds[k]; kExists { + ds[k] = "" + } + } + } + }) +} diff --git a/pkg/sql/schemachanger/scexec/dependencies.go b/pkg/sql/schemachanger/scexec/dependencies.go index c8ae741d5fda..4a1450b1d54a 100644 --- a/pkg/sql/schemachanger/scexec/dependencies.go +++ b/pkg/sql/schemachanger/scexec/dependencies.go @@ -55,6 +55,7 @@ type Dependencies interface { // changes. type Catalog interface { scmutationexec.NameResolver + scmutationexec.SyntheticDescriptorStateUpdater // MustReadImmutableDescriptors reads descriptors from the catalog by ID. MustReadImmutableDescriptors(ctx context.Context, ids ...descpb.ID) ([]catalog.Descriptor, error) diff --git a/pkg/sql/schemachanger/scexec/exec_mutation.go b/pkg/sql/schemachanger/scexec/exec_mutation.go index a1dcdb613303..f52f3588d8d4 100644 --- a/pkg/sql/schemachanger/scexec/exec_mutation.go +++ b/pkg/sql/schemachanger/scexec/exec_mutation.go @@ -38,7 +38,7 @@ import ( func executeDescriptorMutationOps(ctx context.Context, deps Dependencies, ops []scop.Op) error { mvs := newMutationVisitorState(deps.Catalog()) - v := scmutationexec.NewMutationVisitor(mvs, deps.Catalog(), deps.Clock()) + v := scmutationexec.NewMutationVisitor(mvs, deps.Catalog(), deps.Clock(), deps.Catalog()) for _, op := range ops { if err := op.(scop.MutationOp).Visit(ctx, v); err != nil { return errors.Wrapf(err, "%T: %v", op, op) @@ -105,6 +105,7 @@ func performBatchedCatalogWrites( err := modifiedDescriptors.Iterate(func(entry catalog.NameEntry) error { return b.CreateOrUpdateDescriptor(ctx, entry.(catalog.MutableDescriptor)) }) + if err != nil { return err } @@ -400,7 +401,6 @@ type mutationVisitorState struct { eventsByStatement map[uint32][]eventPayload scheduleIDsToDelete []int64 statsToRefresh map[descpb.ID]struct{} - gcJobs } diff --git a/pkg/sql/schemachanger/scexec/mocks_generated_test.go b/pkg/sql/schemachanger/scexec/mocks_generated_test.go index c1d0766c0549..49a3189d201d 100644 --- a/pkg/sql/schemachanger/scexec/mocks_generated_test.go +++ b/pkg/sql/schemachanger/scexec/mocks_generated_test.go @@ -39,6 +39,18 @@ func (m *MockCatalog) EXPECT() *MockCatalogMockRecorder { return m.recorder } +// AddSyntheticDescriptor mocks base method. +func (m *MockCatalog) AddSyntheticDescriptor(arg0 catalog.Descriptor) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "AddSyntheticDescriptor", arg0) +} + +// AddSyntheticDescriptor indicates an expected call of AddSyntheticDescriptor. +func (mr *MockCatalogMockRecorder) AddSyntheticDescriptor(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSyntheticDescriptor", reflect.TypeOf((*MockCatalog)(nil).AddSyntheticDescriptor), arg0) +} + // GetFullyQualifiedName mocks base method. func (m *MockCatalog) GetFullyQualifiedName(arg0 context.Context, arg1 catid.DescID) (string, error) { m.ctrl.T.Helper() diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/dependencies.go b/pkg/sql/schemachanger/scexec/scmutationexec/dependencies.go index 15b083081ead..153260b38bf5 100644 --- a/pkg/sql/schemachanger/scexec/scmutationexec/dependencies.go +++ b/pkg/sql/schemachanger/scexec/scmutationexec/dependencies.go @@ -40,6 +40,19 @@ type Clock interface { ApproximateTime() time.Time } +// SyntheticDescriptorStateUpdater is used to update the synthetic descriptor +// state. This state is not visible to the operations in the declarative schema +// changer execution layer. Its only purpose is to ensure that subsequent +// queries in the same transaction as a schema change statement behave as if the +// schema change had already completed. +type SyntheticDescriptorStateUpdater interface { + + // AddSyntheticDescriptor sets a synthetic descriptor to shadow any existing + // descriptor with the same name or the same ID for the remainder of the + // current transaction. + AddSyntheticDescriptor(desc catalog.Descriptor) +} + // MutationVisitorStateUpdater is the interface for updating the visitor state. type MutationVisitorStateUpdater interface { diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/drop.go b/pkg/sql/schemachanger/scexec/scmutationexec/drop.go index 34774e060ec4..4c48cafb7bfc 100644 --- a/pkg/sql/schemachanger/scexec/scmutationexec/drop.go +++ b/pkg/sql/schemachanger/scexec/scmutationexec/drop.go @@ -71,14 +71,16 @@ func (m *visitor) MarkDescriptorAsPublic( return nil } -func (m *visitor) MarkDescriptorAsOffline( - ctx context.Context, op scop.MarkDescriptorAsOffline, +func (m *visitor) MarkDescriptorAsSyntheticallyDropped( + ctx context.Context, op scop.MarkDescriptorAsSyntheticallyDropped, ) error { - desc, err := m.s.CheckOutDescriptor(ctx, op.DescID) + desc, err := m.s.GetDescriptor(ctx, op.DescID) if err != nil { return err } - desc.SetOffline(op.Reason) + synth := desc.NewBuilder().BuildExistingMutable() + synth.SetDropped() + m.sd.AddSyntheticDescriptor(synth) return nil } diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/scmutationexec.go b/pkg/sql/schemachanger/scexec/scmutationexec/scmutationexec.go index d9974378bce1..4ee04b69b2c7 100644 --- a/pkg/sql/schemachanger/scexec/scmutationexec/scmutationexec.go +++ b/pkg/sql/schemachanger/scexec/scmutationexec/scmutationexec.go @@ -18,12 +18,13 @@ import ( // NewMutationVisitor creates a new scop.MutationVisitor. func NewMutationVisitor( - s MutationVisitorStateUpdater, nr NameResolver, clock Clock, + s MutationVisitorStateUpdater, nr NameResolver, clock Clock, sd SyntheticDescriptorStateUpdater, ) scop.MutationVisitor { return &visitor{ nr: nr, s: s, clock: clock, + sd: sd, } } @@ -33,6 +34,7 @@ type visitor struct { clock Clock nr NameResolver s MutationVisitorStateUpdater + sd SyntheticDescriptorStateUpdater } func (m *visitor) NotImplemented(_ context.Context, _ scop.NotImplemented) error { diff --git a/pkg/sql/schemachanger/scop/mutation.go b/pkg/sql/schemachanger/scop/mutation.go index 95ace62c59c2..11093c3338e9 100644 --- a/pkg/sql/schemachanger/scop/mutation.go +++ b/pkg/sql/schemachanger/scop/mutation.go @@ -153,11 +153,11 @@ type MarkDescriptorAsPublic struct { DescID descpb.ID } -// MarkDescriptorAsOffline changes the descriptor's state to OFFLINE. -type MarkDescriptorAsOffline struct { +// MarkDescriptorAsSyntheticallyDropped changes the descriptor's state to +// DROPPED, but records that status only synthetically. +type MarkDescriptorAsSyntheticallyDropped struct { mutationOp DescID descpb.ID - Reason string } // MarkDescriptorAsDropped changes the descriptor's state to DROPPED. diff --git a/pkg/sql/schemachanger/scop/mutation_visitor_generated.go b/pkg/sql/schemachanger/scop/mutation_visitor_generated.go index fda175f4a341..e37d85e064f5 100644 --- a/pkg/sql/schemachanger/scop/mutation_visitor_generated.go +++ b/pkg/sql/schemachanger/scop/mutation_visitor_generated.go @@ -37,7 +37,7 @@ type MutationVisitor interface { CreateGcJobForDatabase(context.Context, CreateGcJobForDatabase) error CreateGcJobForIndex(context.Context, CreateGcJobForIndex) error MarkDescriptorAsPublic(context.Context, MarkDescriptorAsPublic) error - MarkDescriptorAsOffline(context.Context, MarkDescriptorAsOffline) error + MarkDescriptorAsSyntheticallyDropped(context.Context, MarkDescriptorAsSyntheticallyDropped) error MarkDescriptorAsDropped(context.Context, MarkDescriptorAsDropped) error DrainDescriptorName(context.Context, DrainDescriptorName) error MakeAddedColumnDeleteAndWriteOnly(context.Context, MakeAddedColumnDeleteAndWriteOnly) error @@ -173,8 +173,8 @@ func (op MarkDescriptorAsPublic) Visit(ctx context.Context, v MutationVisitor) e } // Visit is part of the MutationOp interface. -func (op MarkDescriptorAsOffline) Visit(ctx context.Context, v MutationVisitor) error { - return v.MarkDescriptorAsOffline(ctx, op) +func (op MarkDescriptorAsSyntheticallyDropped) Visit(ctx context.Context, v MutationVisitor) error { + return v.MarkDescriptorAsSyntheticallyDropped(ctx, op) } // Visit is part of the MutationOp interface. diff --git a/pkg/sql/schemachanger/scpb/scpb.proto b/pkg/sql/schemachanger/scpb/scpb.proto index 7d4ef1d5d409..8ec80ef36ded 100644 --- a/pkg/sql/schemachanger/scpb/scpb.proto +++ b/pkg/sql/schemachanger/scpb/scpb.proto @@ -26,6 +26,10 @@ message Target { enum Status { UNKNOWN = 0; + // OFFLINE exists only as a part of decomposition to detect importing + // descriptors. + OFFLINE = 15; + // Target states are ABSENT, PUBLIC or TRANSIENT_ABSENT. // These are the desired final end states of a schema change. ABSENT = 1; @@ -35,9 +39,8 @@ enum Status { TRANSIENT_ABSENT = 3; // Intermediate states on the descriptor dropping path. - reserved 4; // Formerly TXN_DROPPED. + TXN_DROPPED = 4; DROPPED = 5; - OFFLINE = 15; // Intermediate states on the column and index dropping and adding paths. WRITE_ONLY = 6; diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_alias_type.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_alias_type.go index da1f1441887f..8b6d32ba7a6c 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_alias_type.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_alias_type.go @@ -20,7 +20,7 @@ func init() { toPublic( scpb.Status_ABSENT, equiv(scpb.Status_DROPPED), - to(scpb.Status_OFFLINE, + to(scpb.Status_TXN_DROPPED, emit(func(this *scpb.AliasType) *scop.NotImplemented { return notImplemented(this) }), @@ -35,11 +35,10 @@ func init() { ), toAbsent( scpb.Status_PUBLIC, - to(scpb.Status_OFFLINE, - emit(func(this *scpb.AliasType, md *targetsWithElementMap) *scop.MarkDescriptorAsOffline { - return &scop.MarkDescriptorAsOffline{ + to(scpb.Status_TXN_DROPPED, + emit(func(this *scpb.AliasType, md *targetsWithElementMap) *scop.MarkDescriptorAsSyntheticallyDropped { + return &scop.MarkDescriptorAsSyntheticallyDropped{ DescID: this.TypeID, - Reason: statementForDropJob(this, md).Statement, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database.go index a5e92248ca10..8e886b0dab42 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database.go @@ -20,7 +20,7 @@ func init() { toPublic( scpb.Status_ABSENT, equiv(scpb.Status_DROPPED), - to(scpb.Status_OFFLINE, + to(scpb.Status_TXN_DROPPED, emit(func(this *scpb.Database) *scop.NotImplemented { return notImplemented(this) }), @@ -35,11 +35,10 @@ func init() { ), toAbsent( scpb.Status_PUBLIC, - to(scpb.Status_OFFLINE, - emit(func(this *scpb.Database, md *targetsWithElementMap) *scop.MarkDescriptorAsOffline { - return &scop.MarkDescriptorAsOffline{ + to(scpb.Status_TXN_DROPPED, + emit(func(this *scpb.Database, md *targetsWithElementMap) *scop.MarkDescriptorAsSyntheticallyDropped { + return &scop.MarkDescriptorAsSyntheticallyDropped{ DescID: this.DatabaseID, - Reason: statementForDropJob(this, md).Statement, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_enum_type.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_enum_type.go index d749d40be3e6..2f908f688081 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_enum_type.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_enum_type.go @@ -20,7 +20,7 @@ func init() { toPublic( scpb.Status_ABSENT, equiv(scpb.Status_DROPPED), - to(scpb.Status_OFFLINE, + to(scpb.Status_TXN_DROPPED, emit(func(this *scpb.EnumType) *scop.NotImplemented { return notImplemented(this) }), @@ -35,11 +35,10 @@ func init() { ), toAbsent( scpb.Status_PUBLIC, - to(scpb.Status_OFFLINE, - emit(func(this *scpb.EnumType, md *targetsWithElementMap) *scop.MarkDescriptorAsOffline { - return &scop.MarkDescriptorAsOffline{ + to(scpb.Status_TXN_DROPPED, + emit(func(this *scpb.EnumType, md *targetsWithElementMap) *scop.MarkDescriptorAsSyntheticallyDropped { + return &scop.MarkDescriptorAsSyntheticallyDropped{ DescID: this.TypeID, - Reason: statementForDropJob(this, md).Statement, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema.go index c864bd95bb2d..a865d7bc2ec2 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema.go @@ -20,7 +20,7 @@ func init() { toPublic( scpb.Status_ABSENT, equiv(scpb.Status_DROPPED), - to(scpb.Status_OFFLINE, + to(scpb.Status_TXN_DROPPED, emit(func(this *scpb.Schema) *scop.NotImplemented { return notImplemented(this) }), @@ -34,11 +34,10 @@ func init() { ), ), toAbsent(scpb.Status_PUBLIC, - to(scpb.Status_OFFLINE, - emit(func(this *scpb.Schema, md *targetsWithElementMap) *scop.MarkDescriptorAsOffline { - return &scop.MarkDescriptorAsOffline{ + to(scpb.Status_TXN_DROPPED, + emit(func(this *scpb.Schema, md *targetsWithElementMap) *scop.MarkDescriptorAsSyntheticallyDropped { + return &scop.MarkDescriptorAsSyntheticallyDropped{ DescID: this.SchemaID, - Reason: statementForDropJob(this, md).Statement, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_sequence.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_sequence.go index a3487080d13d..d7e20b2e4c0f 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_sequence.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_sequence.go @@ -21,7 +21,7 @@ func init() { toPublic( scpb.Status_ABSENT, equiv(scpb.Status_DROPPED), - to(scpb.Status_OFFLINE, + to(scpb.Status_TXN_DROPPED, emit(func(this *scpb.Sequence) *scop.NotImplemented { return notImplemented(this) }), @@ -35,11 +35,10 @@ func init() { ), ), toAbsent(scpb.Status_PUBLIC, - to(scpb.Status_OFFLINE, - emit(func(this *scpb.Sequence, md *targetsWithElementMap) *scop.MarkDescriptorAsOffline { - return &scop.MarkDescriptorAsOffline{ + to(scpb.Status_TXN_DROPPED, + emit(func(this *scpb.Sequence, md *targetsWithElementMap) *scop.MarkDescriptorAsSyntheticallyDropped { + return &scop.MarkDescriptorAsSyntheticallyDropped{ DescID: this.SequenceID, - Reason: statementForDropJob(this, md).Statement, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table.go index f8d1bd2912a3..a38be982178a 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table.go @@ -20,7 +20,7 @@ func init() { toPublic( scpb.Status_ABSENT, equiv(scpb.Status_DROPPED), - to(scpb.Status_OFFLINE, + to(scpb.Status_TXN_DROPPED, emit(func(this *scpb.Table) *scop.NotImplemented { return notImplemented(this) }), @@ -35,11 +35,10 @@ func init() { ), toAbsent( scpb.Status_PUBLIC, - to(scpb.Status_OFFLINE, - emit(func(this *scpb.Table, md *targetsWithElementMap) *scop.MarkDescriptorAsOffline { - return &scop.MarkDescriptorAsOffline{ + to(scpb.Status_TXN_DROPPED, + emit(func(this *scpb.Table, md *targetsWithElementMap) *scop.MarkDescriptorAsSyntheticallyDropped { + return &scop.MarkDescriptorAsSyntheticallyDropped{ DescID: this.TableID, - Reason: statementForDropJob(this, md).Statement, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_view.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_view.go index cc73526268af..f9c9260ecaec 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_view.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_view.go @@ -20,7 +20,7 @@ func init() { toPublic( scpb.Status_ABSENT, equiv(scpb.Status_DROPPED), - to(scpb.Status_OFFLINE, + to(scpb.Status_TXN_DROPPED, emit(func(this *scpb.View) *scop.NotImplemented { return notImplemented(this) }), @@ -35,11 +35,10 @@ func init() { ), toAbsent( scpb.Status_PUBLIC, - to(scpb.Status_OFFLINE, - emit(func(this *scpb.View, md *targetsWithElementMap) *scop.MarkDescriptorAsOffline { - return &scop.MarkDescriptorAsOffline{ + to(scpb.Status_TXN_DROPPED, + emit(func(this *scpb.View, md *targetsWithElementMap) *scop.MarkDescriptorAsSyntheticallyDropped { + return &scop.MarkDescriptorAsSyntheticallyDropped{ DescID: this.ViewID, - Reason: statementForDropJob(this, md).Statement, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/rules/assertions_test.go b/pkg/sql/schemachanger/scplan/internal/rules/assertions_test.go index 6a158872ea7b..0b9ca70f7c08 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/assertions_test.go +++ b/pkg/sql/schemachanger/scplan/internal/rules/assertions_test.go @@ -78,7 +78,7 @@ func checkToAbsentCategories(e scpb.Element) error { s0 := opgen.InitialStatus(e, scpb.Status_ABSENT) s1 := opgen.NextStatus(e, scpb.Status_ABSENT, s0) switch s1 { - case scpb.Status_OFFLINE, scpb.Status_DROPPED: + case scpb.Status_TXN_DROPPED, scpb.Status_DROPPED: if IsDescriptor(e) { return nil } diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column b/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column index 0ba5b08e4e33..514de177bf6f 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column @@ -20,7 +20,7 @@ StatementPhase stage 1 of 1 with 12 MutationType ops [[ColumnName:{DescID: 107, Name: v1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 107, Name: foo_v2_key, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 108}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 108}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY @@ -62,9 +62,8 @@ StatementPhase stage 1 of 1 with 12 MutationType ops IndexID: 2 Name: crdb_internal_index_2_name_placeholder TableID: 107 - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 108 - Reason: ALTER TABLE defaultdb.public.foo DROP COLUMN v1 CASCADE *scop.MakeAddedIndexBackfilling Index: ConstraintID: 3 @@ -234,7 +233,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 19 MutationType ops [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 108}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -856,7 +855,7 @@ StatementPhase stage 1 of 1 with 12 MutationType ops [[ColumnName:{DescID: 107, Name: v2, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 107, Name: foo_v2_key, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 108}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 108}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY @@ -876,9 +875,8 @@ StatementPhase stage 1 of 1 with 12 MutationType ops IndexID: 2 Name: crdb_internal_index_2_name_placeholder TableID: 107 - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 108 - Reason: ALTER TABLE defaultdb.public.foo DROP COLUMN v2 CASCADE *scop.MakeAddedIndexBackfilling Index: ConstraintID: 3 @@ -1082,7 +1080,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 20 MutationType ops [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 108}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_database b/pkg/sql/schemachanger/scplan/testdata/drop_database index df01e4e73800..577448625eb9 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_database +++ b/pkg/sql/schemachanger/scplan/testdata/drop_database @@ -21,95 +21,81 @@ DROP DATABASE db1 CASCADE ---- StatementPhase stage 1 of 1 with 14 MutationType ops transitions: - [[Database:{DescID: 104}, ABSENT], PUBLIC] -> OFFLINE - [[Schema:{DescID: 105}, ABSENT], PUBLIC] -> OFFLINE - [[Schema:{DescID: 106}, ABSENT], PUBLIC] -> OFFLINE - [[Sequence:{DescID: 107}, ABSENT], PUBLIC] -> OFFLINE - [[Table:{DescID: 110}, ABSENT], PUBLIC] -> OFFLINE + [[Database:{DescID: 104}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Schema:{DescID: 105}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Schema:{DescID: 106}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Sequence:{DescID: 107}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Table:{DescID: 110}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY [[PrimaryIndex:{DescID: 110, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED - [[Sequence:{DescID: 108}, ABSENT], PUBLIC] -> OFFLINE - [[Table:{DescID: 109}, ABSENT], PUBLIC] -> OFFLINE + [[Sequence:{DescID: 108}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Table:{DescID: 109}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED - [[View:{DescID: 111}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 111}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 112}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 112}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 112, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 112, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 112, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 112, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 113}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 113}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 114}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 114}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[EnumType:{DescID: 115}, ABSENT], PUBLIC] -> OFFLINE - [[AliasType:{DescID: 116}, ABSENT], PUBLIC] -> OFFLINE - [[View:{DescID: 117}, ABSENT], PUBLIC] -> OFFLINE + [[EnumType:{DescID: 115}, ABSENT], PUBLIC] -> TXN_DROPPED + [[AliasType:{DescID: 116}, ABSENT], PUBLIC] -> TXN_DROPPED + [[View:{DescID: 117}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 117, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 117, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 117, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 117, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 117, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 104 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 106 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 107 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 110 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 108 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 109 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 111 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 112 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 113 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 114 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 115 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 116 - Reason: DROP DATABASE db1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 117 - Reason: DROP DATABASE db1 CASCADE PreCommitPhase stage 1 of 1 with 15 MutationType ops transitions: ops: @@ -188,7 +174,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Database:{DescID: 104}, ABSENT], OFFLINE] -> DROPPED + [[Database:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__}, ABSENT], PUBLIC] -> ABSENT [[DatabaseComment:{DescID: 104, Comment: db1 is good}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 105, Name: public, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -196,26 +182,26 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Schema:{DescID: 105}, ABSENT], OFFLINE] -> DROPPED + [[Schema:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 105, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: sc1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Schema:{DescID: 106}, ABSENT], OFFLINE] -> DROPPED + [[Schema:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 106, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[SchemaComment:{DescID: 106, Comment: sc1 is good}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: sq1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Sequence:{DescID: 107}, ABSENT], OFFLINE] -> DROPPED + [[Sequence:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 110, Name: t1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Table:{DescID: 110}, ABSENT], OFFLINE] -> DROPPED + [[Table:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 110, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY @@ -243,13 +229,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Sequence:{DescID: 108}, ABSENT], OFFLINE] -> DROPPED + [[Sequence:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 109, Name: t1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Table:{DescID: 109}, ABSENT], OFFLINE] -> DROPPED + [[Table:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 109, Comment: t1 is good}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT @@ -278,7 +264,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[Owner:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 111}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -293,7 +279,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[Owner:{DescID: 112}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 112, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 112, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 112}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 112}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 112, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 112, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -311,7 +297,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[Owner:{DescID: 113}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 113, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 113}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -329,7 +315,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[Owner:{DescID: 114}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 114, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 114, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 114}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 114}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 114, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -348,7 +334,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 115, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 115, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 115, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[EnumType:{DescID: 115}, ABSENT], OFFLINE] -> DROPPED + [[EnumType:{DescID: 115}, ABSENT], TXN_DROPPED] -> DROPPED [[EnumTypeValue:{DescID: 115, Name: a}, ABSENT], PUBLIC] -> ABSENT [[ObjectParent:{DescID: 115, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 116, Name: _typ, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -356,13 +342,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 116, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 116, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 116, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[AliasType:{DescID: 116}, ABSENT], OFFLINE] -> DROPPED + [[AliasType:{DescID: 116}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 116, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 117, Name: v5, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 117}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 117, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 117, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 117}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 117}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 117, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 117, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_index b/pkg/sql/schemachanger/scplan/testdata/drop_index index 0770b1536fb5..76c5ae02e759 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_index +++ b/pkg/sql/schemachanger/scplan/testdata/drop_index @@ -532,7 +532,7 @@ StatementPhase stage 1 of 1 with 3 MutationType ops transitions: [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 104, Name: idx4, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 105}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 105}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY @@ -544,9 +544,8 @@ StatementPhase stage 1 of 1 with 3 MutationType ops IndexID: 8 Name: crdb_internal_index_8_name_placeholder TableID: 104 - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 - Reason: DROP INDEX defaultdb.public.t1@idx4 CASCADE PreCommitPhase stage 1 of 1 with 3 MutationType ops transitions: ops: @@ -578,7 +577,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 105}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: count, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by index 8f1115263777..c2030cf173ff 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by +++ b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by @@ -19,62 +19,53 @@ DROP OWNED BY r ---- StatementPhase stage 1 of 1 with 9 MutationType ops transitions: - [[Schema:{DescID: 105}, ABSENT], PUBLIC] -> OFFLINE - [[Sequence:{DescID: 106}, ABSENT], PUBLIC] -> OFFLINE - [[Table:{DescID: 109}, ABSENT], PUBLIC] -> OFFLINE + [[Schema:{DescID: 105}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Sequence:{DescID: 106}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Table:{DescID: 109}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED - [[Sequence:{DescID: 107}, ABSENT], PUBLIC] -> OFFLINE - [[Table:{DescID: 108}, ABSENT], PUBLIC] -> OFFLINE + [[Sequence:{DescID: 107}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Table:{DescID: 108}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED - [[View:{DescID: 110}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 110}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[EnumType:{DescID: 111}, ABSENT], PUBLIC] -> OFFLINE - [[AliasType:{DescID: 112}, ABSENT], PUBLIC] -> OFFLINE - [[View:{DescID: 113}, ABSENT], PUBLIC] -> OFFLINE + [[EnumType:{DescID: 111}, ABSENT], PUBLIC] -> TXN_DROPPED + [[AliasType:{DescID: 112}, ABSENT], PUBLIC] -> TXN_DROPPED + [[View:{DescID: 113}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 - Reason: DROP OWNED BY r - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 106 - Reason: DROP OWNED BY r - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 109 - Reason: DROP OWNED BY r - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 107 - Reason: DROP OWNED BY r - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 108 - Reason: DROP OWNED BY r - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 110 - Reason: DROP OWNED BY r - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 111 - Reason: DROP OWNED BY r - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 112 - Reason: DROP OWNED BY r - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 113 - Reason: DROP OWNED BY r PreCommitPhase stage 1 of 1 with 12 MutationType ops transitions: ops: @@ -141,20 +132,20 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 46 MutationType ops [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Schema:{DescID: 105}, ABSENT], OFFLINE] -> DROPPED + [[Schema:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 105, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: r}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: sq, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Sequence:{DescID: 106}, ABSENT], OFFLINE] -> DROPPED + [[Sequence:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 106, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 109, Name: t, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Table:{DescID: 109}, ABSENT], OFFLINE] -> DROPPED + [[Table:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY @@ -182,13 +173,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 46 MutationType ops [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Sequence:{DescID: 107}, ABSENT], OFFLINE] -> DROPPED + [[Sequence:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: t, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Table:{DescID: 108}, ABSENT], OFFLINE] -> DROPPED + [[Table:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY @@ -216,7 +207,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 46 MutationType ops [[Owner:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 110}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -232,7 +223,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 46 MutationType ops [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[EnumType:{DescID: 111}, ABSENT], OFFLINE] -> DROPPED + [[EnumType:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[EnumTypeValue:{DescID: 111, Name: a}, ABSENT], PUBLIC] -> ABSENT [[ObjectParent:{DescID: 111, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 112, Name: _typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -240,13 +231,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 46 MutationType ops [[UserPrivileges:{DescID: 112, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 112, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 112, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[AliasType:{DescID: 112}, ABSENT], OFFLINE] -> DROPPED + [[AliasType:{DescID: 112}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 112, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 113, Name: v2, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 113}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 113, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 113}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_schema b/pkg/sql/schemachanger/scplan/testdata/drop_schema index afa31b2c2c72..aad178fe5553 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_schema +++ b/pkg/sql/schemachanger/scplan/testdata/drop_schema @@ -1077,73 +1077,63 @@ DROP SCHEMA defaultdb.SC1 CASCADE ---- StatementPhase stage 1 of 1 with 10 MutationType ops transitions: - [[Schema:{DescID: 104}, ABSENT], PUBLIC] -> OFFLINE - [[Sequence:{DescID: 105}, ABSENT], PUBLIC] -> OFFLINE - [[Table:{DescID: 106}, ABSENT], PUBLIC] -> OFFLINE + [[Schema:{DescID: 104}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Sequence:{DescID: 105}, ABSENT], PUBLIC] -> TXN_DROPPED + [[Table:{DescID: 106}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 106, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY [[PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED - [[View:{DescID: 107}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 107}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 108}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 108}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 109}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 109}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 110}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 110}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 110, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[EnumType:{DescID: 111}, ABSENT], PUBLIC] -> OFFLINE - [[AliasType:{DescID: 112}, ABSENT], PUBLIC] -> OFFLINE - [[View:{DescID: 113}, ABSENT], PUBLIC] -> OFFLINE + [[EnumType:{DescID: 111}, ABSENT], PUBLIC] -> TXN_DROPPED + [[AliasType:{DescID: 112}, ABSENT], PUBLIC] -> TXN_DROPPED + [[View:{DescID: 113}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 113, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 104 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 106 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 107 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 108 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 109 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 110 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 111 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 112 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 113 - Reason: DROP SCHEMA defaultdb.sc1 CASCADE PreCommitPhase stage 1 of 1 with 12 MutationType ops transitions: ops: @@ -1209,20 +1199,20 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Schema:{DescID: 104}, ABSENT], OFFLINE] -> DROPPED + [[Schema:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 104, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[SchemaComment:{DescID: 104, Comment: sc1 is good schema}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 105, Name: sq1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Sequence:{DescID: 105}, ABSENT], OFFLINE] -> DROPPED + [[Sequence:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: t1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Table:{DescID: 106}, ABSENT], OFFLINE] -> DROPPED + [[Table:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 106, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 106, Comment: t1 is good table}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 106, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT @@ -1251,7 +1241,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 107}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -1266,7 +1256,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 108}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -1284,7 +1274,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 109}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -1302,7 +1292,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[Owner:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 110}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -1321,7 +1311,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[EnumType:{DescID: 111}, ABSENT], OFFLINE] -> DROPPED + [[EnumType:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[EnumTypeValue:{DescID: 111, Name: a}, ABSENT], PUBLIC] -> ABSENT [[ObjectParent:{DescID: 111, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 112, Name: _typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1329,13 +1319,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 112, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 112, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 112, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[AliasType:{DescID: 112}, ABSENT], OFFLINE] -> DROPPED + [[AliasType:{DescID: 112}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 112, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 113, Name: v5, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 113}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 113, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 113}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_sequence b/pkg/sql/schemachanger/scplan/testdata/drop_sequence index d8cec88a34f4..73258e57abb0 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_sequence +++ b/pkg/sql/schemachanger/scplan/testdata/drop_sequence @@ -7,11 +7,10 @@ DROP SEQUENCE defaultdb.SQ1 ---- StatementPhase stage 1 of 1 with 1 MutationType op transitions: - [[Sequence:{DescID: 104}, ABSENT], PUBLIC] -> OFFLINE + [[Sequence:{DescID: 104}, ABSENT], PUBLIC] -> TXN_DROPPED ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 104 - Reason: DROP SEQUENCE defaultdb.public.sq1 PreCommitPhase stage 1 of 1 with 2 MutationType ops transitions: ops: @@ -36,7 +35,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Sequence:{DescID: 104}, ABSENT], OFFLINE] -> DROPPED + [[Sequence:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 104, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT ops: *scop.MarkDescriptorAsDropped @@ -92,11 +91,10 @@ DROP SEQUENCE defaultdb.SQ1 CASCADE ---- StatementPhase stage 1 of 1 with 1 MutationType op transitions: - [[Sequence:{DescID: 104}, ABSENT], PUBLIC] -> OFFLINE + [[Sequence:{DescID: 104}, ABSENT], PUBLIC] -> TXN_DROPPED ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 104 - Reason: DROP SEQUENCE defaultdb.public.sq1 CASCADE PreCommitPhase stage 1 of 1 with 4 MutationType ops transitions: ops: @@ -129,7 +127,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 11 MutationType ops [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Sequence:{DescID: 104}, ABSENT], OFFLINE] -> DROPPED + [[Sequence:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 104, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 105, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_table b/pkg/sql/schemachanger/scplan/testdata/drop_table index 43dc214c77d0..5757c0648f26 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_table +++ b/pkg/sql/schemachanger/scplan/testdata/drop_table @@ -31,7 +31,7 @@ DROP TABLE defaultdb.shipments CASCADE; ---- StatementPhase stage 1 of 1 with 3 MutationType ops transitions: - [[Table:{DescID: 109}, ABSENT], PUBLIC] -> OFFLINE + [[Table:{DescID: 109}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY @@ -41,22 +41,19 @@ StatementPhase stage 1 of 1 with 3 MutationType ops [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED [[SecondaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 0}, ABSENT], PUBLIC] -> VALIDATED - [[Sequence:{DescID: 110}, ABSENT], PUBLIC] -> OFFLINE - [[View:{DescID: 111}, ABSENT], PUBLIC] -> OFFLINE + [[Sequence:{DescID: 110}, ABSENT], PUBLIC] -> TXN_DROPPED + [[View:{DescID: 111}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 109 - Reason: DROP TABLE defaultdb.public.shipments CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 110 - Reason: DROP TABLE defaultdb.public.shipments CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 111 - Reason: DROP TABLE defaultdb.public.shipments CASCADE PreCommitPhase stage 1 of 1 with 9 MutationType ops transitions: ops: @@ -110,7 +107,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Table:{DescID: 109}, ABSENT], OFFLINE] -> DROPPED + [[Table:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 109, Comment: shipment is important}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT @@ -162,13 +159,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops [[Owner:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Sequence:{DescID: 110}, ABSENT], OFFLINE] -> DROPPED + [[Sequence:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 111}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: customer_id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -1214,7 +1211,7 @@ DROP TABLE defaultdb.greeter ---- StatementPhase stage 1 of 1 with 1 MutationType op transitions: - [[Table:{DescID: 114}, ABSENT], PUBLIC] -> OFFLINE + [[Table:{DescID: 114}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 114, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 114, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY @@ -1223,9 +1220,8 @@ StatementPhase stage 1 of 1 with 1 MutationType op [[PrimaryIndex:{DescID: 114, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED [[SecondaryIndex:{DescID: 114, IndexID: 2, ConstraintID: 0}, ABSENT], PUBLIC] -> VALIDATED ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 114 - Reason: DROP TABLE defaultdb.public.greeter PreCommitPhase stage 1 of 1 with 4 MutationType ops transitions: ops: @@ -1259,7 +1255,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 16 MutationType ops [[Owner:{DescID: 114}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 114, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 114, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[Table:{DescID: 114}, ABSENT], OFFLINE] -> DROPPED + [[Table:{DescID: 114}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 114, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 114, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_type b/pkg/sql/schemachanger/scplan/testdata/drop_type index dfbb241a9de1..3f8b6628f60b 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_type +++ b/pkg/sql/schemachanger/scplan/testdata/drop_type @@ -7,15 +7,13 @@ DROP TYPE defaultdb.typ ---- StatementPhase stage 1 of 1 with 2 MutationType ops transitions: - [[EnumType:{DescID: 104}, ABSENT], PUBLIC] -> OFFLINE - [[AliasType:{DescID: 105}, ABSENT], PUBLIC] -> OFFLINE + [[EnumType:{DescID: 104}, ABSENT], PUBLIC] -> TXN_DROPPED + [[AliasType:{DescID: 105}, ABSENT], PUBLIC] -> TXN_DROPPED ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 104 - Reason: DROP TYPE defaultdb.public.typ - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 - Reason: DROP TYPE defaultdb.public.typ PreCommitPhase stage 1 of 1 with 3 MutationType ops transitions: ops: @@ -45,7 +43,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops [[UserPrivileges:{DescID: 104, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[EnumType:{DescID: 104}, ABSENT], OFFLINE] -> DROPPED + [[EnumType:{DescID: 104}, ABSENT], TXN_DROPPED] -> DROPPED [[EnumTypeValue:{DescID: 104, Name: a}, ABSENT], PUBLIC] -> ABSENT [[ObjectParent:{DescID: 104, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 105, Name: _typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -53,7 +51,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: public}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[AliasType:{DescID: 105}, ABSENT], OFFLINE] -> DROPPED + [[AliasType:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT ops: *scop.MarkDescriptorAsDropped diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_view b/pkg/sql/schemachanger/scplan/testdata/drop_view index 97afffea117a..c7e09fa3877a 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_view +++ b/pkg/sql/schemachanger/scplan/testdata/drop_view @@ -8,14 +8,13 @@ DROP VIEW defaultdb.v1 ---- StatementPhase stage 1 of 1 with 1 MutationType op transitions: - [[View:{DescID: 105}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 105}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 - Reason: DROP VIEW defaultdb.public.v1 PreCommitPhase stage 1 of 1 with 3 MutationType ops transitions: ops: @@ -44,7 +43,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 105}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -269,47 +268,42 @@ DROP VIEW defaultdb.v1 CASCADE ---- StatementPhase stage 1 of 1 with 5 MutationType ops transitions: - [[View:{DescID: 105}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 105}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 105, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 106}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 106}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 106, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 106, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 107}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 107}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 107, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 108}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 108}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 108, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY - [[View:{DescID: 111}, ABSENT], PUBLIC] -> OFFLINE + [[View:{DescID: 111}, ABSENT], PUBLIC] -> TXN_DROPPED [[Column:{DescID: 111, ColumnID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], PUBLIC] -> WRITE_ONLY [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], PUBLIC] -> WRITE_ONLY ops: - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 - Reason: DROP VIEW defaultdb.public.v1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 106 - Reason: DROP VIEW defaultdb.public.v1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 107 - Reason: DROP VIEW defaultdb.public.v1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 108 - Reason: DROP VIEW defaultdb.public.v1 CASCADE - *scop.MarkDescriptorAsOffline + *scop.MarkDescriptorAsSyntheticallyDropped DescID: 111 - Reason: DROP VIEW defaultdb.public.v1 CASCADE PreCommitPhase stage 1 of 1 with 9 MutationType ops transitions: ops: @@ -363,7 +357,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 105}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -378,7 +372,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 106}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 106, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -396,7 +390,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 107}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -414,7 +408,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 108}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -432,7 +426,7 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[Owner:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT - [[View:{DescID: 111}, ABSENT], OFFLINE] -> DROPPED + [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default b/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default index 23008963a9de..79d79e65665a 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default @@ -88,14 +88,6 @@ upsert descriptor #106 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 106 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... create job #1 (non-cancelable: false): "ALTER TABLE db.public.tbl ADD COLUMN j INT8" descriptor IDs: [106] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_primary_key_drop_rowid index 483336cfc9b5..9ab24a581906 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_primary_key_drop_rowid @@ -172,14 +172,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 104 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t ADD PRIMARY KEY (a)" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid index ef6cdd91e324..87ce6615d109 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid @@ -173,14 +173,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 104 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (a)" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla index 9469001dc0ac..33a07ebb60aa 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla @@ -161,14 +161,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 104 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - direction: ADD ... create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (j)" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/create_index b/pkg/sql/schemachanger/testdata/end_to_end/create_index index ae0db3615211..119cab7b57c9 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/create_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/create_index @@ -103,14 +103,6 @@ upsert descriptor #106 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 106 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - direction: ADD ... create job #1 (non-cancelable: false): "CREATE INDEX idx1 ON defaultdb.public.t (v) WHERE (v = 'a')" descriptor IDs: [106] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic index cf02310cb1bb..f26866b0f1a2 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic @@ -141,14 +141,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 104 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t DROP COLUMN j" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_computed_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_computed_index index ba35e3a5ea13..5543f85fa582 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_computed_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_computed_index @@ -205,14 +205,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - id: 104 - indexes: [] - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t DROP COLUMN j CASCADE" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_create_index_separate_statements b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_create_index_separate_statements index cfebb182bbb9..226d4943210b 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_create_index_separate_statements +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_create_index_separate_statements @@ -229,14 +229,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - id: 104 - indexes: [] - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t DROP COLUMN j CASCADE; CREATE UNIQUE INDEX idx ON defaultdb.public.t (k)" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_unique_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_unique_index index ea7362adabfd..7ca5f308c4ca 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_unique_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_unique_index @@ -157,14 +157,6 @@ upsert descriptor #106 + targets: families: - columnIds: - ... - unique: true - version: 3 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... create job #1 (non-cancelable: false): "ALTER TABLE t.public.test DROP COLUMN pi" descriptor IDs: [106] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_with_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_with_index index 2e38c5f8eb25..cf400561388a 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_with_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_with_index @@ -180,14 +180,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - id: 104 - indexes: [] - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - direction: DROP ... create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t DROP COLUMN j" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index index 3760324ff410..59352ecd305f 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index @@ -144,14 +144,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - id: 104 - indexes: [] - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - direction: DROP ... create job #1 (non-cancelable: true): "DROP INDEX defaultdb.public.t@idx CASCADE" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index index 68200427f69d..ad519d079dc0 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index @@ -120,14 +120,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - id: 104 - indexes: [] - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - direction: DROP ... create job #1 (non-cancelable: true): "DROP INDEX defaultdb.public.t@idx CASCADE" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_vanilla_index index c071255dc968..387561e41160 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_vanilla_index @@ -91,14 +91,6 @@ upsert descriptor #104 + targets: families: - columnIds: - ... - id: 104 - indexes: [] - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - direction: DROP ... create job #1 (non-cancelable: true): "DROP INDEX defaultdb.public.t@idx CASCADE" descriptor IDs: [104] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_multiple_columns_separate_statements b/pkg/sql/schemachanger/testdata/end_to_end/drop_multiple_columns_separate_statements index 33f0b462d6aa..a9dc620595b2 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_multiple_columns_separate_statements +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_multiple_columns_separate_statements @@ -227,13 +227,6 @@ upsert descriptor #104 + - crdb_internal_column_3_name_placeholder name: primary formatVersion: 3 - id: 104 - indexes: [] - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... keyColumnNames: - crdb_internal_column_4_name_placeholder diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_schema b/pkg/sql/schemachanger/testdata/end_to_end/drop_schema index 5532e0c56d75..98d3b59b56f0 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_schema +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_schema @@ -16,22 +16,12 @@ checking for feature: DROP SCHEMA increment telemetry for sql.schema.drop_schema increment telemetry for sql.uds.drop_schema ## StatementPhase stage 1 of 1 with 1 MutationType op -upsert descriptor #106 - schema: - id: 106 - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: sc - + offlineReason: DROP SCHEMA db.sc - parentId: 104 - privileges: +add synthetic descriptor #106: ... withGrantOption: 2 version: 2 - - version: "1" - + state: OFFLINE - + version: "2" + + state: DROP + version: "1" # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 3 MutationType ops @@ -67,12 +57,16 @@ upsert descriptor #106 + targetRanks: + targets: id: 106 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" + - modificationTime: + - wallTime: "1640995200000000000" + + modificationTime: {} name: sc - offlineReason: DROP SCHEMA db.sc + parentId: 104 ... + withGrantOption: 2 + version: 2 + - version: "1" + + version: "2" create job #1 (non-cancelable: true): "DROP SCHEMA db.sc" descriptor IDs: [104 106] # end PreCommitPhase @@ -108,13 +102,10 @@ upsert descriptor #106 - wallTime: "1640995200000000001" + modificationTime: {} name: sc - - offlineReason: DROP SCHEMA db.sc parentId: 104 - privileges: ... withGrantOption: 2 version: 2 - - state: OFFLINE - version: "2" + state: DROP + version: "3" diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_table b/pkg/sql/schemachanger/testdata/end_to_end/drop_table index e41968334a22..93bec19cb381 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_table +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_table @@ -20,28 +20,13 @@ begin transaction #1 checking for feature: DROP TABLE increment telemetry for sql.schema.drop_table ## StatementPhase stage 1 of 1 with 1 MutationType op -upsert descriptor #107 - ... - formatVersion: 3 - id: 107 - - modificationTime: - - wallTime: "1640995200000000000" - + modificationTime: {} - name: t - nextColumnId: 4 - ... - nextIndexId: 2 - nextMutationId: 1 - + offlineReason: DROP TABLE db.sc.t - parentId: 104 - primaryIndex: +add synthetic descriptor #107: ... replacementOf: time: {} - + state: OFFLINE + + state: DROP unexposedParentSchemaId: 106 - - version: "1" - + version: "2" + version: "1" # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -66,12 +51,16 @@ upsert descriptor #107 ... formatVersion: 3 id: 107 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" + - modificationTime: + - wallTime: "1640995200000000000" + + modificationTime: {} name: t nextColumnId: 4 ... + time: {} + unexposedParentSchemaId: 106 + - version: "1" + + version: "2" create job #1 (non-cancelable: true): "DROP TABLE db.sc.t" descriptor IDs: [107] # end PreCommitPhase @@ -98,16 +87,9 @@ upsert descriptor #107 + modificationTime: {} name: t nextColumnId: 4 - ... - nextIndexId: 2 - nextMutationId: 1 - - offlineReason: DROP TABLE db.sc.t - parentId: 104 - primaryIndex: ... replacementOf: time: {} - - state: OFFLINE + state: DROP unexposedParentSchemaId: 106 - version: "2" diff --git a/pkg/sql/schemachanger/testdata/explain/drop_schema b/pkg/sql/schemachanger/testdata/explain/drop_schema index 9f2f3d43b082..404caa5c17de 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_schema +++ b/pkg/sql/schemachanger/testdata/explain/drop_schema @@ -9,9 +9,9 @@ Schema change plan for DROP SCHEMA ‹db›.‹sc›; ├── StatementPhase │ └── Stage 1 of 1 in StatementPhase │ ├── 1 element transitioning toward ABSENT - │ │ └── PUBLIC → OFFLINE Schema:{DescID: 106} + │ │ └── PUBLIC → TXN_DROPPED Schema:{DescID: 106} │ └── 1 Mutation operation - │ └── MarkDescriptorAsOffline {"DescID":106,"Reason":"DROP SCHEMA db.s..."} + │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":106} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase │ └── 3 Mutation operations @@ -21,12 +21,12 @@ Schema change plan for DROP SCHEMA ‹db›.‹sc›; └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 6 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: sc, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} - │ │ ├── OFFLINE → DROPPED Schema:{DescID: 106} - │ │ └── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: sc, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Schema:{DescID: 106} + │ │ └── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} │ └── 6 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":106} │ ├── RemoveSchemaParent {"Parent":{"ParentDatabaseID":104,"SchemaID":106}} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_table b/pkg/sql/schemachanger/testdata/explain/drop_table index 4e89110a60b9..c1b031146840 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_table +++ b/pkg/sql/schemachanger/testdata/explain/drop_table @@ -11,15 +11,15 @@ Schema change plan for DROP TABLE ‹db›.‹sc›.‹t›; ├── StatementPhase │ └── Stage 1 of 1 in StatementPhase │ ├── 7 elements transitioning toward ABSENT - │ │ ├── PUBLIC → OFFLINE Table:{DescID: 107} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 1} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 2} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 3} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967295} - │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967294} - │ │ └── PUBLIC → VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → TXN_DROPPED Table:{DescID: 107} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 1} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 2} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 3} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967295} + │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967294} + │ │ └── PUBLIC → VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} │ └── 1 Mutation operation - │ └── MarkDescriptorAsOffline {"DescID":107,"Reason":"DROP TABLE db.sc..."} + │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":107} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase │ └── 2 Mutation operations @@ -28,34 +28,34 @@ Schema change plan for DROP TABLE ‹db›.‹sc›.‹t›; └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 28 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} - │ │ ├── OFFLINE → DROPPED Table:{DescID: 107} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: k, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: v, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 107, ColumnID: 3} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} - │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 107} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: k, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: v, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 107, ColumnID: 3} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} │ └── 6 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":107} │ ├── RemoveAllTableComments {"TableID":107} diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema b/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema index e29c61ae482b..57b7ddf922c7 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema @@ -14,13 +14,12 @@ EXPLAIN (ddl, verbose) DROP SCHEMA db.sc; │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • Schema:{DescID: 106} -│ │ PUBLIC → OFFLINE +│ │ PUBLIC → TXN_DROPPED │ │ │ └── • 1 Mutation operation │ │ -│ └── • MarkDescriptorAsOffline +│ └── • MarkDescriptorAsSyntheticallyDropped │ DescID: 106 -│ Reason: DROP SCHEMA db.sc │ ├── • PreCommitPhase │ │ @@ -90,7 +89,7 @@ EXPLAIN (ddl, verbose) DROP SCHEMA db.sc; │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Schema:{DescID: 106} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ └── • SchemaParent:{DescID: 106, ReferencedDescID: 104} │ │ │ PUBLIC → ABSENT diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_table b/pkg/sql/schemachanger/testdata/explain_verbose/drop_table index 9e8e6d5b1379..4a8ef60f7d6a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_table +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_table @@ -16,7 +16,7 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ ├── • 7 elements transitioning toward ABSENT │ │ │ │ │ ├── • Table:{DescID: 107} -│ │ │ PUBLIC → OFFLINE +│ │ │ PUBLIC → TXN_DROPPED │ │ │ │ │ ├── • Column:{DescID: 107, ColumnID: 1} │ │ │ │ PUBLIC → WRITE_ONLY @@ -56,9 +56,8 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • 1 Mutation operation │ │ -│ └── • MarkDescriptorAsOffline +│ └── • MarkDescriptorAsSyntheticallyDropped │ DescID: 107 -│ Reason: DROP TABLE db.sc.t │ ├── • PreCommitPhase │ │ @@ -123,7 +122,7 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Table:{DescID: 107} - │ │ │ OFFLINE → DROPPED + │ │ │ TXN_DROPPED → DROPPED │ │ │ │ │ ├── • ObjectParent:{DescID: 107, ReferencedDescID: 106} │ │ │ │ PUBLIC → ABSENT From 3e568bc73145fa8f182830442ac4572db5db6044 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Tue, 23 Aug 2022 22:09:43 -0400 Subject: [PATCH 4/8] sql/schemachanger/scplan/internal/scstage: accept non-revertible in PreCommit We can schedule non-revertible operations into PreCommit so long as the next stage is PostCommitNonRevertible. Release justification: part of bug fix Release note: None --- .../scplan/internal/scstage/build.go | 2 +- .../schemachanger/scplan/testdata/drop_index | 38 +++---- .../scplan/testdata/drop_owned_by | 22 ++-- .../end_to_end/drop_index_hash_sharded_index | 30 ++--- .../explain/drop_index_hash_sharded_index | 23 ++-- .../drop_index_partial_expression_index | 7 +- .../testdata/explain/drop_index_vanilla_index | 7 +- .../drop_index_hash_sharded_index | 106 +++++++++--------- .../drop_index_partial_expression_index | 46 ++++---- .../explain_verbose/drop_index_vanilla_index | 40 +++---- 10 files changed, 165 insertions(+), 156 deletions(-) diff --git a/pkg/sql/schemachanger/scplan/internal/scstage/build.go b/pkg/sql/schemachanger/scplan/internal/scstage/build.go index d0dcfadee63e..1654280240fe 100644 --- a/pkg/sql/schemachanger/scplan/internal/scstage/build.go +++ b/pkg/sql/schemachanger/scplan/internal/scstage/build.go @@ -338,7 +338,7 @@ func (sb stageBuilder) isOutgoingOpEdgeAllowed(e *scgraph.OpEdge) bool { // We can't act on the knowledge that nothing remaining can fail while in // StatementPhase because we don't know about what future targets may // show up which could fail. - (sb.bs.phase < scop.PostCommitPhase || sb.anyRemainingOpsCanFail) { + (sb.bs.phase < scop.PreCommitPhase || sb.anyRemainingOpsCanFail) { return false } return true diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_index b/pkg/sql/schemachanger/scplan/testdata/drop_index index 76c5ae02e759..17778bb954dd 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_index +++ b/pkg/sql/schemachanger/scplan/testdata/drop_index @@ -29,6 +29,8 @@ StatementPhase stage 1 of 1 with 2 MutationType ops TableID: 104 PreCommitPhase stage 1 of 1 with 2 MutationType ops transitions: + [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT + [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -47,8 +49,6 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops statementtag: DROP INDEX PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops transitions: - [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT - [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY ops: *scop.MakeDroppedIndexDeleteOnly @@ -163,6 +163,8 @@ StatementPhase stage 1 of 1 with 5 MutationType ops TableID: 104 PreCommitPhase stage 1 of 1 with 2 MutationType ops transitions: + [[IndexColumn:{DescID: 104, ColumnID: 4, IndexID: 4}, ABSENT], PUBLIC] -> ABSENT + [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4}, ABSENT], PUBLIC] -> ABSENT ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -182,8 +184,6 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 4}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[IndexColumn:{DescID: 104, ColumnID: 4, IndexID: 4}, ABSENT], PUBLIC] -> ABSENT - [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY ops: *scop.MakeDroppedColumnDeleteOnly @@ -356,9 +356,19 @@ StatementPhase stage 1 of 1 with 5 MutationType ops ColumnID: 5 Name: crdb_internal_column_5_name_placeholder TableID: 104 -PreCommitPhase stage 1 of 1 with 2 MutationType ops +PreCommitPhase stage 1 of 1 with 4 MutationType ops transitions: + [[IndexColumn:{DescID: 104, ColumnID: 5, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT + [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT + [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT + [[CheckConstraint:{DescID: 104, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT + [[ConstraintName:{DescID: 104, Name: check_crdb_internal_i_shard_16, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT ops: + *scop.NotImplemented + ElementType: scpb.ConstraintName + *scop.RemoveCheckConstraint + ConstraintID: 2 + TableID: 104 *scop.SetJobStateOnDescriptor DescriptorID: 104 Initialize: true @@ -369,32 +379,22 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops - 104 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 2 MutationType ops pending Statements: - statement: DROP INDEX idx3 CASCADE redactedstatement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx3› CASCADE statementtag: DROP INDEX -PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 5}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[IndexColumn:{DescID: 104, ColumnID: 5, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT - [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT - [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY - [[CheckConstraint:{DescID: 104, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT - [[ConstraintName:{DescID: 104, Name: check_crdb_internal_i_shard_16, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT ops: *scop.MakeDroppedColumnDeleteOnly ColumnID: 5 TableID: 104 - *scop.NotImplemented - ElementType: scpb.ConstraintName *scop.MakeDroppedIndexDeleteOnly IndexID: 6 TableID: 104 - *scop.RemoveCheckConstraint - ConstraintID: 2 - TableID: 104 *scop.SetJobStateOnDescriptor DescriptorID: 104 *scop.UpdateSchemaChangerJob @@ -548,6 +548,8 @@ StatementPhase stage 1 of 1 with 3 MutationType ops DescID: 105 PreCommitPhase stage 1 of 1 with 3 MutationType ops transitions: + [[IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT + [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -570,8 +572,6 @@ PreCommitPhase stage 1 of 1 with 3 MutationType ops statementtag: DROP INDEX PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops transitions: - [[IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT - [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], VALIDATED] -> DELETE_ONLY [[Namespace:{DescID: 105, Name: v, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by index c2030cf173ff..140ba6628825 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by +++ b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by @@ -66,9 +66,17 @@ StatementPhase stage 1 of 1 with 9 MutationType ops DescID: 112 *scop.MarkDescriptorAsSyntheticallyDropped DescID: 113 -PreCommitPhase stage 1 of 1 with 12 MutationType ops +PreCommitPhase stage 1 of 1 with 14 MutationType ops transitions: + [[UserPrivileges:{DescID: 100, Name: r}, ABSENT], PUBLIC] -> ABSENT + [[UserPrivileges:{DescID: 104, Name: r}, ABSENT], PUBLIC] -> ABSENT ops: + *scop.RemoveUserPrivileges + DescID: 100 + User: r + *scop.RemoveUserPrivileges + DescID: 104 + User: r *scop.SetJobStateOnDescriptor DescriptorID: 100 Initialize: true @@ -119,22 +127,20 @@ PreCommitPhase stage 1 of 1 with 12 MutationType ops - 113 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 34 MutationType ops + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops pending Statements: - statement: DROP OWNED BY r redactedstatement: DROP OWNED BY r statementtag: DROP OWNED BY -PostCommitNonRevertiblePhase stage 1 of 2 with 46 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops transitions: - [[UserPrivileges:{DescID: 100, Name: r}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 105, Name: s, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Schema:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 105, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT - [[UserPrivileges:{DescID: 104, Name: r}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: sq, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT @@ -252,18 +258,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 46 MutationType ops [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: - *scop.RemoveUserPrivileges - DescID: 100 - User: r *scop.MarkDescriptorAsDropped DescID: 105 *scop.RemoveSchemaParent Parent: ParentDatabaseID: 100 SchemaID: 105 - *scop.RemoveUserPrivileges - DescID: 104 - User: r *scop.MarkDescriptorAsDropped DescID: 106 *scop.RemoveAllTableComments diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index index 59352ecd305f..389bc04a8604 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index @@ -125,8 +125,21 @@ upsert descriptor #104 + version: "9" # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 2 MutationType ops +## PreCommitPhase stage 1 of 1 with 4 MutationType ops upsert descriptor #104 + table: + - checks: + - - columnIds: + - - 3 + - constraintId: 2 + - expr: crdb_internal_column_3_name_placeholder IN (0:::INT8, 1:::INT8, 2:::INT8, + - 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8, 8:::INT8, 9:::INT8, 10:::INT8, + - 11:::INT8, 12:::INT8, 13:::INT8, 14:::INT8, 15:::INT8) + - hidden: true + - name: check_crdb_internal_j_shard_16 + + checks: [] + columns: + - id: 1 ... createAsOfTime: wallTime: "1640995200000000000" @@ -154,21 +167,8 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops upsert descriptor #104 - table: - - checks: - - - columnIds: - - - 3 - - constraintId: 2 - - expr: crdb_internal_column_3_name_placeholder IN (0:::INT8, 1:::INT8, 2:::INT8, - - 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8, 8:::INT8, 9:::INT8, 10:::INT8, - - 11:::INT8, 12:::INT8, 13:::INT8, 14:::INT8, 15:::INT8) - - hidden: true - - name: check_crdb_internal_j_shard_16 - + checks: [] - columns: - - id: 1 ... id: 104 indexes: [] diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index index b7218dab87b8..587fdcddcab0 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index @@ -21,24 +21,25 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ └── 2 Mutation operations + │ ├── 5 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ │ ├── PUBLIC → ABSENT CheckConstraint:{DescID: 104, ConstraintID: 2} + │ │ └── PUBLIC → ABSENT ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} + │ └── 4 Mutation operations + │ ├── NotImplemented {"ElementType":"scpb.ConstraintN..."} + │ ├── RemoveCheckConstraint {"ConstraintID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 7 elements transitioning toward ABSENT + │ ├── 2 elements transitioning toward ABSENT │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ ├── PUBLIC → ABSENT CheckConstraint:{DescID: 104, ConstraintID: 2} - │ │ └── PUBLIC → ABSENT ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} - │ └── 6 Mutation operations + │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ └── 4 Mutation operations │ ├── MakeDroppedColumnDeleteOnly {"ColumnID":3,"TableID":104} - │ ├── NotImplemented {"ElementType":"scpb.ConstraintN..."} │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} - │ ├── RemoveCheckConstraint {"ConstraintID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 2 of 2 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index index 24d270085a1c..273fc76aa079 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index @@ -21,15 +21,16 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase + │ ├── 2 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} + │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ └── 2 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 4 elements transitioning toward ABSENT + │ ├── 2 elements transitioning toward ABSENT │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 4 Mutation operations │ ├── MakeDroppedColumnDeleteOnly {"ColumnID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index index b7da08ae6ea6..640f983ed79e 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index @@ -16,14 +16,15 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase + │ ├── 2 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} + │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ └── 2 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 3 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ ├── 1 element transitioning toward ABSENT │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 3 Mutation operations │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index index cfcb983e035c..49f875fc4cd3 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index @@ -75,7 +75,55 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ └── • 2 Mutation operations +│ ├── • 5 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • CheckConstraint:{DescID: 104, ConstraintID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from ABSENT ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} +│ │ │ rule: "constraint dependent absent right before constraint" +│ │ │ +│ │ └── • ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} +│ │ PUBLIC → ABSENT +│ │ +│ └── • 4 Mutation operations +│ │ +│ ├── • NotImplemented +│ │ ElementType: scpb.ConstraintName +│ │ +│ ├── • RemoveCheckConstraint +│ │ ConstraintID: 2 +│ │ TableID: 104 │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 @@ -88,7 +136,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ - 104 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 2 MutationType ops pending │ Statements: │ - statement: DROP INDEX idx CASCADE │ redactedstatement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE @@ -98,70 +146,24 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase │ │ - │ ├── • 7 elements transitioning toward ABSENT + │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ - │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ VALIDATED → DELETE_ONLY - │ │ │ - │ │ ├── • CheckConstraint:{DescID: 104, ConstraintID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from ABSENT ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} - │ │ │ rule: "constraint dependent absent right before constraint" - │ │ │ - │ │ └── • ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} - │ │ PUBLIC → ABSENT + │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ VALIDATED → DELETE_ONLY │ │ - │ └── • 6 Mutation operations + │ └── • 4 Mutation operations │ │ │ ├── • MakeDroppedColumnDeleteOnly │ │ ColumnID: 3 │ │ TableID: 104 │ │ - │ ├── • NotImplemented - │ │ ElementType: scpb.ConstraintName - │ │ │ ├── • MakeDroppedIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 │ │ - │ ├── • RemoveCheckConstraint - │ │ ConstraintID: 2 - │ │ TableID: 104 - │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index index f97757bb4e55..c232f5597256 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index @@ -75,6 +75,29 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ +│ ├── • 2 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} +│ │ │ PUBLIC → ABSENT +│ │ │ +│ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "index no longer public before dependents" +│ │ │ +│ │ └── • skip PUBLIC → ABSENT operations +│ │ rule: "skip index-column removal ops on index removal" +│ │ │ └── • 2 Mutation operations │ │ │ ├── • SetJobStateOnDescriptor @@ -98,32 +121,11 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase │ │ - │ ├── • 4 elements transitioning toward ABSENT + │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ - │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ VALIDATED → DELETE_ONLY │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index index 67d267509c3d..a946ec2e7c0c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index @@ -37,6 +37,26 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ +│ ├── • 2 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} +│ │ │ PUBLIC → ABSENT +│ │ │ +│ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "index no longer public before dependents" +│ │ │ +│ │ └── • skip PUBLIC → ABSENT operations +│ │ rule: "skip index-column removal ops on index removal" +│ │ │ └── • 2 Mutation operations │ │ │ ├── • SetJobStateOnDescriptor @@ -60,25 +80,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase │ │ - │ ├── • 3 elements transitioning toward ABSENT - │ │ │ - │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index-column removal ops on index removal" + │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ VALIDATED → DELETE_ONLY From cd4959ec3e5c3c7d913607f6c3aeb6f481ffd313 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Tue, 23 Aug 2022 22:15:24 -0400 Subject: [PATCH 5/8] sql/schemachanger/scplan/internal/scstage: implicitly satisfy no-op edges Release note: None --- .../drop_database_multiregion_primary_region | 107 +++++++++--------- .../testdata/explain/drop_table_multiregion | 55 ++++----- .../drop_table_multiregion_primary_region | 43 +++---- .../drop_database_multiregion_primary_region | 58 +++++----- .../explain_verbose/drop_table_multiregion | 70 ++++++------ .../drop_table_multiregion_primary_region | 58 +++++----- .../scplan/internal/scstage/build.go | 2 +- .../scplan/testdata/drop_database | 64 +++++------ .../schemachanger/scplan/testdata/drop_index | 24 ++-- .../scplan/testdata/drop_owned_by | 38 +++---- .../schemachanger/scplan/testdata/drop_schema | 52 ++++----- .../schemachanger/scplan/testdata/drop_table | 40 +++---- .../schemachanger/scplan/testdata/drop_view | 46 ++++---- .../explain/drop_index_hash_sharded_index | 15 +-- .../drop_index_partial_expression_index | 9 +- .../testdata/explain/drop_index_vanilla_index | 9 +- .../schemachanger/testdata/explain/drop_table | 59 +++++----- .../drop_index_hash_sharded_index | 7 +- .../drop_index_partial_expression_index | 23 ++-- .../explain_verbose/drop_index_vanilla_index | 23 ++-- .../testdata/explain_verbose/drop_table | 82 +++++++------- 21 files changed, 456 insertions(+), 428 deletions(-) diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region index 92bbc2d28595..5ae8dddd4e37 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region @@ -28,6 +28,11 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE; │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase + │ ├── 4 elements transitioning toward ABSENT + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} │ └── 6 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":105,"Initialize":true} @@ -37,59 +42,55 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE; │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 52 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 104} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Database:{DescID: 104} - │ │ ├── PUBLIC → ABSENT DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} - │ │ ├── PUBLIC → ABSENT DatabaseRegionConfig:{DescID: 104, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: public, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Schema:{DescID: 106} - │ │ ├── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 105, Name: crdb_internal_region, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 105} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: root} - │ │ ├── TXN_DROPPED → DROPPED EnumType:{DescID: 105} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east1} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east2} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east3} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 105, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: _crdb_internal_region, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} - │ │ ├── TXN_DROPPED → DROPPED AliasType:{DescID: 107} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} + │ ├── 48 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 104} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Database:{DescID: 104} + │ │ ├── PUBLIC → ABSENT DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} + │ │ ├── PUBLIC → ABSENT DatabaseRegionConfig:{DescID: 104, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: public, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Schema:{DescID: 106} + │ │ ├── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 105, Name: crdb_internal_region, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 105} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: root} + │ │ ├── TXN_DROPPED → DROPPED EnumType:{DescID: 105} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east1} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east2} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east3} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 105, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: _crdb_internal_region, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} + │ │ ├── TXN_DROPPED → DROPPED AliasType:{DescID: 107} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} │ └── 20 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":104} │ ├── RemoveDatabaseRoleSettings {"DatabaseID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion index 4fe14de4e023..fee6ad5a05d7 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion @@ -21,6 +21,12 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase + │ ├── 5 elements transitioning toward ABSENT + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 2} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} │ └── 4 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":105,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":107,"Initialize":true} @@ -28,33 +34,28 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 26 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalityRegionalByRow:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: k, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 108, ColumnID: 2} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ ├── PUBLIC → ABSENT IndexPartitioning:{DescID: 108, IndexID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_row_pkey, IndexID: 1} + │ ├── 21 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalityRegionalByRow:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: k, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 108, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexPartitioning:{DescID: 108, IndexID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_row_pkey, IndexID: 1} │ └── 11 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":108} │ ├── RemoveAllTableComments {"TableID":108} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region index 369a03a7ffbe..777fe5abafbc 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region @@ -20,33 +20,34 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase + │ ├── 4 elements transitioning toward ABSENT + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} │ └── 3 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":105,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":108,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 20 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} + │ ├── 16 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} │ └── 7 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":108} │ ├── RemoveAllTableComments {"TableID":108} diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region index 7aa126612805..742cc0645485 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region @@ -75,6 +75,35 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ +│ ├── • 4 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 1} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ └── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ VALIDATED → DELETE_ONLY +│ │ │ +│ │ ├── • skip VALIDATED → WRITE_ONLY operations +│ │ │ rule: "skip index removal ops on relation drop" +│ │ │ +│ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ rule: "skip index removal ops on relation drop" +│ │ │ └── • 6 Mutation operations │ │ │ ├── • SetJobStateOnDescriptor @@ -119,7 +148,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase │ │ - │ ├── • 52 elements transitioning toward ABSENT + │ ├── • 48 elements transitioning toward ABSENT │ │ │ │ │ ├── • Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} │ │ │ │ PUBLIC → ABSENT @@ -445,12 +474,6 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 1} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: a, ColumnID: 1} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -472,12 +495,6 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -499,12 +516,6 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -542,15 +553,6 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ rule: "skip index dependents removal ops on relation drop" │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ - │ │ ├── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ │ VALIDATED → DELETE_ONLY - │ │ │ │ - │ │ │ ├── • skip VALIDATED → WRITE_ONLY operations - │ │ │ │ rule: "skip index removal ops on relation drop" - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip index removal ops on relation drop" - │ │ │ │ │ └── • IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} │ │ │ PUBLIC → ABSENT │ │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion index e583c718f24a..67e911605293 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion @@ -57,6 +57,41 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ +│ ├── • 5 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 1} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 2} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ └── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ VALIDATED → DELETE_ONLY +│ │ │ +│ │ ├── • skip VALIDATED → WRITE_ONLY operations +│ │ │ rule: "skip index removal ops on relation drop" +│ │ │ +│ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ rule: "skip index removal ops on relation drop" +│ │ │ └── • 4 Mutation operations │ │ │ ├── • SetJobStateOnDescriptor @@ -90,7 +125,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase │ │ - │ ├── • 26 elements transitioning toward ABSENT + │ ├── • 21 elements transitioning toward ABSENT │ │ │ │ │ ├── • Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} │ │ │ │ PUBLIC → ABSENT @@ -149,12 +184,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 1} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: k, ColumnID: 1} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -176,12 +205,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 2} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -215,12 +238,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -242,12 +259,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -301,15 +312,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ rule: "skip index dependents removal ops on relation drop" │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ - │ │ ├── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ │ VALIDATED → DELETE_ONLY - │ │ │ │ - │ │ │ ├── • skip VALIDATED → WRITE_ONLY operations - │ │ │ │ rule: "skip index removal ops on relation drop" - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip index removal ops on relation drop" - │ │ │ │ │ ├── • IndexPartitioning:{DescID: 108, IndexID: 1} │ │ │ │ PUBLIC → ABSENT │ │ │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region index ce9a70f51316..bed484f218e5 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region @@ -51,6 +51,35 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ +│ ├── • 4 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 1} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ └── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ VALIDATED → DELETE_ONLY +│ │ │ +│ │ ├── • skip VALIDATED → WRITE_ONLY operations +│ │ │ rule: "skip index removal ops on relation drop" +│ │ │ +│ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ rule: "skip index removal ops on relation drop" +│ │ │ └── • 3 Mutation operations │ │ │ ├── • SetJobStateOnDescriptor @@ -80,7 +109,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase │ │ - │ ├── • 20 elements transitioning toward ABSENT + │ ├── • 16 elements transitioning toward ABSENT │ │ │ │ │ ├── • Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} │ │ │ │ PUBLIC → ABSENT @@ -139,12 +168,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 1} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: a, ColumnID: 1} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -166,12 +189,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -193,12 +210,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -236,15 +247,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ rule: "skip index dependents removal ops on relation drop" │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ - │ │ ├── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ │ VALIDATED → DELETE_ONLY - │ │ │ │ - │ │ │ ├── • skip VALIDATED → WRITE_ONLY operations - │ │ │ │ rule: "skip index removal ops on relation drop" - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip index removal ops on relation drop" - │ │ │ │ │ └── • IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} │ │ │ PUBLIC → ABSENT │ │ │ diff --git a/pkg/sql/schemachanger/scplan/internal/scstage/build.go b/pkg/sql/schemachanger/scplan/internal/scstage/build.go index 1654280240fe..603e45864078 100644 --- a/pkg/sql/schemachanger/scplan/internal/scstage/build.go +++ b/pkg/sql/schemachanger/scplan/internal/scstage/build.go @@ -322,7 +322,7 @@ func (sb stageBuilder) isOutgoingOpEdgeAllowed(e *scgraph.OpEdge) bool { if e.Type() != sb.opType { return false } - if !e.IsPhaseSatisfied(sb.bs.phase) { + if !e.IsPhaseSatisfied(sb.bs.phase) && !sb.bc.g.IsNoOp(e) { return false } // We allow non-revertible ops to be included at stages preceding diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_database b/pkg/sql/schemachanger/scplan/testdata/drop_database index 577448625eb9..a385e3be5a78 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_database +++ b/pkg/sql/schemachanger/scplan/testdata/drop_database @@ -98,6 +98,38 @@ StatementPhase stage 1 of 1 with 14 MutationType ops DescID: 117 PreCommitPhase stage 1 of 1 with 15 MutationType ops transitions: + [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 110, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 112, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 112, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 112, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 112, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 114, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 117, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 117, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 117, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 117, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 117, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -204,26 +236,20 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[Table:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 110, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 110, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 110, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 110, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 110, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 110, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: sq1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT @@ -239,26 +265,20 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[ObjectParent:{DescID: 109, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 109, Comment: t1 is good}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 109, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: v1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT @@ -266,13 +286,10 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 112, Name: v2, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -281,16 +298,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 112, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 112}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 112, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 112, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 112, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 112, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 112, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 113, Name: v3, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -299,16 +312,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 114, Name: v4, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -317,16 +326,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 114, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 114}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 114, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 115, Name: typ, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -350,19 +355,14 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 117, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 117}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 117, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 117, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 117, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 117, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 117, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 117, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_index b/pkg/sql/schemachanger/scplan/testdata/drop_index index 17778bb954dd..11c864115043 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_index +++ b/pkg/sql/schemachanger/scplan/testdata/drop_index @@ -31,6 +31,7 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT + [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> WRITE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -49,7 +50,7 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops statementtag: DROP INDEX PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops transitions: - [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.MakeDroppedIndexDeleteOnly IndexID: 2 @@ -165,6 +166,7 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 4, IndexID: 4}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4}, ABSENT], PUBLIC] -> ABSENT + [[SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT], VALIDATED] -> WRITE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -184,7 +186,7 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 4}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.MakeDroppedColumnDeleteOnly ColumnID: 4 @@ -361,6 +363,7 @@ PreCommitPhase stage 1 of 1 with 4 MutationType ops [[IndexColumn:{DescID: 104, ColumnID: 5, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT + [[SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT], VALIDATED] -> WRITE_ONLY [[CheckConstraint:{DescID: 104, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 104, Name: check_crdb_internal_i_shard_16, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT ops: @@ -387,7 +390,7 @@ PreCommitPhase stage 1 of 1 with 4 MutationType ops PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 5}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.MakeDroppedColumnDeleteOnly ColumnID: 5 @@ -550,6 +553,10 @@ PreCommitPhase stage 1 of 1 with 3 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT + [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], VALIDATED] -> WRITE_ONLY + [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -572,23 +579,23 @@ PreCommitPhase stage 1 of 1 with 3 MutationType ops statementtag: DROP INDEX PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops transitions: - [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], VALIDATED] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[Namespace:{DescID: 105, Name: v, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: count, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: + *scop.MakeDroppedIndexDeleteOnly + IndexID: 8 + TableID: 104 *scop.MarkDescriptorAsDropped DescID: 105 *scop.RemoveViewBackReferencesInRelations @@ -597,9 +604,6 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops - 104 *scop.RemoveAllTableComments TableID: 105 - *scop.MakeDroppedIndexDeleteOnly - IndexID: 8 - TableID: 104 *scop.DrainDescriptorName Namespace: DatabaseID: 100 diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by index 140ba6628825..a5dd383c4d00 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by +++ b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by @@ -70,6 +70,25 @@ PreCommitPhase stage 1 of 1 with 14 MutationType ops transitions: [[UserPrivileges:{DescID: 100, Name: r}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 104, Name: r}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.RemoveUserPrivileges DescID: 100 @@ -154,26 +173,20 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops [[Table:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 109, Name: t_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: sq, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT @@ -188,26 +201,20 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops [[Table:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 108, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 108, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 108, Name: t_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 110, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT @@ -215,13 +222,10 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -245,16 +249,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_schema b/pkg/sql/schemachanger/scplan/testdata/drop_schema index aad178fe5553..6be069c88e36 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_schema +++ b/pkg/sql/schemachanger/scplan/testdata/drop_schema @@ -1136,6 +1136,32 @@ StatementPhase stage 1 of 1 with 10 MutationType ops DescID: 113 PreCommitPhase stage 1 of 1 with 12 MutationType ops transitions: + [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 106, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 106, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY + [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 100 @@ -1216,26 +1242,20 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[ObjectParent:{DescID: 106, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 106, Comment: t1 is good table}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 106, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 106, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 106, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT @@ -1243,13 +1263,10 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: v2, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1258,16 +1275,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 109, Name: v3, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1276,16 +1289,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 110, Name: v4, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1294,16 +1303,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1327,19 +1332,14 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_table b/pkg/sql/schemachanger/scplan/testdata/drop_table index 5757c0648f26..63dbf97c38af 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_table +++ b/pkg/sql/schemachanger/scplan/testdata/drop_table @@ -56,6 +56,19 @@ StatementPhase stage 1 of 1 with 3 MutationType ops DescID: 111 PreCommitPhase stage 1 of 1 with 9 MutationType ops transitions: + [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 5}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -111,29 +124,22 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops [[ObjectParent:{DescID: 109, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 109, Comment: shipment is important}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tracking_number, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnComment:{DescID: 109, ColumnID: 1, Comment: tracking_number is a must}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: carrier, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[SequenceOwner:{DescID: 109, ColumnID: 2, ReferencedDescID: 110}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: status, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: customer_id, ColumnID: 4}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 5}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: randcol, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -141,14 +147,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops [[IndexColumn:{DescID: 109, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 4, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 5, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 109, Name: shipments_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexComment:{DescID: 109, IndexID: 1, Comment: pkey is good}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 4, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndexPartial:{DescID: 109, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT - [[SecondaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 109, Name: partialidx, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[ForeignKeyConstraint:{DescID: 109, ConstraintID: 2, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 109, Name: fk_customers, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT @@ -167,16 +171,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: customer_id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: carrier, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: @@ -1224,6 +1224,13 @@ StatementPhase stage 1 of 1 with 1 MutationType op DescID: 114 PreCommitPhase stage 1 of 1 with 4 MutationType ops transitions: + [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 114, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 114, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 114, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 114, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 112 @@ -1258,32 +1265,25 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 16 MutationType ops [[Table:{DescID: 114}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 114, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 114, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: x, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: y, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: rowid, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 114, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 114, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 114, Name: greeter_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 2, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndexPartial:{DescID: 114, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT - [[SecondaryIndex:{DescID: 114, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 114, Name: i, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[CheckConstraint:{DescID: 114, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 114, Name: check, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_view b/pkg/sql/schemachanger/scplan/testdata/drop_view index c7e09fa3877a..82f7c80ca990 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_view +++ b/pkg/sql/schemachanger/scplan/testdata/drop_view @@ -17,6 +17,9 @@ StatementPhase stage 1 of 1 with 1 MutationType op DescID: 105 PreCommitPhase stage 1 of 1 with 3 MutationType ops transitions: + [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -45,13 +48,10 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: @@ -306,6 +306,26 @@ StatementPhase stage 1 of 1 with 5 MutationType ops DescID: 111 PreCommitPhase stage 1 of 1 with 9 MutationType ops transitions: + [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 106, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 107, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -359,13 +379,10 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: v2, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -374,16 +391,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 106, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: v3, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -392,16 +405,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 107, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: v4, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -410,16 +419,12 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: v5, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -428,19 +433,14 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index index 587fdcddcab0..f35aa859788b 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index @@ -21,12 +21,13 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 5 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ ├── PUBLIC → ABSENT CheckConstraint:{DescID: 104, ConstraintID: 2} - │ │ └── PUBLIC → ABSENT ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} + │ ├── 6 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ │ ├── VALIDATED → WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ ├── PUBLIC → ABSENT CheckConstraint:{DescID: 104, ConstraintID: 2} + │ │ └── PUBLIC → ABSENT ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} │ └── 4 Mutation operations │ ├── NotImplemented {"ElementType":"scpb.ConstraintN..."} │ ├── RemoveCheckConstraint {"ConstraintID":2,"TableID":104} @@ -36,7 +37,7 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward ABSENT │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 3} - │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ └── WRITE_ONLY → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 4 Mutation operations │ ├── MakeDroppedColumnDeleteOnly {"ColumnID":3,"TableID":104} │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index index 273fc76aa079..d3863e8a0e6d 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index @@ -21,9 +21,10 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 2 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} - │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ ├── 3 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ │ └── VALIDATED → WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 2 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} @@ -31,7 +32,7 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward ABSENT │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 3} - │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ └── WRITE_ONLY → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 4 Mutation operations │ ├── MakeDroppedColumnDeleteOnly {"ColumnID":3,"TableID":104} │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index index 640f983ed79e..fe18baaccadc 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index @@ -16,16 +16,17 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 2 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ ├── 3 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ │ └── VALIDATED → WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 2 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 1 element transitioning toward ABSENT - │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ └── WRITE_ONLY → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 3 Mutation operations │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_table b/pkg/sql/schemachanger/testdata/explain/drop_table index c1b031146840..18003513fb3a 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_table +++ b/pkg/sql/schemachanger/testdata/explain/drop_table @@ -22,40 +22,41 @@ Schema change plan for DROP TABLE ‹db›.‹sc›.‹t›; │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":107} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase + │ ├── 6 elements transitioning toward ABSENT + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 2} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 3} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967294} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} │ └── 2 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":107,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 28 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 107} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: k, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: v, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 107, ColumnID: 3} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} - │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} + │ ├── 22 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 107} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: k, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: v, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 107, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} │ └── 6 Mutation operations │ ├── MarkDescriptorAsDropped {"DescID":107} │ ├── RemoveAllTableComments {"TableID":107} diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index index 49f875fc4cd3..bf0fc06cfada 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index @@ -75,7 +75,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 5 elements transitioning toward ABSENT +│ ├── • 6 elements transitioning toward ABSENT │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -107,6 +107,9 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ +│ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ VALIDATED → WRITE_ONLY +│ │ │ │ │ ├── • CheckConstraint:{DescID: 104, ConstraintID: 2} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -152,7 +155,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ VALIDATED → DELETE_ONLY + │ │ WRITE_ONLY → DELETE_ONLY │ │ │ └── • 4 Mutation operations │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index index c232f5597256..31b70c26506e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index @@ -75,7 +75,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 2 elements transitioning toward ABSENT +│ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -89,14 +89,17 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ -│ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} -│ │ │ PUBLIC → ABSENT -│ │ │ -│ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ rule: "index no longer public before dependents" -│ │ │ -│ │ └── • skip PUBLIC → ABSENT operations -│ │ rule: "skip index-column removal ops on index removal" +│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ VALIDATED → WRITE_ONLY │ │ │ └── • 2 Mutation operations │ │ @@ -127,7 +130,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ VALIDATED → DELETE_ONLY + │ │ WRITE_ONLY → DELETE_ONLY │ │ │ └── • 4 Mutation operations │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index index a946ec2e7c0c..7299c57eda4b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index @@ -37,7 +37,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 2 elements transitioning toward ABSENT +│ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -48,14 +48,17 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ -│ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} -│ │ │ PUBLIC → ABSENT -│ │ │ -│ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ rule: "index no longer public before dependents" -│ │ │ -│ │ └── • skip PUBLIC → ABSENT operations -│ │ rule: "skip index-column removal ops on index removal" +│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ VALIDATED → WRITE_ONLY │ │ │ └── • 2 Mutation operations │ │ @@ -83,7 +86,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ VALIDATED → DELETE_ONLY + │ │ WRITE_ONLY → DELETE_ONLY │ │ │ └── • 3 Mutation operations │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_table b/pkg/sql/schemachanger/testdata/explain_verbose/drop_table index 4a8ef60f7d6a..21850811081b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_table +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_table @@ -63,6 +63,47 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ +│ ├── • 6 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Column:{DescID: 107, ColumnID: 1} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 107, ColumnID: 2} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 107, ColumnID: 3} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 107, ColumnID: 4294967295} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ ├── • Column:{DescID: 107, ColumnID: 4294967294} +│ │ │ │ WRITE_ONLY → DELETE_ONLY +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip column removal ops on relation drop" +│ │ │ +│ │ └── • PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} +│ │ │ VALIDATED → DELETE_ONLY +│ │ │ +│ │ ├── • skip VALIDATED → WRITE_ONLY operations +│ │ │ rule: "skip index removal ops on relation drop" +│ │ │ +│ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ rule: "skip index removal ops on relation drop" +│ │ │ └── • 2 Mutation operations │ │ │ ├── • SetJobStateOnDescriptor @@ -86,7 +127,7 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase │ │ - │ ├── • 28 elements transitioning toward ABSENT + │ ├── • 22 elements transitioning toward ABSENT │ │ │ │ │ ├── • Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} │ │ │ │ PUBLIC → ABSENT @@ -139,12 +180,6 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ - │ │ ├── • Column:{DescID: 107, ColumnID: 1} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 107, Name: k, ColumnID: 1} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -166,12 +201,6 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 1} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 107, ColumnID: 2} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 107, Name: v, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -193,12 +222,6 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 2} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 107, ColumnID: 3} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -232,12 +255,6 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 107, ColumnID: 4294967295} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -259,12 +276,6 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967295} │ │ │ rule: "column no longer public before dependents" │ │ │ - │ │ ├── • Column:{DescID: 107, ColumnID: 4294967294} - │ │ │ │ WRITE_ONLY → DELETE_ONLY - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip column removal ops on relation drop" - │ │ │ │ │ ├── • ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -334,15 +345,6 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ rule: "skip index dependents removal ops on relation drop" │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ - │ │ ├── • PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} - │ │ │ │ VALIDATED → DELETE_ONLY - │ │ │ │ - │ │ │ ├── • skip VALIDATED → WRITE_ONLY operations - │ │ │ │ rule: "skip index removal ops on relation drop" - │ │ │ │ - │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations - │ │ │ rule: "skip index removal ops on relation drop" - │ │ │ │ │ └── • IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} │ │ │ PUBLIC → ABSENT │ │ │ From 24800a8fc8832e6ba0a6d7512021fab1816173b2 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Tue, 23 Aug 2022 23:37:51 -0400 Subject: [PATCH 6/8] sql/schemachanger/rel: internally store rules with random vars This is just to avoid bugs later. Release justification: cleanup Release note: None --- pkg/sql/schemachanger/rel/BUILD.bazel | 1 + pkg/sql/schemachanger/rel/query_build.go | 2 +- .../schemachanger/rel/query_lang_clauses.go | 29 ++++----- pkg/sql/schemachanger/rel/query_lang_yaml.go | 4 +- pkg/sql/schemachanger/rel/schema_rules.go | 61 ++++++++++++++----- .../scplan/internal/rules/rules_test.go | 4 +- 6 files changed, 67 insertions(+), 34 deletions(-) diff --git a/pkg/sql/schemachanger/rel/BUILD.bazel b/pkg/sql/schemachanger/rel/BUILD.bazel index 7509341f4009..7c7b803dbc39 100644 --- a/pkg/sql/schemachanger/rel/BUILD.bazel +++ b/pkg/sql/schemachanger/rel/BUILD.bazel @@ -37,6 +37,7 @@ go_library( "//pkg/util", "//pkg/util/iterutil", "//pkg/util/syncutil", + "//pkg/util/uuid", "@com_github_cockroachdb_errors//:errors", "@com_github_google_btree//:btree", "@in_gopkg_yaml_v2//:yaml_v2", diff --git a/pkg/sql/schemachanger/rel/query_build.go b/pkg/sql/schemachanger/rel/query_build.go index c975f5d5542d..8797cee85305 100644 --- a/pkg/sql/schemachanger/rel/query_build.go +++ b/pkg/sql/schemachanger/rel/query_build.go @@ -49,7 +49,7 @@ func newQuery(sc *Schema, clauses Clauses) *Query { } // Order the facts for unification. The ordering is first by variable - // variable and then by attribute. + // and then by attribute. // // TODO(ajwerner): For disjunctions using Any, the code currently uses // the index to constrain the search for each value in the "first" diff --git a/pkg/sql/schemachanger/rel/query_lang_clauses.go b/pkg/sql/schemachanger/rel/query_lang_clauses.go index 1afd92ceebb9..91bf5570eb26 100644 --- a/pkg/sql/schemachanger/rel/query_lang_clauses.go +++ b/pkg/sql/schemachanger/rel/query_lang_clauses.go @@ -18,6 +18,19 @@ import ( // Clauses exists to handle flattening of a slice of clauses before marshaling. type Clauses []Clause +func replaceVars(replacements, before []Var, cl Clause) Clause { + maybeReplace := func(in Var) (_ Var, replaced bool) { + for i, v := range before { + if in == v && replacements[i] != v { + return replacements[i], true + } + } + return in, false + } + replaced, _ := walkVars(cl, maybeReplace) + return replaced +} + func expanded(c Clauses) Clauses { needsExpansion := func() bool { for _, cl := range c { @@ -32,18 +45,6 @@ func expanded(c Clauses) Clauses { if !needsExpansion() { return c } - replaceVars := func(replacements, before []Var, cl Clause) Clause { - maybeReplace := func(in Var) (_ Var, replaced bool) { - for i, v := range before { - if in == v && replacements[i] != v { - return replacements[i], true - } - } - return in, false - } - replaced, _ := walkVars(cl, maybeReplace) - return replaced - } var ret Clauses for _, cl := range c { @@ -51,8 +52,8 @@ func expanded(c Clauses) Clauses { case and: ret = append(ret, expanded(Clauses(cl))...) case ruleInvocation: - for _, clause := range expanded(cl.rule.Clauses) { - ret = append(ret, replaceVars(cl.args, cl.rule.Params, clause)) + for _, clause := range expanded(cl.rule.clauses) { + ret = append(ret, replaceVars(cl.args, cl.rule.paramVars, clause)) } default: ret = append(ret, cl) diff --git a/pkg/sql/schemachanger/rel/query_lang_yaml.go b/pkg/sql/schemachanger/rel/query_lang_yaml.go index 7c1f4b547fc8..4876784d143d 100644 --- a/pkg/sql/schemachanger/rel/query_lang_yaml.go +++ b/pkg/sql/schemachanger/rel/query_lang_yaml.go @@ -82,13 +82,13 @@ func ruleInvocationStr(name string, args []Var) string { // MarshalYAML marshals a rule to YAML. func (r RuleDef) MarshalYAML() (interface{}, error) { var cl yaml.Node - if err := cl.Encode(r.Clauses); err != nil { + if err := cl.Encode(r.Clauses()); err != nil { return nil, err } return &yaml.Node{ Kind: yaml.MappingNode, Content: []*yaml.Node{ - {Kind: yaml.ScalarNode, Value: ruleInvocationStr(r.Name, r.Params)}, + {Kind: yaml.ScalarNode, Value: ruleInvocationStr(r.Name, r.Params())}, &cl, }, }, nil diff --git a/pkg/sql/schemachanger/rel/schema_rules.go b/pkg/sql/schemachanger/rel/schema_rules.go index 6d6076cb7dff..00296ebd75b5 100644 --- a/pkg/sql/schemachanger/rel/schema_rules.go +++ b/pkg/sql/schemachanger/rel/schema_rules.go @@ -11,22 +11,35 @@ package rel import ( + "encoding/hex" "reflect" "sort" + "github.com/cockroachdb/cockroach/pkg/util/uuid" "github.com/cockroachdb/errors" ) // RuleDef describes a rule. type RuleDef struct { - Name string - Params []Var - Clauses Clauses - Func interface{} `yaml:"-"` + Name string + paramVars []Var + paramNames []Var + clauses Clauses + Func interface{} `yaml:"-"` sc *Schema } +// Params returns the names of the variables in the query. +func (rd *RuleDef) Params() []Var { + return rd.paramNames +} + +// Clauses returns the clauses in the query prepared for display. +func (rd *RuleDef) Clauses() Clauses { + return Clauses(replaceVars(rd.paramNames, rd.paramVars, and(rd.clauses)).(and)) +} + // ForEachRule iterates the schema's rules. func (sc *Schema) ForEachRule(f func(def RuleDef)) { for _, r := range sc.rules { @@ -87,19 +100,29 @@ var ( clausesType = reflect.TypeOf((*Clauses)(nil)).Elem() ) +func makeRandomVars(n int) (ret []Var) { + ret = make([]Var, n) + for i := range ret { + ret[i] = Var(hex.EncodeToString(uuid.MakeV4().GetBytes())) + } + return ret +} + // rule is used to define a pattern of clauses for reuse. -func (sc *Schema) rule(name string, inFunc interface{}, vars ...Var) interface{} { +func (sc *Schema) rule(name string, inFunc interface{}, paramNames ...Var) interface{} { if _, exists := sc.rulesByName[name]; exists { panic(errors.AssertionFailedf("already registered rule with name %s", name)) } - inT, clauses := buildRuleClauses(vars, inFunc) + paramVars := makeRandomVars(len(paramNames)) + inT, clauses := buildRuleClauses(paramVars, inFunc) clauses = flattened(clauses) - validateRuleClauses(name, clauses, vars) + validateRuleClauses(name, clauses, paramVars, paramNames) rd := &RuleDef{ - Name: name, - Params: vars, - Clauses: clauses, - sc: sc, + Name: name, + paramNames: paramNames, + paramVars: paramVars, + clauses: clauses, + sc: sc, } rd.Func = makeRuleFunc(inT, rd) sc.rules = append(sc.rules, rd) @@ -144,16 +167,24 @@ func validateBuildRuleFunctionValue(inT []reflect.Type, f interface{}) reflect.V return fv } -func validateRuleClauses(name string, clauses Clauses, vars []Var) { +func validateRuleClauses(name string, clauses Clauses, paramVars, paramNames []Var) { vs := varsUsedInClauses(clauses) - if missing := vs.removed(vars...); len(missing) != 0 { + if missing := vs.removed(paramVars...); len(missing) != 0 { panic(errors.Errorf( "invalid rule %s: %v are not defined variables", name, missing.ordered(), )) } - if unused := makeVarSet(vars...).removed(vs.ordered()...); len(unused) > 0 { + if unused := makeVarSet(paramVars...).removed(vs.ordered()...); len(unused) > 0 { + mapping := make(map[Var]int, len(paramVars)) + for i, v := range paramVars { + mapping[v] = i + } + mapped := make(varSet, len(unused)) + for v := range unused { + mapped.add(paramNames[mapping[v]]) + } panic(errors.Errorf( - "invalid rule %s: %v input variable are not used", name, unused.ordered(), + "invalid rule %s: %v input variable are not used", name, mapped.ordered(), )) } } diff --git a/pkg/sql/schemachanger/scplan/internal/rules/rules_test.go b/pkg/sql/schemachanger/scplan/internal/rules/rules_test.go index 0db97270b313..2635acc9c610 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/rules_test.go +++ b/pkg/sql/schemachanger/scplan/internal/rules/rules_test.go @@ -41,13 +41,13 @@ func TestRulesYAML(t *testing.T) { }) for _, def := range s { var clauses yaml.Node - if err := clauses.Encode(def.Clauses); err != nil { + if err := clauses.Encode(def.Clauses()); err != nil { panic(err) } m.Content = append(m.Content, &yaml.Node{ Kind: yaml.ScalarNode, Value: fmt.Sprintf( - "%s(%v)", def.Name, strings.Join(toStrings(def.Params), ", "), + "%s(%v)", def.Name, strings.Join(toStrings(def.Params()), ", "), ), }, &clauses) } From 217cfffcc0c06bd1a72169c50428d316c2ff6146 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Wed, 24 Aug 2022 09:32:32 -0400 Subject: [PATCH 7/8] sql/schemachanger/rel: support not-join subqueries This patch endows rel with the ability to define not-join rules which allow extra variables to be introduced inside the clauses. When a not-join rule is invoked, it leads to the outer query finding a contradiction if the rule fully unifies. Fixes #77148 Release justification: part of a broader bug-fix Release note: None --- pkg/sql/schemachanger/rel/doc.go | 2 - .../rel/internal/entitynodetest/tests.go | 166 +++++++++++++++--- pkg/sql/schemachanger/rel/query.go | 12 ++ pkg/sql/schemachanger/rel/query_build.go | 95 +++++++++- pkg/sql/schemachanger/rel/query_data.go | 2 +- pkg/sql/schemachanger/rel/query_eval.go | 82 ++++++++- .../schemachanger/rel/query_lang_clauses.go | 12 +- pkg/sql/schemachanger/rel/query_lang_yaml.go | 12 +- pkg/sql/schemachanger/rel/schema_rules.go | 56 ++++-- pkg/sql/schemachanger/rel/testdata/entitynode | 117 +++++++++--- 10 files changed, 471 insertions(+), 85 deletions(-) diff --git a/pkg/sql/schemachanger/rel/doc.go b/pkg/sql/schemachanger/rel/doc.go index 816775873966..6149de57887c 100644 --- a/pkg/sql/schemachanger/rel/doc.go +++ b/pkg/sql/schemachanger/rel/doc.go @@ -182,8 +182,6 @@ // - If we wanted to make recursion more sane, it'd be better to plan a // query with some input parameters and then be able to invoke it on those // parameters. In that way, we could imagine invoking a query recursively. -// * Not-join or unset constraints. -// - It may be useful to express that some fact is definitely not true. // * More generalized disjunction. // // TODO(ajwerner): Note that arrays of bytes can probably be used as slice but diff --git a/pkg/sql/schemachanger/rel/internal/entitynodetest/tests.go b/pkg/sql/schemachanger/rel/internal/entitynodetest/tests.go index d9d615c2706b..ff03799f10dc 100644 --- a/pkg/sql/schemachanger/rel/internal/entitynodetest/tests.go +++ b/pkg/sql/schemachanger/rel/internal/entitynodetest/tests.go @@ -37,6 +37,45 @@ var ( nb = r.Register("nb", &node{Value: b, Left: na}).(*node) nc = r.Register("nc", &node{Value: c, Right: nb}).(*node) + entityHasi16 = schema.Def3("entityHasI16Eq", "node", "entity", "i16", func( + node, entity, i16v rel.Var, + ) rel.Clauses { + return rel.Clauses{ + node.AttrEqVar(value, entity), + entity.AttrEqVar(i16, i16v), + } + }) + entityNoti16 = schema.DefNotJoin2("nodeWithValuei16NotEq", "node", "i16", func( + node, i16v rel.Var, + ) rel.Clauses { + return rel.Clauses{entityHasi16(node, "entity", i16v)} + }) + joinParentLeft = schema.Def2("joinParentLeft", "parent", "child", func( + parent, child rel.Var, + ) rel.Clauses { + return rel.Clauses{parent.AttrEqVar(left, child)} + }) + joinParentRight = schema.Def2("joinParentRight", "parent", "child", func( + parent, child rel.Var, + ) rel.Clauses { + return rel.Clauses{parent.AttrEqVar(right, child)} + }) + notExistsLeft = schema.DefNotJoin1("leftNotExists", "node", func( + node rel.Var, + ) rel.Clauses { + return rel.Clauses{joinParentLeft("parent", node)} + }) + notExistsRight = schema.DefNotJoin1("rightNotExists", "node", func( + node rel.Var, + ) rel.Clauses { + return rel.Clauses{joinParentRight("parent", node)} + }) + hasNoChildren = schema.Def1("hasNoChildren", "node", func(node rel.Var) rel.Clauses { + return rel.Clauses{ + notExistsLeft(node), + notExistsRight(node), + } + }) nodeEntity = schema.Def2("nodeEntity", "node", "entity", func( node, entity rel.Var, ) rel.Clauses { @@ -130,6 +169,21 @@ var ( { // 6 {Attrs: []rel.Attr{rel.Self}, Exists: []rel.Attr{rel.Self}}, }, + { // 7 + { + Where: []rel.IndexWhere{ + {Attr: rel.Type, Eq: reflect.TypeOf((*node)(nil))}, + }, + }, + { + Attrs: []rel.Attr{left}, + Exists: []rel.Attr{left}, + }, + { + Attrs: []rel.Attr{right}, + Exists: []rel.Attr{right}, + }, + }, }, QueryCases: []reltest.QueryTest{ { @@ -145,7 +199,7 @@ var ( Results: [][]interface{}{ {a, int8(1), int8(1)}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, }, { Name: "a-c-b join", @@ -161,7 +215,7 @@ var ( Results: [][]interface{}{ {a, b, c}, }, - UnsatisfiableIndexes: []int{2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{2, 3, 4, 5, 6, 7}, }, { Name: "nil values don't show up", @@ -173,7 +227,7 @@ var ( Results: [][]interface{}{ {a}, }, - UnsatisfiableIndexes: []int{2, 4, 5, 6}, + UnsatisfiableIndexes: []int{2, 4, 5, 6, 7}, }, { Name: "nil values don't show up, scalar pointers same as pointers", @@ -185,7 +239,7 @@ var ( Results: [][]interface{}{ {a}, }, - UnsatisfiableIndexes: []int{2, 4, 5, 6}, + UnsatisfiableIndexes: []int{2, 4, 5, 6, 7}, }, { Name: "list all the values", @@ -199,7 +253,7 @@ var ( {b, int8(2)}, {c, int8(2)}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "list all the values with type constraint", @@ -214,7 +268,7 @@ var ( {b, int8(2)}, {c, int8(2)}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, }, { Name: "nodes with elements where i8=2", @@ -229,7 +283,7 @@ var ( {nb, b}, {nc, c}, }, - UnsatisfiableIndexes: []int{2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{2, 3, 4, 5, 6, 7}, }, { Name: "nodes with elements where i8=2 (rule)", @@ -244,7 +298,7 @@ var ( {nb, b}, {nc, c}, }, - UnsatisfiableIndexes: []int{2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{2, 3, 4, 5, 6, 7}, }, { Name: "list all the i8 values", @@ -261,7 +315,7 @@ var ( {int8(2)}, {int8(2)}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, }, { Name: "use a filter", @@ -276,7 +330,7 @@ var ( Results: [][]interface{}{ {a}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "types of all the entities", @@ -293,7 +347,7 @@ var ( {nb, reflect.TypeOf((*node)(nil))}, {nc, reflect.TypeOf((*node)(nil))}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "nodes by type", @@ -351,7 +405,7 @@ var ( {nb}, {nc}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, }, { Name: "self eq value", @@ -363,7 +417,7 @@ var ( Results: [][]interface{}{ {c}, }, - UnsatisfiableIndexes: []int{1, 2, 3}, + UnsatisfiableIndexes: []int{}, // trivially unifies }, { Name: "contradiction due to missing attribute", @@ -374,7 +428,7 @@ var ( Entities: []v{"entity"}, ResVars: []v{"entity", "pi8"}, Results: [][]interface{}{}, - UnsatisfiableIndexes: []int{1, 2, 3}, + UnsatisfiableIndexes: []int{}, // trivially unifies }, { Name: "self eq self", @@ -386,7 +440,7 @@ var ( Results: [][]interface{}{ {a}, {b}, {c}, {na}, {nb}, {nc}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "variable type mismatch", @@ -412,7 +466,7 @@ var ( {na, a, na, a}, {na, a, nc, c}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "entity bound via variable with ne filter", @@ -432,7 +486,7 @@ var ( Results: [][]interface{}{ {na, a, nc, c}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "any value type mismatch", @@ -452,7 +506,7 @@ var ( Entities: []v{"e"}, ResVars: []v{"e", "i8"}, Results: [][]interface{}{}, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "pointer scalar values any", @@ -464,7 +518,7 @@ var ( Results: [][]interface{}{ {a}, {b}, {c}, }, - UnsatisfiableIndexes: []int{2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{2, 3, 4, 5, 6, 7}, }, { Name: "pointer scalar values", @@ -476,7 +530,7 @@ var ( Results: [][]interface{}{ {a}, }, - UnsatisfiableIndexes: []int{2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{2, 3, 4, 5, 6, 7}, }, { Name: "nil pointer scalar values any", @@ -500,7 +554,7 @@ var ( Entities: []v{"e"}, ResVars: []v{"e"}, Results: [][]interface{}{}, - UnsatisfiableIndexes: []int{2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{2, 3, 4, 5, 6, 7}, }, { Name: "any clause no match on variable eq", @@ -511,7 +565,7 @@ var ( Entities: []v{"e"}, ResVars: []v{"e", "i8"}, Results: [][]interface{}{}, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "using blank, bind all", @@ -523,7 +577,7 @@ var ( Results: [][]interface{}{ {a}, {b}, {c}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "using blank, bind non-nil pointer", @@ -535,7 +589,7 @@ var ( Results: [][]interface{}{ {a}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6, 7}, }, { Name: "e[i8] != 1", @@ -549,7 +603,7 @@ var ( {b}, {c}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, }, { Name: "e != a", @@ -563,7 +617,7 @@ var ( {b}, {c}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, }, { Name: "e[i8] = v; v != 1", @@ -578,7 +632,7 @@ var ( {b, int8(2)}, {c, int8(2)}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, }, { Name: "e[i8] = v; v != 2", @@ -592,7 +646,7 @@ var ( Results: [][]interface{}{ {a, int8(1)}, }, - UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, }, { // This case flexes the semantics of Neq to note that Neq forces @@ -610,6 +664,62 @@ var ( Entities: []rel.Var{"e"}, ResVars: []v{"e", "v"}, Results: [][]interface{}{}, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6, 7}, + }, + { + Name: "node which is neither the left or right of another node (not-join)", + Query: rel.Clauses{ + v("n").Type((*node)(nil)), + notExistsLeft("n"), + notExistsRight("n"), + }, + Entities: []rel.Var{"n"}, + ResVars: []v{"n"}, + Results: [][]interface{}{ + {nc}, + }, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + }, + { + Name: "node which is neither the left or right of another node (not-join), composed", + Query: rel.Clauses{ + v("n").Type((*node)(nil)), + hasNoChildren("n"), + }, + Entities: []rel.Var{"n"}, + ResVars: []v{"n"}, + Results: [][]interface{}{ + {nc}, + }, + UnsatisfiableIndexes: []int{1, 2, 3, 4, 5, 6}, + }, + { + Name: "node with entity with i16 not 1", + Query: rel.Clauses{ + v("n").Type((*node)(nil)), + v("i16").Eq(int16(1)), + entityNoti16("n", "i16"), + }, + Entities: []rel.Var{"n"}, + ResVars: []v{"n", "i16"}, + Results: [][]interface{}{ + {nb, int16(1)}, + }, + UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, + }, + { + Name: "node with entity with i16 not 2", + Query: rel.Clauses{ + v("n").Type((*node)(nil)), + v("i16").Eq(int16(2)), + entityNoti16("n", "i16"), + }, + Entities: []rel.Var{"n"}, + ResVars: []v{"n", "i16"}, + Results: [][]interface{}{ + {na, int16(2)}, + {nc, int16(2)}, + }, UnsatisfiableIndexes: []int{1, 2, 3, 5, 6}, }, }, diff --git a/pkg/sql/schemachanger/rel/query.go b/pkg/sql/schemachanger/rel/query.go index 8af5a1a896ed..ee4a7dcf53ec 100644 --- a/pkg/sql/schemachanger/rel/query.go +++ b/pkg/sql/schemachanger/rel/query.go @@ -36,6 +36,9 @@ type Query struct { facts []fact // filters are the set of predicate filters to evaluate. filters []filter + // notJoins are sub-queries which, if successfully unified, imply a + // contradiction in the outer query. + notJoins []subQuery // cache one evalContext for reuse to accelerate benchmarks and deal with // the common case. @@ -45,6 +48,15 @@ type Query struct { } } +// queryDepth is a depth in the join order of a query. +type queryDepth uint16 + +type subQuery struct { + query *Query + depth queryDepth + inputSlotMappings util.FastIntMap +} + // Result represents A setting of entities which fulfills the // constraints of its corresponding query. It is a rather low-level // interface. diff --git a/pkg/sql/schemachanger/rel/query_build.go b/pkg/sql/schemachanger/rel/query_build.go index 8797cee85305..02b8697879bf 100644 --- a/pkg/sql/schemachanger/rel/query_build.go +++ b/pkg/sql/schemachanger/rel/query_build.go @@ -31,6 +31,8 @@ type queryBuilder struct { // This might be badly named. What we really mean here is that the // slotIdx is a join target. slotIsEntity []bool + + notJoins []subQuery } // newQuery constructs a query. Errors are panicked and caught @@ -47,6 +49,13 @@ func newQuery(sc *Schema, clauses Clauses) *Query { for _, t := range expanded(clauses) { p.processClause(t) } + for _, s := range p.variableSlots { + p.facts = append(p.facts, fact{ + variable: s, + attr: sc.selfOrdinal, + value: s, + }) + } // Order the facts for unification. The ordering is first by variable // and then by attribute. @@ -58,12 +67,23 @@ func newQuery(sc *Schema, clauses Clauses) *Query { // However, we do need all the facts with the same variable and attribute // to be adjacent for the unification fixed point evaluation to work. entities := p.findEntitySlots() + p.setSubQueryDepths(entities) sort.SliceStable(p.facts, func(i, j int) bool { if p.facts[i].variable == p.facts[j].variable { return p.facts[i].attr < p.facts[j].attr } return p.facts[i].variable < p.facts[j].variable }) + + // Remove any redundant facts. + truncated := p.facts[:0] + for i, f := range p.facts { + if i == 0 || f != p.facts[i-1] { + truncated = append(truncated, f) + } + } + p.facts = truncated + // Ensure that the query does not already contain a contradiction as that // is almost definitely a bug. if contradictionFound, contradiction := unifyReturningContradiction( @@ -82,6 +102,7 @@ func newQuery(sc *Schema, clauses Clauses) *Query { facts: p.facts, slots: p.slots, filters: p.filters, + notJoins: p.notJoins, } } @@ -110,6 +131,12 @@ func (p *queryBuilder) processClause(t Clause) { p.processEqDecl(t) case filterDecl: p.processFilterDecl(t) + case ruleInvocation: + if !t.rule.isNotJoin { + panic(errors.AssertionFailedf("rule invocations which aren't not-joins" + + " should have been flattened away")) + } + p.processNotJoin(t) case and: panic(errors.AssertionFailedf("and clauses should be flattened away")) default: @@ -142,11 +169,6 @@ func (p *queryBuilder) processEqDecl(t eqDecl) { variable: varIdx, attr: p.sc.mustGetOrdinal(Self), value: valueIdx, - }, - fact{ - variable: varIdx, - attr: p.sc.mustGetOrdinal(Self), - value: varIdx, }) } @@ -282,6 +304,69 @@ func (p *queryBuilder) typeCheck(f fact) { } } +func (p *queryBuilder) processNotJoin(t ruleInvocation) { + // If we have a not-join, then we need to find the slots for the inputs, + // and we have to build the sub-query, which is a whole new query, and + // we have to then figure out its depth. At this point, we build the + // subquery and ensure that its inputs are bound variables. We'll + // populate the depth at which we'll execute the subquery later, after + // we've built the outer query. + var sub subQuery + // We want to ensure that the facts for the injected entities are joined + // first in the query evaluation. We do this by injecting facts to the + // front of the set of clauses. + var clauses Clauses + for i, v := range t.args { + src, ok := p.variableSlots[v] + if !ok { + panic(errors.Errorf("variable %q used to invoke not-join rule %s not bound", + v, t.rule.Name)) + } + if p.slotIsEntity[src] { + clauses = append(clauses, tripleDecl{ + entity: t.rule.paramVars[i], + attribute: Self, + value: t.rule.paramVars[i], + }) + } + } + clauses = append(clauses, t.rule.clauses...) + sub.query = newQuery(p.sc, clauses) + for i, v := range t.args { + src := p.variableSlots[v] + dst, ok := sub.query.variableSlots[t.rule.paramVars[i]] + if !ok { + panic(errors.AssertionFailedf("variable %q used in not-join rule %s not bound", + t.rule.paramNames[i], t.rule.Name)) + } + sub.inputSlotMappings.Set(int(src), int(dst)) + } + p.notJoins = append(p.notJoins, sub) +} + +func (p *queryBuilder) setSubQueryDepths(entitySlots []slotIdx) { + for i := range p.notJoins { + p.setSubqueryDepth(&p.notJoins[i], entitySlots) + } +} + +func (p *queryBuilder) setSubqueryDepth(s *subQuery, entitySlots []slotIdx) { + var max int + s.inputSlotMappings.ForEach(func(key, _ int) { + if p.slotIsEntity[key] && key > max { + max = key + } + }) + got := sort.Search(len(entitySlots), func(i int) bool { + return int(entitySlots[i]) >= max + }) + if got == len(entitySlots) { + panic(errors.AssertionFailedf("failed to find maximum entity in entitySlots: %v not in %v", + max, entitySlots)) + } + s.depth = queryDepth(got + 1) +} + var boolType = reflect.TypeOf((*bool)(nil)).Elem() func checkSlotType(s *slot, exp reflect.Type) { diff --git a/pkg/sql/schemachanger/rel/query_data.go b/pkg/sql/schemachanger/rel/query_data.go index de11fb6b6982..968cb0441bb8 100644 --- a/pkg/sql/schemachanger/rel/query_data.go +++ b/pkg/sql/schemachanger/rel/query_data.go @@ -16,7 +16,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/util" ) -type slotIdx int +type slotIdx uint16 type fact struct { variable slotIdx diff --git a/pkg/sql/schemachanger/rel/query_eval.go b/pkg/sql/schemachanger/rel/query_eval.go index bbf9f02b3394..51c92cb7597c 100644 --- a/pkg/sql/schemachanger/rel/query_eval.go +++ b/pkg/sql/schemachanger/rel/query_eval.go @@ -27,18 +27,17 @@ type evalContext struct { facts []fact // depth and cur relate to the join depth in the entities list. - depth, cur int - - // numIterateCalls is the number of calls to iterate which have occurred. + depth, cur queryDepth slots []slot filterSliceCaches map[int][]reflect.Value + curSubQuery int } func newEvalContext(q *Query) *evalContext { return &evalContext{ q: q, - depth: len(q.entities), + depth: queryDepth(len(q.entities)), slots: append(make([]slot, 0, len(q.slots)), q.slots...), facts: q.facts, } @@ -77,7 +76,14 @@ func (ec *evalContext) Iterate(db *Database, ri ResultIterator) error { // filters and pass along the result or that we need to go on and // join the next entity. func (ec *evalContext) iterateNext() error { - + nextSubQuery, done, err := ec.maybeVisitSubqueries() + if done || err != nil { + return err + } + if curSubQuery := ec.curSubQuery; nextSubQuery != curSubQuery { + defer func() { ec.curSubQuery = curSubQuery }() + ec.curSubQuery = nextSubQuery + } // We're at the bottom of the iteration, check if all conditions have // been satisfied, and then invoke the iterator. if ec.cur == ec.depth { @@ -383,3 +389,69 @@ func (ec *evalContext) getFilterInput(i int) (ins []reflect.Value) { } return c } + +func (ec *evalContext) maybeVisitSubqueries() (nextSubQuery int, done bool, error error) { + nextSubQuery = ec.curSubQuery + for nextSubQuery < len(ec.q.notJoins) && + ec.q.notJoins[nextSubQuery].depth <= ec.cur { + if done, err := ec.visitSubquery(nextSubQuery); done || err != nil { + return ec.curSubQuery, done, err + } + nextSubQuery++ + } + return nextSubQuery, false, nil +} + +func (ec *evalContext) visitSubquery(query int) (done bool, _ error) { + sub := ec.q.notJoins[query] + sec := sub.query.getEvalContext() + defer sub.query.putEvalContext(sec) + defer func() { // reset the slots populated to run the subquery + sub.inputSlotMappings.ForEach(func(_, subSlot int) { + sec.slots[subSlot].typedValue = typedValue{} + }) + }() + if err := ec.bindSubQuerySlots(sub.inputSlotMappings, sec); err != nil { + return false, err + } + err := sec.Iterate(ec.db, func(r Result) error { + return errResultSetNotEmpty + }) + switch { + case err == nil: + return false, nil + case errors.Is(err, errResultSetNotEmpty): + return true, nil + default: + return false, err + } +} + +func (ec *evalContext) bindSubQuerySlots(mapping util.FastIntMap, sec *evalContext) (err error) { + mapping.ForEach(func(src, dst int) { + if err != nil { + return + } + if ec.slots[src].empty() { + // TODO(ajwerner): Find a way to prove statically that this cannot + // happen and make it an assertion failure. + err = errors.Errorf( + "subquery invocation references unbound variable %q", + ec.findSlotVariable(src), + ) + } + sec.slots[dst].typedValue = ec.slots[src].typedValue + }) + return err +} + +func (ec *evalContext) findSlotVariable(src int) Var { + for v, slot := range ec.q.variableSlots { + if src == int(slot) { + return v + } + } + return "" +} + +var errResultSetNotEmpty = errors.New("result set not empty") diff --git a/pkg/sql/schemachanger/rel/query_lang_clauses.go b/pkg/sql/schemachanger/rel/query_lang_clauses.go index 91bf5570eb26..eaff78aa4fc6 100644 --- a/pkg/sql/schemachanger/rel/query_lang_clauses.go +++ b/pkg/sql/schemachanger/rel/query_lang_clauses.go @@ -34,9 +34,13 @@ func replaceVars(replacements, before []Var, cl Clause) Clause { func expanded(c Clauses) Clauses { needsExpansion := func() bool { for _, cl := range c { - switch cl.(type) { - case and, ruleInvocation: + switch cl := cl.(type) { + case and: return true + case ruleInvocation: + if !cl.rule.isNotJoin { + return true + } } } return false @@ -52,6 +56,10 @@ func expanded(c Clauses) Clauses { case and: ret = append(ret, expanded(Clauses(cl))...) case ruleInvocation: + if cl.rule.isNotJoin { + ret = append(ret, cl) + continue + } for _, clause := range expanded(cl.rule.clauses) { ret = append(ret, replaceVars(cl.args, cl.rule.paramVars, clause)) } diff --git a/pkg/sql/schemachanger/rel/query_lang_yaml.go b/pkg/sql/schemachanger/rel/query_lang_yaml.go index 4876784d143d..d8253b6a251c 100644 --- a/pkg/sql/schemachanger/rel/query_lang_yaml.go +++ b/pkg/sql/schemachanger/rel/query_lang_yaml.go @@ -85,11 +85,21 @@ func (r RuleDef) MarshalYAML() (interface{}, error) { if err := cl.Encode(r.Clauses()); err != nil { return nil, err } + content := &cl + if r.isNotJoin { + content = &yaml.Node{ + Kind: yaml.MappingNode, + Content: []*yaml.Node{ + {Kind: yaml.ScalarNode, Value: "not-join"}, + &cl, + }, + } + } return &yaml.Node{ Kind: yaml.MappingNode, Content: []*yaml.Node{ {Kind: yaml.ScalarNode, Value: ruleInvocationStr(r.Name, r.Params())}, - &cl, + content, }, }, nil } diff --git a/pkg/sql/schemachanger/rel/schema_rules.go b/pkg/sql/schemachanger/rel/schema_rules.go index 00296ebd75b5..0fb70a0764e8 100644 --- a/pkg/sql/schemachanger/rel/schema_rules.go +++ b/pkg/sql/schemachanger/rel/schema_rules.go @@ -22,6 +22,7 @@ import ( // RuleDef describes a rule. type RuleDef struct { Name string + isNotJoin bool paramVars []Var paramNames []Var clauses Clauses @@ -62,36 +63,53 @@ type ( Rule6 = func(a, b, c, d, e, f Var) Clause ) +type ruleKind bool + +const ( + regular ruleKind = true + notJoin ruleKind = false +) + // Def1 defines a Rule1. func (sc *Schema) Def1(name string, a Var, def func(a Var) Clauses) Rule1 { - return sc.rule(name, def, a).(Rule1) + return sc.rule(name, regular, def, a).(Rule1) +} + +// DefNotJoin1 defines a not-join rule with one bound variable argument. +func (sc *Schema) DefNotJoin1(name string, a Var, def func(a Var) Clauses) Rule1 { + return sc.rule(name, notJoin, def, a).(Rule1) +} + +// DefNotJoin2 defines a not-join rule with two bound variable arguments. +func (sc *Schema) DefNotJoin2(name string, a, b Var, def func(a, b Var) Clauses) Rule2 { + return sc.rule(name, notJoin, def, a, b).(Rule2) } // Def2 defines a Rule2. func (sc *Schema) Def2(name string, a, b Var, def func(a, b Var) Clauses) Rule2 { - return sc.rule(name, def, a, b).(Rule2) + return sc.rule(name, regular, def, a, b).(Rule2) } // Def3 defines a Rule3. func (sc *Schema) Def3(name string, a, b, c Var, def func(a, b, c Var) Clauses) Rule3 { - return sc.rule(name, def, a, b, c).(Rule3) + return sc.rule(name, regular, def, a, b, c).(Rule3) } // Def4 defines a Rule4. func (sc *Schema) Def4(name string, a, b, c, d Var, def func(a, b, c, d Var) Clauses) Rule4 { - return sc.rule(name, def, a, b, c, d).(Rule4) + return sc.rule(name, regular, def, a, b, c, d).(Rule4) } // Def5 defines a Rule5. func (sc *Schema) Def5(name string, a, b, c, d, e Var, def func(a, b, c, d, e Var) Clauses) Rule5 { - return sc.rule(name, def, a, b, c, d, e).(Rule5) + return sc.rule(name, regular, def, a, b, c, d, e).(Rule5) } // Def6 defines a Rule6. func (sc *Schema) Def6( name string, a, b, c, d, e, f Var, def func(a, b, c, d, e, f Var) Clauses, ) Rule6 { - return sc.rule(name, def, a, b, c, d, e, f).(Rule6) + return sc.rule(name, regular, def, a, b, c, d, e, f).(Rule6) } var ( @@ -109,16 +127,19 @@ func makeRandomVars(n int) (ret []Var) { } // rule is used to define a pattern of clauses for reuse. -func (sc *Schema) rule(name string, inFunc interface{}, paramNames ...Var) interface{} { +func (sc *Schema) rule( + name string, kind ruleKind, inFunc interface{}, paramNames ...Var, +) interface{} { if _, exists := sc.rulesByName[name]; exists { panic(errors.AssertionFailedf("already registered rule with name %s", name)) } paramVars := makeRandomVars(len(paramNames)) inT, clauses := buildRuleClauses(paramVars, inFunc) clauses = flattened(clauses) - validateRuleClauses(name, clauses, paramVars, paramNames) + validateRuleClauses(name, kind, clauses, paramVars, paramNames) rd := &RuleDef{ Name: name, + isNotJoin: kind == notJoin, paramNames: paramNames, paramVars: paramVars, clauses: clauses, @@ -167,13 +188,22 @@ func validateBuildRuleFunctionValue(inT []reflect.Type, f interface{}) reflect.V return fv } -func validateRuleClauses(name string, clauses Clauses, paramVars, paramNames []Var) { +func validateRuleClauses(name string, kind ruleKind, clauses Clauses, paramVars, paramNames []Var) { vs := varsUsedInClauses(clauses) - if missing := vs.removed(paramVars...); len(missing) != 0 { - panic(errors.Errorf( - "invalid rule %s: %v are not defined variables", name, missing.ordered(), - )) + { + missing := vs.removed(paramVars...) + if len(missing) != 0 && kind == regular { + panic(errors.Errorf( + "invalid rule %s: %v are not defined variables", name, missing.ordered(), + )) + } + if len(missing) == 0 && kind == notJoin { + panic(errors.Errorf( + "invalid not-join %s: no additional variables are defined: %v", name, vs, + )) + } } + if unused := makeVarSet(paramVars...).removed(vs.ordered()...); len(unused) > 0 { mapping := make(map[Var]int, len(paramVars)) for i, v := range paramVars { diff --git a/pkg/sql/schemachanger/rel/testdata/entitynode b/pkg/sql/schemachanger/rel/testdata/entitynode index 94afd8b0adb1..28d58ebb1e3d 100755 --- a/pkg/sql/schemachanger/rel/testdata/entitynode +++ b/pkg/sql/schemachanger/rel/testdata/entitynode @@ -14,6 +14,25 @@ attributes: nb: {left: na, value: b} nc: {right: nb, value: c} rules: + - entityHasI16Eq($node, $entity, $i16): + - $node[value] = $entity + - $entity[i16] = $i16 + - nodeWithValuei16NotEq($node, $i16): + not-join: + - entityHasI16Eq($node, $entity, $i16) + - joinParentLeft($parent, $child): + - $parent[left] = $child + - joinParentRight($parent, $child): + - $parent[right] = $child + - leftNotExists($node): + not-join: + - joinParentLeft($parent, $node) + - rightNotExists($node): + not-join: + - joinParentRight($parent, $node) + - hasNoChildren($node): + - leftNotExists($n) + - rightNotExists($n) - nodeEntity($node, $entity): - $node[value] = $entity - rightLeft($root, $right, $right-left, $v): @@ -49,6 +68,10 @@ queries: - {attrs: [Self]} 6: - {attrs: [Self], exists: [Self]} + 7: + - {attrs: [], where: {Type: '*entitynodetest.node'}} + - {attrs: [left], exists: [left]} + - {attrs: [right], exists: [right]} data: [a, b, c, na, nb, nc] queries: a fields: @@ -61,7 +84,7 @@ queries: result-vars: [$a, $ai8, $api8] results: - [a, 1, 1] - unsatisfiableIndexes: [1, 2, 3, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] a-c-b join: query: - $a[i8] = 1 @@ -73,7 +96,7 @@ queries: result-vars: [$a, $b, $c] results: - [a, b, c] - unsatisfiableIndexes: [2, 3, 4, 5, 6] + unsatisfiableIndexes: [2, 3, 4, 5, 6, 7] nil values don't show up: query: - $value[pi8] = 1 @@ -81,7 +104,7 @@ queries: result-vars: [$value] results: - [a] - unsatisfiableIndexes: [2, 4, 5, 6] + unsatisfiableIndexes: [2, 4, 5, 6, 7] nil values don't show up, scalar pointers same as pointers: query: - $value[pi8] = 1 @@ -89,7 +112,7 @@ queries: result-vars: [$value] results: - [a] - unsatisfiableIndexes: [2, 4, 5, 6] + unsatisfiableIndexes: [2, 4, 5, 6, 7] list all the values: query: - $value[i8] = $i8 @@ -99,7 +122,7 @@ queries: - [a, 1] - [b, 2] - [c, 2] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] list all the values with type constraint: query: - $value[i8] = $i8 @@ -110,7 +133,7 @@ queries: - [a, 1] - [b, 2] - [c, 2] - unsatisfiableIndexes: [1, 2, 3, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] nodes with elements where i8=2: query: - $i8 = 2 @@ -121,7 +144,7 @@ queries: results: - [nb, b] - [nc, c] - unsatisfiableIndexes: [2, 3, 4, 5, 6] + unsatisfiableIndexes: [2, 3, 4, 5, 6, 7] nodes with elements where i8=2 (rule): query: - $i8 = 2 @@ -132,7 +155,7 @@ queries: results: - [nb, b] - [nc, c] - unsatisfiableIndexes: [2, 3, 4, 5, 6] + unsatisfiableIndexes: [2, 3, 4, 5, 6, 7] list all the i8 values: query: - $value[i8] = $i8 @@ -143,7 +166,7 @@ queries: - [1] - [2] - [2] - unsatisfiableIndexes: [1, 2, 3, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] use a filter: query: - $value[Self] = $_ @@ -152,7 +175,7 @@ queries: result-vars: [$value] results: - [a] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] types of all the entities: query: - $value[Type] = $typ @@ -165,7 +188,7 @@ queries: - [na, '*entitynodetest.node'] - [nb, '*entitynodetest.node'] - [nc, '*entitynodetest.node'] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] nodes by type: query: - $na[Type] = '*entitynodetest.node' @@ -207,7 +230,7 @@ queries: - [na] - [nb] - [nc] - unsatisfiableIndexes: [1, 2, 3, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] self eq value: query: - '$entity[Self] = {i8: 2, pi8: null, i16: 1}' @@ -215,7 +238,6 @@ queries: result-vars: [$entity] results: - [c] - unsatisfiableIndexes: [1, 2, 3] contradiction due to missing attribute: query: - '$entity[Self] = {i8: 2, pi8: null, i16: 1}' @@ -223,7 +245,6 @@ queries: entities: [$entity] result-vars: [$entity, $pi8] results: [] - unsatisfiableIndexes: [1, 2, 3] self eq self: query: - $entity[Self] = $entity @@ -236,7 +257,7 @@ queries: - [na] - [nb] - [nc] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] variable type mismatch: query: - $entity[pi8] = 0 @@ -253,7 +274,7 @@ queries: results: - [na, a, na, a] - [na, a, nc, c] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] entity bound via variable with ne filter: query: - $n1[value] = $e1 @@ -266,7 +287,7 @@ queries: result-vars: [$n1, $e1, $n2, $e2] results: - [na, a, nc, c] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] any value type mismatch: query: - $value[i8] IN [1, 2, 1] @@ -278,7 +299,7 @@ queries: entities: [$e] result-vars: [$e, $i8] results: [] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] pointer scalar values any: query: - $e[i8] IN [1, 2] @@ -288,7 +309,7 @@ queries: - [a] - [b] - [c] - unsatisfiableIndexes: [2, 3, 4, 5, 6] + unsatisfiableIndexes: [2, 3, 4, 5, 6, 7] pointer scalar values: query: - $e[i8] = 1 @@ -296,7 +317,7 @@ queries: result-vars: [$e] results: - [a] - unsatisfiableIndexes: [2, 3, 4, 5, 6] + unsatisfiableIndexes: [2, 3, 4, 5, 6, 7] nil pointer scalar values any: query: - $e[i8] IN [1, 1, null] @@ -311,7 +332,7 @@ queries: entities: [$e] result-vars: [$e] results: [] - unsatisfiableIndexes: [2, 3, 4, 5, 6] + unsatisfiableIndexes: [2, 3, 4, 5, 6, 7] any clause no match on variable eq: query: - $e[i8] = $i8 @@ -319,7 +340,7 @@ queries: entities: [$e] result-vars: [$e, $i8] results: [] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] using blank, bind all: query: - $e[i8] = $_ @@ -329,7 +350,7 @@ queries: - [a] - [b] - [c] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] using blank, bind non-nil pointer: query: - $e[pi8] = $_ @@ -337,7 +358,7 @@ queries: result-vars: [$e] results: - [a] - unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6, 7] e[i8] != 1: query: - $e[Type] = '*entitynodetest.entity' @@ -347,7 +368,7 @@ queries: results: - [b] - [c] - unsatisfiableIndexes: [1, 2, 3, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] e != a: query: - $e[Type] = '*entitynodetest.entity' @@ -357,7 +378,7 @@ queries: results: - [b] - [c] - unsatisfiableIndexes: [1, 2, 3, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] e[i8] = v; v != 1: query: - $e[Type] = '*entitynodetest.entity' @@ -368,7 +389,7 @@ queries: results: - [b, 2] - [c, 2] - unsatisfiableIndexes: [1, 2, 3, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] e[i8] = v; v != 2: query: - $e[Type] = '*entitynodetest.entity' @@ -378,7 +399,7 @@ queries: result-vars: [$e, $v] results: - [a, 1] - unsatisfiableIndexes: [1, 2, 3, 5, 6] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] e[i8] = v; v != int16(2): query: - $e[Type] = '*entitynodetest.entity' @@ -387,5 +408,45 @@ queries: entities: [$e] result-vars: [$e, $v] results: [] + unsatisfiableIndexes: [1, 2, 3, 5, 6, 7] + node which is neither the left or right of another node (not-join): + query: + - $n[Type] = '*entitynodetest.node' + - leftNotExists($n) + - rightNotExists($n) + entities: [$n] + result-vars: [$n] + results: + - [nc] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + node which is neither the left or right of another node (not-join), composed: + query: + - $n[Type] = '*entitynodetest.node' + - hasNoChildren($n) + entities: [$n] + result-vars: [$n] + results: + - [nc] + unsatisfiableIndexes: [1, 2, 3, 4, 5, 6] + node with entity with i16 not 1: + query: + - $n[Type] = '*entitynodetest.node' + - $i16 = 1 + - nodeWithValuei16NotEq($n, $i16) + entities: [$n] + result-vars: [$n, $i16] + results: + - [nb, 1] + unsatisfiableIndexes: [1, 2, 3, 5, 6] + node with entity with i16 not 2: + query: + - $n[Type] = '*entitynodetest.node' + - $i16 = 2 + - nodeWithValuei16NotEq($n, $i16) + entities: [$n] + result-vars: [$n, $i16] + results: + - [na, 2] + - [nc, 2] unsatisfiableIndexes: [1, 2, 3, 5, 6] comparisons: [] From affdfee0a69332cbd93fa0dc7b204ab31bcad1e6 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Thu, 25 Aug 2022 13:19:11 -0400 Subject: [PATCH 8/8] sql/schemachanger: enforce online schema change invariants with dep rules Previously we had implicit rules in opgen which were used to enforce sequencing between transitions. This was brittle and made it hard to collapse certain edges. Now that we can represent a not-join, we can add the rules we want selectively, only when descriptors are not being dropped. Fixes #86691 Fixes #86626 Release justification: fixes a bug Release note: None --- .../drop_database_multiregion_primary_region | 203 ++- .../end_to_end/drop_table_multiregion | 103 +- .../drop_table_multiregion_primary_region | 75 +- .../drop_database_multiregion_primary_region | 147 +- .../testdata/explain/drop_table_multiregion | 79 +- .../drop_table_multiregion_primary_region | 60 +- .../testdata/explain_verbose/create_index | 56 +- .../create_index.rollback_1_of_7 | 6 + .../create_index.rollback_2_of_7 | 11 +- .../create_index.rollback_3_of_7 | 11 +- .../create_index.rollback_4_of_7 | 11 +- .../create_index.rollback_5_of_7 | 16 +- .../create_index.rollback_6_of_7 | 16 +- .../create_index.rollback_7_of_7 | 16 +- .../drop_database_multiregion_primary_region | 1043 ++++++------ .../explain_verbose/drop_table_multiregion | 532 +++--- .../drop_table_multiregion_primary_region | 377 +++-- .../opt/exec/execbuilder/testdata/show_trace | 12 +- pkg/sql/schemachanger/scop/ops.go | 9 +- pkg/sql/schemachanger/scpb/constants.go | 14 + .../scplan/internal/opgen/BUILD.bazel | 1 + .../scplan/internal/opgen/op_gen.go | 72 +- .../scplan/internal/opgen/register.go | 13 + .../scplan/internal/opgen/target.go | 23 +- .../scplan/internal/rules/BUILD.bazel | 2 + .../scplan/internal/rules/dep_drop_object.go | 31 +- .../scplan/internal/rules/dep_two_version.go | 162 ++ .../scplan/internal/rules/helpers.go | 23 +- .../scplan/internal/rules/rules_test.go | 21 +- .../scplan/internal/rules/testdata/deprules | 1420 +++++++++++++++-- .../scplan/internal/rules/testdata/oprules | 72 +- .../internal/scgraph/depedgekind_string.go | 5 +- .../scplan/internal/scgraph/edge.go | 13 +- .../scplan/internal/scgraph/graph.go | 7 +- .../scplan/internal/scgraph/graph_test.go | 2 - .../scplan/internal/scstage/build.go | 39 +- .../scplan/testdata/alter_table_add_column | 160 +- .../testdata/alter_table_alter_primary_key | 136 +- .../scplan/testdata/alter_table_drop_column | 204 ++- .../scplan/testdata/create_index | 96 ++ .../scplan/testdata/drop_database | 292 ++-- .../schemachanger/scplan/testdata/drop_index | 209 ++- .../scplan/testdata/drop_owned_by | 150 +- .../schemachanger/scplan/testdata/drop_schema | 230 +-- .../scplan/testdata/drop_sequence | 92 +- .../schemachanger/scplan/testdata/drop_table | 193 ++- .../schemachanger/scplan/testdata/drop_type | 58 +- .../schemachanger/scplan/testdata/drop_view | 216 +-- .../testdata/end_to_end/add_column | 8 - .../end_to_end/add_column_default_seq | 16 - .../testdata/end_to_end/drop_schema | 56 +- .../testdata/end_to_end/drop_table | 45 +- .../schemachanger/testdata/explain/add_column | 6 +- .../testdata/explain/add_column_default_seq | 6 +- .../alter_table_add_primary_key_drop_rowid | 20 +- ...d_primary_key_drop_rowid.rollback_10_of_15 | 6 +- ...d_primary_key_drop_rowid.rollback_11_of_15 | 6 +- ...d_primary_key_drop_rowid.rollback_12_of_15 | 6 +- ...d_primary_key_drop_rowid.rollback_13_of_15 | 6 +- ...d_primary_key_drop_rowid.rollback_14_of_15 | 6 +- ...d_primary_key_drop_rowid.rollback_15_of_15 | 6 +- ...dd_primary_key_drop_rowid.rollback_9_of_15 | 6 +- .../alter_table_alter_primary_key_drop_rowid | 20 +- ...r_primary_key_drop_rowid.rollback_10_of_15 | 6 +- ...r_primary_key_drop_rowid.rollback_11_of_15 | 6 +- ...r_primary_key_drop_rowid.rollback_12_of_15 | 6 +- ...r_primary_key_drop_rowid.rollback_13_of_15 | 6 +- ...r_primary_key_drop_rowid.rollback_14_of_15 | 6 +- ...r_primary_key_drop_rowid.rollback_15_of_15 | 6 +- ...er_primary_key_drop_rowid.rollback_9_of_15 | 6 +- .../alter_table_alter_primary_key_vanilla | 6 +- .../testdata/explain/drop_column_basic | 6 +- .../explain/drop_column_computed_index | 6 +- ...ndex_separate_statements.rollback_10_of_15 | 6 +- ...ndex_separate_statements.rollback_11_of_15 | 6 +- ...ndex_separate_statements.rollback_12_of_15 | 6 +- ...ndex_separate_statements.rollback_13_of_15 | 6 +- ...ndex_separate_statements.rollback_14_of_15 | 6 +- ...ndex_separate_statements.rollback_15_of_15 | 6 +- ...index_separate_statements.rollback_9_of_15 | 6 +- ...index_separate_statements.statement_1_of_2 | 6 +- .../testdata/explain/drop_column_unique_index | 6 +- .../testdata/explain/drop_column_with_index | 6 +- .../explain/drop_index_hash_sharded_index | 15 +- .../drop_index_partial_expression_index | 9 +- .../testdata/explain/drop_index_vanilla_index | 9 +- ...lumns_separate_statements.statement_1_of_2 | 6 +- ...lumns_separate_statements.statement_2_of_2 | 6 +- .../testdata/explain/drop_schema | 29 +- .../schemachanger/testdata/explain/drop_table | 75 +- .../testdata/explain_verbose/add_column | 88 +- .../add_column.rollback_1_of_7 | 9 + .../add_column.rollback_2_of_7 | 19 +- .../add_column.rollback_3_of_7 | 19 +- .../add_column.rollback_4_of_7 | 19 +- .../add_column.rollback_5_of_7 | 24 +- .../add_column.rollback_6_of_7 | 24 +- .../add_column.rollback_7_of_7 | 24 +- .../explain_verbose/add_column_default_seq | 88 +- .../add_column_default_seq.rollback_1_of_7 | 9 + .../add_column_default_seq.rollback_2_of_7 | 19 +- .../add_column_default_seq.rollback_3_of_7 | 19 +- .../add_column_default_seq.rollback_4_of_7 | 19 +- .../add_column_default_seq.rollback_5_of_7 | 24 +- .../add_column_default_seq.rollback_6_of_7 | 24 +- .../add_column_default_seq.rollback_7_of_7 | 24 +- .../explain_verbose/add_column_no_default | 13 +- .../add_column_no_default.rollback_1_of_2 | 3 + .../add_column_no_default.rollback_2_of_2 | 8 +- .../alter_table_add_primary_key_drop_rowid | 145 +- ...d_primary_key_drop_rowid.rollback_10_of_15 | 46 +- ...d_primary_key_drop_rowid.rollback_11_of_15 | 46 +- ...d_primary_key_drop_rowid.rollback_12_of_15 | 46 +- ...d_primary_key_drop_rowid.rollback_13_of_15 | 51 +- ...d_primary_key_drop_rowid.rollback_14_of_15 | 51 +- ...d_primary_key_drop_rowid.rollback_15_of_15 | 51 +- ...dd_primary_key_drop_rowid.rollback_1_of_15 | 12 + ...dd_primary_key_drop_rowid.rollback_2_of_15 | 17 +- ...dd_primary_key_drop_rowid.rollback_3_of_15 | 17 +- ...dd_primary_key_drop_rowid.rollback_4_of_15 | 17 +- ...dd_primary_key_drop_rowid.rollback_5_of_15 | 22 +- ...dd_primary_key_drop_rowid.rollback_6_of_15 | 22 +- ...dd_primary_key_drop_rowid.rollback_7_of_15 | 22 +- ...dd_primary_key_drop_rowid.rollback_8_of_15 | 22 +- ...dd_primary_key_drop_rowid.rollback_9_of_15 | 41 +- .../alter_table_alter_primary_key_drop_rowid | 145 +- ...r_primary_key_drop_rowid.rollback_10_of_15 | 46 +- ...r_primary_key_drop_rowid.rollback_11_of_15 | 46 +- ...r_primary_key_drop_rowid.rollback_12_of_15 | 46 +- ...r_primary_key_drop_rowid.rollback_13_of_15 | 51 +- ...r_primary_key_drop_rowid.rollback_14_of_15 | 51 +- ...r_primary_key_drop_rowid.rollback_15_of_15 | 51 +- ...er_primary_key_drop_rowid.rollback_1_of_15 | 12 + ...er_primary_key_drop_rowid.rollback_2_of_15 | 17 +- ...er_primary_key_drop_rowid.rollback_3_of_15 | 17 +- ...er_primary_key_drop_rowid.rollback_4_of_15 | 17 +- ...er_primary_key_drop_rowid.rollback_5_of_15 | 22 +- ...er_primary_key_drop_rowid.rollback_6_of_15 | 22 +- ...er_primary_key_drop_rowid.rollback_7_of_15 | 22 +- ...er_primary_key_drop_rowid.rollback_8_of_15 | 22 +- ...er_primary_key_drop_rowid.rollback_9_of_15 | 41 +- .../alter_table_alter_primary_key_vanilla | 129 +- ..._alter_primary_key_vanilla.rollback_1_of_7 | 12 + ..._alter_primary_key_vanilla.rollback_2_of_7 | 22 +- ..._alter_primary_key_vanilla.rollback_3_of_7 | 22 +- ..._alter_primary_key_vanilla.rollback_4_of_7 | 22 +- ..._alter_primary_key_vanilla.rollback_5_of_7 | 32 +- ..._alter_primary_key_vanilla.rollback_6_of_7 | 32 +- ..._alter_primary_key_vanilla.rollback_7_of_7 | 32 +- .../testdata/explain_verbose/create_index | 56 +- .../create_index.rollback_1_of_7 | 6 + .../create_index.rollback_2_of_7 | 11 +- .../create_index.rollback_3_of_7 | 11 +- .../create_index.rollback_4_of_7 | 11 +- .../create_index.rollback_5_of_7 | 16 +- .../create_index.rollback_6_of_7 | 16 +- .../create_index.rollback_7_of_7 | 16 +- .../explain_verbose/drop_column_basic | 86 +- .../drop_column_basic.rollback_1_of_7 | 9 + .../drop_column_basic.rollback_2_of_7 | 14 +- .../drop_column_basic.rollback_3_of_7 | 14 +- .../drop_column_basic.rollback_4_of_7 | 14 +- .../drop_column_basic.rollback_5_of_7 | 19 +- .../drop_column_basic.rollback_6_of_7 | 19 +- .../drop_column_basic.rollback_7_of_7 | 19 +- .../drop_column_computed_index | 110 +- ...drop_column_computed_index.rollback_1_of_7 | 15 + ...drop_column_computed_index.rollback_2_of_7 | 20 +- ...drop_column_computed_index.rollback_3_of_7 | 20 +- ...drop_column_computed_index.rollback_4_of_7 | 20 +- ...drop_column_computed_index.rollback_5_of_7 | 25 +- ...drop_column_computed_index.rollback_6_of_7 | 25 +- ...drop_column_computed_index.rollback_7_of_7 | 25 +- ...ndex_separate_statements.rollback_10_of_15 | 56 +- ...ndex_separate_statements.rollback_11_of_15 | 56 +- ...ndex_separate_statements.rollback_12_of_15 | 56 +- ...ndex_separate_statements.rollback_13_of_15 | 61 +- ...ndex_separate_statements.rollback_14_of_15 | 61 +- ...ndex_separate_statements.rollback_15_of_15 | 61 +- ...index_separate_statements.rollback_1_of_15 | 19 +- ...index_separate_statements.rollback_2_of_15 | 24 +- ...index_separate_statements.rollback_3_of_15 | 24 +- ...index_separate_statements.rollback_4_of_15 | 24 +- ...index_separate_statements.rollback_5_of_15 | 29 +- ...index_separate_statements.rollback_6_of_15 | 29 +- ...index_separate_statements.rollback_7_of_15 | 29 +- ...index_separate_statements.rollback_8_of_15 | 29 +- ...index_separate_statements.rollback_9_of_15 | 51 +- ...index_separate_statements.statement_1_of_2 | 110 +- ...index_separate_statements.statement_2_of_2 | 147 +- .../explain_verbose/drop_column_unique_index | 86 +- .../drop_column_unique_index.rollback_1_of_7 | 9 + .../drop_column_unique_index.rollback_2_of_7 | 14 +- .../drop_column_unique_index.rollback_3_of_7 | 14 +- .../drop_column_unique_index.rollback_4_of_7 | 14 +- .../drop_column_unique_index.rollback_5_of_7 | 19 +- .../drop_column_unique_index.rollback_6_of_7 | 19 +- .../drop_column_unique_index.rollback_7_of_7 | 19 +- .../explain_verbose/drop_column_with_index | 97 +- .../drop_column_with_index.rollback_1_of_7 | 12 + .../drop_column_with_index.rollback_2_of_7 | 17 +- .../drop_column_with_index.rollback_3_of_7 | 17 +- .../drop_column_with_index.rollback_4_of_7 | 17 +- .../drop_column_with_index.rollback_5_of_7 | 22 +- .../drop_column_with_index.rollback_6_of_7 | 22 +- .../drop_column_with_index.rollback_7_of_7 | 22 +- .../drop_index_hash_sharded_index | 29 +- .../drop_index_partial_expression_index | 45 +- .../explain_verbose/drop_index_vanilla_index | 34 +- ...olumns_separate_statements.rollback_1_of_7 | 22 +- ...olumns_separate_statements.rollback_2_of_7 | 27 +- ...olumns_separate_statements.rollback_3_of_7 | 27 +- ...olumns_separate_statements.rollback_4_of_7 | 27 +- ...olumns_separate_statements.rollback_5_of_7 | 32 +- ...olumns_separate_statements.rollback_6_of_7 | 32 +- ...olumns_separate_statements.rollback_7_of_7 | 32 +- ...lumns_separate_statements.statement_1_of_2 | 110 +- ...lumns_separate_statements.statement_2_of_2 | 106 +- .../testdata/explain_verbose/drop_schema | 145 +- .../testdata/explain_verbose/drop_table | 532 +++--- 220 files changed, 8760 insertions(+), 3585 deletions(-) create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/dep_two_version.go diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region index fedc118447bf..db078d859bc2 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region @@ -19,14 +19,45 @@ begin transaction #1 checking for feature: DROP DATABASE increment telemetry for sql.schema.drop_database ## StatementPhase stage 1 of 1 with 5 MutationType ops -added synthetic descriptor: name:"multi_region_test_db" id:104 modification_time:<> version:2 privileges: users: users: owner_proto:"root" version:2 > schemas: > state:DROP offline_reason:"" region_config: -added synthetic descriptor: name:"crdb_internal_region" id:105 version:3 modification_time:<> privileges: users: users: owner_proto:"root" version:2 > parent_id:104 parent_schema_id:106 array_type_id:107 state:DROP offline_reason:"" kind:MULTIREGION_ENUM referencing_descriptor_ids:108 enum_members: enum_members: enum_members: region_config: secondary_region:"" > -added synthetic descriptor: name:"public" id:106 state:DROP offline_reason:"" modification_time:<> version:2 parent_id:104 privileges: users: users: owner_proto:"admin" version:2 > -added synthetic descriptor: name:"_crdb_internal_region" id:107 version:2 modification_time:<> privileges: users: users: owner_proto:"root" version:2 > parent_id:104 parent_schema_id:106 array_type_id:0 state:DROP offline_reason:"" kind:ALIAS alias: > time_precision_is_set: false > -added synthetic descriptor: name:"table_regional_by_table" id:108 version:2 modification_time:<> parent_id:104 unexposed_parent_schema_id:106 columns: nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:2 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:1640995200000000000 constraint_id:1 not_visible:false > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false refresh_view_required:false drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time: temporary:false locality_config: > partition_all_by:false exclude_data_from_backup:false next_constraint_id:2 import_start_wall_time:0 +add synthetic descriptor #104: + ... + public: + id: 106 + + state: DROP + version: "1" +add synthetic descriptor #106: + ... + withGrantOption: 2 + version: 2 + + state: DROP + version: "1" +add synthetic descriptor #105: + ... + primaryRegion: us-east1 + zoneConfigExtensions: {} + + state: DROP + version: "2" +add synthetic descriptor #107: + ... + withGrantOption: 2 + version: 2 + + state: DROP + version: "1" +add synthetic descriptor #108: + ... + replacementOf: + time: {} + + state: DROP + unexposedParentSchemaId: 106 + version: "1" # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 6 MutationType ops +## PreCommitPhase stage 1 of 1 with 20 MutationType ops +delete database namespace entry {0 0 multi_region_test_db} -> 104 +delete object namespace entry {104 106 crdb_internal_region} -> 105 +delete schema namespace entry {104 0 public} -> 106 +delete object namespace entry {104 106 _crdb_internal_region} -> 107 +delete object namespace entry {104 106 table_regional_by_table} -> 108 upsert descriptor #104 database: + declarativeSchemaChangerState: @@ -42,12 +73,17 @@ upsert descriptor #104 + targetRanks: + targets: id: 104 - modificationTime: {} + - modificationTime: + - wallTime: "1640995200000000000" + + modificationTime: {} + name: multi_region_test_db + privileges: ... public: id: 106 - - state: DROP - version: "2" + - version: "1" + + state: DROP + + version: "2" upsert descriptor #105 type: arrayTypeId: 107 @@ -65,11 +101,20 @@ upsert descriptor #105 + targets: enumMembers: - logicalRepresentation: us-east1 + ... + id: 105 + kind: MULTIREGION_ENUM + - modificationTime: + - wallTime: "1640995200000000000" + + modificationTime: {} + name: crdb_internal_region + parentId: 104 ... primaryRegion: us-east1 zoneConfigExtensions: {} - - state: DROP - version: "3" + - version: "2" + + state: DROP + + version: "3" upsert descriptor #106 schema: + declarativeSchemaChangerState: @@ -85,12 +130,17 @@ upsert descriptor #106 + targetRanks: + targets: id: 106 - modificationTime: {} + - modificationTime: + - wallTime: "1640995200000000000" + + modificationTime: {} + name: public + parentId: 104 ... withGrantOption: 2 version: 2 - - state: DROP - version: "2" + - version: "1" + + state: DROP + + version: "2" upsert descriptor #107 ... family: ArrayFamily @@ -109,11 +159,17 @@ upsert descriptor #107 + targets: id: 107 kind: ALIAS + - modificationTime: + - wallTime: "1640995200000000000" + + modificationTime: {} + name: _crdb_internal_region + parentId: 104 ... withGrantOption: 2 version: 2 - - state: DROP - version: "2" + - version: "1" + + state: DROP + + version: "2" upsert descriptor #108 ... createAsOfTime: @@ -130,93 +186,6 @@ upsert descriptor #108 + statementTag: DROP DATABASE + targetRanks: + targets: - families: - - columnIds: - ... - replacementOf: - time: {} - - state: DROP - unexposedParentSchemaId: 106 - version: "2" -create job #1 (non-cancelable: true): "DROP DATABASE multi_region_test_db CASCADE" - descriptor IDs: [104 105 106 107 108] -# end PreCommitPhase -commit transaction #1 -notified job registry to adopt jobs: [1] -# begin PostCommitPhase -begin transaction #2 -commit transaction #2 -begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 20 MutationType ops -delete database namespace entry {0 0 multi_region_test_db} -> 104 -delete object namespace entry {104 106 crdb_internal_region} -> 105 -delete schema namespace entry {104 0 public} -> 106 -delete object namespace entry {104 106 _crdb_internal_region} -> 107 -delete object namespace entry {104 106 table_regional_by_table} -> 108 -upsert descriptor #104 - ... - targets: - id: 104 - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: multi_region_test_db - privileges: - ... - public: - id: 106 - - version: "2" - + state: DROP - + version: "3" -upsert descriptor #105 - ... - id: 105 - kind: MULTIREGION_ENUM - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: crdb_internal_region - parentId: 104 - ... - primaryRegion: us-east1 - zoneConfigExtensions: {} - - version: "3" - + state: DROP - + version: "4" -upsert descriptor #106 - ... - targets: - id: 106 - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: public - parentId: 104 - ... - withGrantOption: 2 - version: 2 - - version: "2" - + state: DROP - + version: "3" -upsert descriptor #107 - ... - id: 107 - kind: ALIAS - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: _crdb_internal_region - parentId: 104 - ... - withGrantOption: 2 - version: 2 - - version: "2" - + state: DROP - + version: "3" -upsert descriptor #108 - ... - targetRanks: - targets: + dropTime: " families: - columnIds: @@ -224,7 +193,7 @@ upsert descriptor #108 regionalByTable: region: us-east2 - modificationTime: - - wallTime: "1640995200000000001" + - wallTime: "1640995200000000000" + modificationTime: {} name: table_regional_by_table nextColumnId: 2 @@ -233,14 +202,20 @@ upsert descriptor #108 time: {} + state: DROP unexposedParentSchemaId: 106 - - version: "2" - + version: "3" + - version: "1" + + version: "2" delete all comments for table descriptors [108] delete role settings for database on #104 -update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 14 MutationType ops pending" -commit transaction #3 -begin transaction #4 -## PostCommitNonRevertiblePhase stage 2 of 2 with 20 MutationType ops +create job #1 (non-cancelable: true): "DROP DATABASE multi_region_test_db CASCADE" + descriptor IDs: [104 105 106 107 108] +# end PreCommitPhase +commit transaction #1 +notified job registry to adopt jobs: [1] +# begin PostCommitPhase +begin transaction #2 +commit transaction #2 +begin transaction #3 +## PostCommitNonRevertiblePhase stage 1 of 1 with 20 MutationType ops upsert descriptor #108 ... createAsOfTime: @@ -263,15 +238,15 @@ upsert descriptor #108 regionalByTable: region: us-east2 - modificationTime: - - wallTime: "1640995200000000003" + - wallTime: "1640995200000000001" + modificationTime: {} name: table_regional_by_table nextColumnId: 2 ... state: DROP unexposedParentSchemaId: 106 - - version: "3" - + version: "4" + - version: "2" + + version: "3" delete descriptor #104 delete descriptor #105 delete descriptor #106 @@ -280,6 +255,6 @@ write *eventpb.DropDatabase to event log: DROP DATABASE ‹multi_region_test_db create job #2 (non-cancelable: true): "GC for DROP DATABASE multi_region_test_db CASCADE" descriptor IDs: [108 104] update progress of schema change job #1: "all stages completed" -commit transaction #4 +commit transaction #3 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion index 54d22979e8e0..69d8ce43f764 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion @@ -28,7 +28,8 @@ add synthetic descriptor #108: version: "1" # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 4 MutationType ops +## PreCommitPhase stage 1 of 1 with 11 MutationType ops +delete object namespace entry {104 106 table_regional_by_row} -> 108 upsert descriptor #105 type: arrayTypeId: 107 @@ -47,6 +48,11 @@ upsert descriptor #105 name: crdb_internal_region parentId: 104 ... + withGrantOption: 2 + version: 2 + - referencingDescriptorIds: + - - 108 + regionConfig: primaryRegion: us-east1 zoneConfigExtensions: {} - version: "2" @@ -67,8 +73,10 @@ upsert descriptor #107 name: _crdb_internal_region parentId: 104 ... - referencingDescriptorIds: - - 108 + withGrantOption: 2 + version: 2 + - referencingDescriptorIds: + - - 108 - version: "2" + version: "3" upsert descriptor #108 @@ -87,6 +95,7 @@ upsert descriptor #108 + statementTag: DROP TABLE + targetRanks: + targets: + + dropTime: " families: - columnIds: ... @@ -98,10 +107,13 @@ upsert descriptor #108 name: table_regional_by_row nextColumnId: 3 ... + replacementOf: time: {} + + state: DROP unexposedParentSchemaId: 106 - version: "1" + version: "2" +delete all comments for table descriptors [108] create job #1 (non-cancelable: true): "DROP TABLE multi_region_test_db.public.table_regional_by_row" descriptor IDs: [105 107 108] # end PreCommitPhase @@ -111,70 +123,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 11 MutationType ops -delete object namespace entry {104 106 table_regional_by_row} -> 108 -upsert descriptor #105 - ... - id: 105 - kind: MULTIREGION_ENUM - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: crdb_internal_region - parentId: 104 - ... - withGrantOption: 2 - version: 2 - - referencingDescriptorIds: - - - 108 - regionConfig: - primaryRegion: us-east1 - zoneConfigExtensions: {} - - version: "3" - + version: "4" -upsert descriptor #107 - ... - id: 107 - kind: ALIAS - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: _crdb_internal_region - parentId: 104 - ... - withGrantOption: 2 - version: 2 - - referencingDescriptorIds: - - - 108 - - version: "3" - + version: "4" -upsert descriptor #108 - ... - targetRanks: - targets: - + dropTime: " - families: - - columnIds: - ... - localityConfig: - regionalByRow: {} - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: table_regional_by_row - nextColumnId: 3 - ... - replacementOf: - time: {} - + state: DROP - unexposedParentSchemaId: 106 - - version: "2" - + version: "3" -delete all comments for table descriptors [108] -update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 6 MutationType ops pending" -commit transaction #3 -begin transaction #4 -## PostCommitNonRevertiblePhase stage 2 of 2 with 10 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 10 MutationType ops upsert descriptor #105 type: arrayTypeId: 107 @@ -188,15 +137,15 @@ upsert descriptor #105 id: 105 kind: MULTIREGION_ENUM - modificationTime: - - wallTime: "1640995200000000003" + - wallTime: "1640995200000000001" + modificationTime: {} name: crdb_internal_region parentId: 104 ... primaryRegion: us-east1 zoneConfigExtensions: {} - - version: "4" - + version: "5" + - version: "3" + + version: "4" upsert descriptor #107 ... family: ArrayFamily @@ -208,15 +157,15 @@ upsert descriptor #107 id: 107 kind: ALIAS - modificationTime: - - wallTime: "1640995200000000003" + - wallTime: "1640995200000000001" + modificationTime: {} name: _crdb_internal_region parentId: 104 ... withGrantOption: 2 version: 2 - - version: "4" - + version: "5" + - version: "3" + + version: "4" upsert descriptor #108 ... createAsOfTime: @@ -239,19 +188,19 @@ upsert descriptor #108 localityConfig: regionalByRow: {} - modificationTime: - - wallTime: "1640995200000000003" + - wallTime: "1640995200000000001" + modificationTime: {} name: table_regional_by_row nextColumnId: 3 ... state: DROP unexposedParentSchemaId: 106 - - version: "3" - + version: "4" + - version: "2" + + version: "3" write *eventpb.DropTable to event log: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› create job #2 (non-cancelable: true): "GC for DROP TABLE multi_region_test_db.public.table_regional_by_row" descriptor IDs: [108] update progress of schema change job #1: "all stages completed" -commit transaction #4 +commit transaction #3 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region index 1e7c52f0b478..af721f5c5c9c 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region @@ -28,7 +28,8 @@ add synthetic descriptor #108: version: "1" # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 3 MutationType ops +## PreCommitPhase stage 1 of 1 with 7 MutationType ops +delete object namespace entry {104 106 table_regional_by_table} -> 108 upsert descriptor #105 type: arrayTypeId: 107 @@ -47,6 +48,11 @@ upsert descriptor #105 name: crdb_internal_region parentId: 104 ... + withGrantOption: 2 + version: 2 + - referencingDescriptorIds: + - - 108 + regionConfig: primaryRegion: us-east1 zoneConfigExtensions: {} - version: "2" @@ -69,6 +75,7 @@ upsert descriptor #108 + statementTag: DROP TABLE + targetRanks: + targets: + + dropTime: " families: - columnIds: ... @@ -80,10 +87,13 @@ upsert descriptor #108 name: table_regional_by_table nextColumnId: 2 ... + replacementOf: time: {} + + state: DROP unexposedParentSchemaId: 106 - version: "1" + version: "2" +delete all comments for table descriptors [108] create job #1 (non-cancelable: true): "DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE" descriptor IDs: [105 108] # end PreCommitPhase @@ -93,54 +103,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops -delete object namespace entry {104 106 table_regional_by_table} -> 108 -upsert descriptor #105 - ... - id: 105 - kind: MULTIREGION_ENUM - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: crdb_internal_region - parentId: 104 - ... - withGrantOption: 2 - version: 2 - - referencingDescriptorIds: - - - 108 - regionConfig: - primaryRegion: us-east1 - zoneConfigExtensions: {} - - version: "3" - + version: "4" -upsert descriptor #108 - ... - targetRanks: - targets: - + dropTime: " - families: - - columnIds: - ... - regionalByTable: - region: us-east2 - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: table_regional_by_table - nextColumnId: 2 - ... - replacementOf: - time: {} - + state: DROP - unexposedParentSchemaId: 106 - - version: "2" - + version: "3" -delete all comments for table descriptors [108] -update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 5 MutationType ops pending" -commit transaction #3 -begin transaction #4 -## PostCommitNonRevertiblePhase stage 2 of 2 with 8 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 8 MutationType ops upsert descriptor #105 type: arrayTypeId: 107 @@ -154,15 +117,15 @@ upsert descriptor #105 id: 105 kind: MULTIREGION_ENUM - modificationTime: - - wallTime: "1640995200000000003" + - wallTime: "1640995200000000001" + modificationTime: {} name: crdb_internal_region parentId: 104 ... primaryRegion: us-east1 zoneConfigExtensions: {} - - version: "4" - + version: "5" + - version: "3" + + version: "4" upsert descriptor #108 ... createAsOfTime: @@ -187,19 +150,19 @@ upsert descriptor #108 regionalByTable: region: us-east2 - modificationTime: - - wallTime: "1640995200000000003" + - wallTime: "1640995200000000001" + modificationTime: {} name: table_regional_by_table nextColumnId: 2 ... state: DROP unexposedParentSchemaId: 106 - - version: "3" - + version: "4" + - version: "2" + + version: "3" write *eventpb.DropTable to event log: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE create job #2 (non-cancelable: true): "GC for DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE" descriptor IDs: [108] update progress of schema change job #1: "all stages completed" -commit transaction #4 +commit transaction #3 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region index 5ae8dddd4e37..2eca937a4be9 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region @@ -28,12 +28,74 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE; │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ └── 6 Mutation operations + │ ├── 52 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 104} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Database:{DescID: 104} + │ │ ├── PUBLIC → ABSENT DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} + │ │ ├── PUBLIC → ABSENT DatabaseRegionConfig:{DescID: 104, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: public, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Schema:{DescID: 106} + │ │ ├── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 105, Name: crdb_internal_region, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 105} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: root} + │ │ ├── TXN_DROPPED → DROPPED EnumType:{DescID: 105} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east1} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east2} + │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east3} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 105, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: _crdb_internal_region, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: public} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} + │ │ ├── TXN_DROPPED → DROPPED AliasType:{DescID: 107} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} + │ └── 20 Mutation operations + │ ├── MarkDescriptorAsDropped {"DescID":104} + │ ├── RemoveDatabaseRoleSettings {"DatabaseID":104} + │ ├── MarkDescriptorAsDropped {"DescID":106} + │ ├── RemoveSchemaParent {"Parent":{"ParentDatabaseID":104,"SchemaID":106}} + │ ├── MarkDescriptorAsDropped {"DescID":105} + │ ├── MarkDescriptorAsDropped {"DescID":107} + │ ├── MarkDescriptorAsDropped {"DescID":108} + │ ├── RemoveAllTableComments {"TableID":108} + │ ├── RemoveBackReferenceInTypes {"BackReferencedDescID":108} + │ ├── DrainDescriptorName {"Namespace":{"DescriptorID":104,"Name":"multi_region_tes..."}} + │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":106,"Name":"public"}} + │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":105,"Name":"crdb_internal_re...","SchemaID":106}} + │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":107,"Name":"_crdb_internal_r...","SchemaID":106}} + │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":108,"Name":"table_regional_b...","SchemaID":106}} │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":105,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":106,"Initialize":true} @@ -41,78 +103,7 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE; │ ├── SetJobStateOnDescriptor {"DescriptorID":108,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase - ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 48 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 104} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 104, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Database:{DescID: 104} - │ │ ├── PUBLIC → ABSENT DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} - │ │ ├── PUBLIC → ABSENT DatabaseRegionConfig:{DescID: 104, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: public, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Schema:{DescID: 106} - │ │ ├── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 105, Name: crdb_internal_region, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 105} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 105, Name: root} - │ │ ├── TXN_DROPPED → DROPPED EnumType:{DescID: 105} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east1} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east2} - │ │ ├── PUBLIC → ABSENT EnumTypeValue:{DescID: 105, Name: us-east3} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 105, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: _crdb_internal_region, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: public} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} - │ │ ├── TXN_DROPPED → DROPPED AliasType:{DescID: 107} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} - │ └── 20 Mutation operations - │ ├── MarkDescriptorAsDropped {"DescID":104} - │ ├── RemoveDatabaseRoleSettings {"DatabaseID":104} - │ ├── MarkDescriptorAsDropped {"DescID":106} - │ ├── RemoveSchemaParent {"Parent":{"ParentDatabaseID":104,"SchemaID":106}} - │ ├── MarkDescriptorAsDropped {"DescID":105} - │ ├── MarkDescriptorAsDropped {"DescID":107} - │ ├── MarkDescriptorAsDropped {"DescID":108} - │ ├── RemoveAllTableComments {"TableID":108} - │ ├── RemoveBackReferenceInTypes {"BackReferencedDescID":108} - │ ├── DrainDescriptorName {"Namespace":{"DescriptorID":104,"Name":"multi_region_tes..."}} - │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":106,"Name":"public"}} - │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":105,"Name":"crdb_internal_re...","SchemaID":106}} - │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":107,"Name":"_crdb_internal_r...","SchemaID":106}} - │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":108,"Name":"table_regional_b...","SchemaID":106}} - │ ├── SetJobStateOnDescriptor {"DescriptorID":104} - │ ├── SetJobStateOnDescriptor {"DescriptorID":105} - │ ├── SetJobStateOnDescriptor {"DescriptorID":106} - │ ├── SetJobStateOnDescriptor {"DescriptorID":107} - │ ├── SetJobStateOnDescriptor {"DescriptorID":108} - │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} - └── Stage 2 of 2 in PostCommitNonRevertiblePhase + └── Stage 1 of 1 in PostCommitNonRevertiblePhase ├── 9 elements transitioning toward ABSENT │ ├── DROPPED → ABSENT Database:{DescID: 104} │ ├── DROPPED → ABSENT Schema:{DescID: 106} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion index fee6ad5a05d7..aac003b9b5ab 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion @@ -21,54 +21,47 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 5 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 2} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ └── 4 Mutation operations + │ ├── 26 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalityRegionalByRow:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: k, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 108, ColumnID: 2} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → ABSENT IndexPartitioning:{DescID: 108, IndexID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_row_pkey, IndexID: 1} + │ └── 11 Mutation operations + │ ├── MarkDescriptorAsDropped {"DescID":108} + │ ├── RemoveAllTableComments {"TableID":108} + │ ├── RemoveColumnDefaultExpression {"ColumnID":2,"TableID":108} + │ ├── UpdateTableBackReferencesInTypes {"BackReferencedTableID":108} + │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":108,"Name":"table_regional_b...","SchemaID":106}} + │ ├── RemoveDroppedColumnType {"ColumnID":2,"TableID":108} + │ ├── UpdateTableBackReferencesInTypes {"BackReferencedTableID":108} │ ├── SetJobStateOnDescriptor {"DescriptorID":105,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":107,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":108,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase - ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 21 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalityRegionalByRow:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: k, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 108, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexPartitioning:{DescID: 108, IndexID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_row_pkey, IndexID: 1} - │ └── 11 Mutation operations - │ ├── MarkDescriptorAsDropped {"DescID":108} - │ ├── RemoveAllTableComments {"TableID":108} - │ ├── RemoveColumnDefaultExpression {"ColumnID":2,"TableID":108} - │ ├── UpdateTableBackReferencesInTypes {"BackReferencedTableID":108} - │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":108,"Name":"table_regional_b...","SchemaID":106}} - │ ├── RemoveDroppedColumnType {"ColumnID":2,"TableID":108} - │ ├── UpdateTableBackReferencesInTypes {"BackReferencedTableID":108} - │ ├── SetJobStateOnDescriptor {"DescriptorID":105} - │ ├── SetJobStateOnDescriptor {"DescriptorID":107} - │ ├── SetJobStateOnDescriptor {"DescriptorID":108} - │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} - └── Stage 2 of 2 in PostCommitNonRevertiblePhase + └── Stage 1 of 1 in PostCommitNonRevertiblePhase ├── 6 elements transitioning toward ABSENT │ ├── DROPPED → ABSENT Table:{DescID: 108} │ ├── DELETE_ONLY → ABSENT Column:{DescID: 108, ColumnID: 1} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region index 777fe5abafbc..4fc0eee7ab13 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region @@ -20,43 +20,37 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":108} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ └── 3 Mutation operations + │ ├── 20 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 108, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} + │ └── 7 Mutation operations + │ ├── MarkDescriptorAsDropped {"DescID":108} + │ ├── RemoveAllTableComments {"TableID":108} + │ ├── RemoveBackReferenceInTypes {"BackReferencedDescID":108} + │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":108,"Name":"table_regional_b...","SchemaID":106}} │ ├── SetJobStateOnDescriptor {"DescriptorID":105,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":108,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase - ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 16 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 108} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 108, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 108} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: a, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} - │ └── 7 Mutation operations - │ ├── MarkDescriptorAsDropped {"DescID":108} - │ ├── RemoveAllTableComments {"TableID":108} - │ ├── RemoveBackReferenceInTypes {"BackReferencedDescID":108} - │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":108,"Name":"table_regional_b...","SchemaID":106}} - │ ├── SetJobStateOnDescriptor {"DescriptorID":105} - │ ├── SetJobStateOnDescriptor {"DescriptorID":108} - │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} - └── Stage 2 of 2 in PostCommitNonRevertiblePhase + └── Stage 1 of 1 in PostCommitNonRevertiblePhase ├── 5 elements transitioning toward ABSENT │ ├── DROPPED → ABSENT Table:{DescID: 108} │ ├── DELETE_ONLY → ABSENT Column:{DescID: 108, ColumnID: 1} diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index index 701a66548ac8..8c43677a8dc7 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index @@ -34,7 +34,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ │ rule: "index existence precedes index dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexPartitioning:{DescID: 104, IndexID: 2} │ │ │ │ ABSENT → PUBLIC @@ -69,7 +72,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} -│ │ ABSENT → DELETE_ONLY +│ │ │ ABSENT → DELETE_ONLY +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} +│ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ └── • 10 Mutation operations │ │ @@ -187,7 +193,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} -│ │ │ DELETE_ONLY → WRITE_ONLY +│ │ │ │ DELETE_ONLY → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -218,6 +227,9 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ └── • Precedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ │ rule: "temp index is WRITE_ONLY before backfill" │ │ │ @@ -233,7 +245,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -253,7 +268,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -273,7 +291,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -287,7 +308,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -307,7 +331,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -333,6 +360,9 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: id1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -349,7 +379,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ └── • 5 Mutation operations │ │ @@ -379,7 +412,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT + │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT + │ │ + │ └── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" │ └── • 4 Mutation operations │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_1_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_1_of_7 index 2844e535fb07..bce23826913e 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_1_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_1_of_7 @@ -37,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -58,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_2_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_2_of_7 index bf1e5f398cbf..dd1a49b63db2 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_2_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_2_of_7 @@ -37,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -56,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ PUBLIC → ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,6 +136,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_3_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_3_of_7 index acd0d09c0a35..94dbeee0ccc4 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_3_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_3_of_7 @@ -37,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -56,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ PUBLIC → ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,6 +136,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_4_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_4_of_7 index b603debb4505..e22f9f2c1aed 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_4_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_4_of_7 @@ -46,6 +46,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: id1, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -56,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ PUBLIC → ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,6 +136,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_5_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_5_of_7 index 09293f3f4d99..088cb69162f0 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_5_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_5_of_7 @@ -35,13 +35,19 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexPartitioning:{DescID: 104, IndexID: 2} │ │ │ PUBLIC → ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -98,6 +104,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: id1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -107,6 +116,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_6_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_6_of_7 index 36888496a5ee..ad11a3c4d6b5 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_6_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_6_of_7 @@ -35,13 +35,19 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexPartitioning:{DescID: 104, IndexID: 2} │ │ │ PUBLIC → ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -98,6 +104,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: id1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -107,6 +116,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_7_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_7_of_7 index b9b58944e79c..0bda5c0c47bd 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_7_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_7_of_7 @@ -35,13 +35,19 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexPartitioning:{DescID: 104, IndexID: 2} │ │ │ PUBLIC → ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -98,6 +104,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: id1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -107,6 +116,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region index 742cc0645485..89ee7c91a1e8 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region @@ -75,7 +75,346 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 4 elements transitioning toward ABSENT +│ ├── • 52 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 104, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 104, Name: public} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 104, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • Database:{DescID: 104} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED Database:{DescID: 104} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ ├── • DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • DatabaseRegionConfig:{DescID: 104, ReferencedDescID: 105} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ +│ │ ├── • Namespace:{DescID: 106, Name: public, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 106} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 106, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 106, Name: public} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 106, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • Schema:{DescID: 106} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED Schema:{DescID: 106} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ ├── • SchemaParent:{DescID: 106, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Namespace:{DescID: 105, Name: crdb_internal_region, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 105} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 105, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 105, Name: public} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 105, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • EnumType:{DescID: 105} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED EnumType:{DescID: 105} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ ├── • EnumTypeValue:{DescID: 105, Name: us-east1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • EnumTypeValue:{DescID: 105, Name: us-east2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • EnumTypeValue:{DescID: 105, Name: us-east3} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • ObjectParent:{DescID: 105, ReferencedDescID: 106} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Namespace:{DescID: 107, Name: _crdb_internal_region, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 107} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 107, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 107, Name: public} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 107, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • AliasType:{DescID: 107} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED AliasType:{DescID: 107} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ ├── • ObjectParent:{DescID: 107, ReferencedDescID: 106} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 108} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 108, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 108, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • Table:{DescID: 108} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} +│ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ │ WRITE_ONLY → DELETE_ONLY @@ -83,28 +422,182 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 108, Name: a, ColumnID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ -│ │ └── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} -│ │ │ VALIDATED → DELETE_ONLY +│ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ rule: "column no longer public before dependents" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index dependents removal ops on relation drop" +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ │ VALIDATED → DELETE_ONLY +│ │ │ │ +│ │ │ ├── • skip VALIDATED → WRITE_ONLY operations +│ │ │ │ rule: "skip index removal ops on relation drop" +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip index removal ops on relation drop" +│ │ │ +│ │ └── • IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} +│ │ │ PUBLIC → ABSENT │ │ │ -│ │ ├── • skip VALIDATED → WRITE_ONLY operations -│ │ │ rule: "skip index removal ops on relation drop" +│ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" │ │ │ -│ │ └── • skip WRITE_ONLY → DELETE_ONLY operations -│ │ rule: "skip index removal ops on relation drop" +│ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ rule: "index no longer public before dependents" +│ │ │ +│ │ └── • skip PUBLIC → ABSENT operations +│ │ rule: "skip index dependents removal ops on relation drop" │ │ -│ └── • 6 Mutation operations +│ └── • 20 Mutation operations +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 104 +│ │ +│ ├── • RemoveDatabaseRoleSettings +│ │ DatabaseID: 104 +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 106 +│ │ +│ ├── • RemoveSchemaParent +│ │ Parent: +│ │ ParentDatabaseID: 104 +│ │ SchemaID: 106 +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 105 +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 107 +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 108 +│ │ +│ ├── • RemoveAllTableComments +│ │ TableID: 108 +│ │ +│ ├── • RemoveBackReferenceInTypes +│ │ BackReferencedDescID: 108 +│ │ TypeIDs: +│ │ - 105 +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DescriptorID: 104 +│ │ Name: multi_region_test_db +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DatabaseID: 104 +│ │ DescriptorID: 106 +│ │ Name: public +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DatabaseID: 104 +│ │ DescriptorID: 105 +│ │ Name: crdb_internal_region +│ │ SchemaID: 106 +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DatabaseID: 104 +│ │ DescriptorID: 107 +│ │ Name: _crdb_internal_region +│ │ SchemaID: 106 +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DatabaseID: 104 +│ │ DescriptorID: 108 +│ │ Name: table_regional_by_table +│ │ SchemaID: 106 │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 @@ -137,7 +630,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ - 108 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 14 MutationType ops +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 14 MutationType ops │ pending │ Statements: │ - statement: DROP DATABASE multi_region_test_db CASCADE @@ -146,529 +639,39 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ └── • PostCommitNonRevertiblePhase │ - ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase - │ │ - │ ├── • 48 elements transitioning toward ABSENT - │ │ │ - │ │ ├── • Namespace:{DescID: 104, Name: multi_region_test_db, ReferencedDescID: 0} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 104, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 104, Name: public} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 104, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • Database:{DescID: 104} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ ├── • DatabaseRoleSetting:{DescID: 104, Name: __placeholder_role_name__} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • DatabaseRegionConfig:{DescID: 104, ReferencedDescID: 105} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ - │ │ ├── • Namespace:{DescID: 106, Name: public, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 106} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 106, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 106, Name: public} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 106, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • Schema:{DescID: 106} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ ├── • SchemaParent:{DescID: 106, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Namespace:{DescID: 105, Name: crdb_internal_region, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 105} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 105, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 105, Name: public} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 105, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • EnumType:{DescID: 105} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ ├── • EnumTypeValue:{DescID: 105, Name: us-east1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • EnumTypeValue:{DescID: 105, Name: us-east2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • EnumTypeValue:{DescID: 105, Name: us-east3} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • ObjectParent:{DescID: 105, ReferencedDescID: 106} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Namespace:{DescID: 107, Name: _crdb_internal_region, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 107} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 107, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 107, Name: public} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 107, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • AliasType:{DescID: 107} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ ├── • ObjectParent:{DescID: 107, ReferencedDescID: 106} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED AliasType:{DescID: 107} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Database:{DescID: 104} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 108} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 108, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 108, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • Table:{DescID: 108} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED EnumType:{DescID: 105} - │ │ │ │ rule: "descriptor drop right before removing dependent with attr ref" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: a, ColumnID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index dependents removal ops on relation drop" - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ └── • IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} - │ │ │ PUBLIC → ABSENT - │ │ │ - │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ rule: "index no longer public before dependents" - │ │ │ - │ │ └── • skip PUBLIC → ABSENT operations - │ │ rule: "skip index dependents removal ops on relation drop" - │ │ - │ └── • 20 Mutation operations - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 104 - │ │ - │ ├── • RemoveDatabaseRoleSettings - │ │ DatabaseID: 104 - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 106 - │ │ - │ ├── • RemoveSchemaParent - │ │ Parent: - │ │ ParentDatabaseID: 104 - │ │ SchemaID: 106 - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 105 - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 107 - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 108 - │ │ - │ ├── • RemoveAllTableComments - │ │ TableID: 108 - │ │ - │ ├── • RemoveBackReferenceInTypes - │ │ BackReferencedDescID: 108 - │ │ TypeIDs: - │ │ - 105 - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DescriptorID: 104 - │ │ Name: multi_region_test_db - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DatabaseID: 104 - │ │ DescriptorID: 106 - │ │ Name: public - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DatabaseID: 104 - │ │ DescriptorID: 105 - │ │ Name: crdb_internal_region - │ │ SchemaID: 106 - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DatabaseID: 104 - │ │ DescriptorID: 107 - │ │ Name: _crdb_internal_region - │ │ SchemaID: 106 - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DatabaseID: 104 - │ │ DescriptorID: 108 - │ │ Name: table_regional_by_table - │ │ SchemaID: 106 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 104 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 105 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 106 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 107 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 108 - │ │ - │ └── • UpdateSchemaChangerJob - │ IsNonCancelable: true - │ JobID: 1 - │ RunningStatus: PostCommitNonRevertiblePhase stage 2 of 2 with 14 MutationType ops - │ pending - │ - └── • Stage 2 of 2 in PostCommitNonRevertiblePhase + └── • Stage 1 of 1 in PostCommitNonRevertiblePhase │ ├── • 9 elements transitioning toward ABSENT │ │ │ ├── • Database:{DescID: 104} - │ │ DROPPED → ABSENT + │ │ │ DROPPED → ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DROPPED Database:{DescID: 104} + │ │ rule: "descriptor DROPPED in transaction before removal" │ │ │ ├── • Schema:{DescID: 106} - │ │ DROPPED → ABSENT + │ │ │ DROPPED → ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DROPPED Schema:{DescID: 106} + │ │ rule: "descriptor DROPPED in transaction before removal" │ │ │ ├── • EnumType:{DescID: 105} - │ │ DROPPED → ABSENT + │ │ │ DROPPED → ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DROPPED EnumType:{DescID: 105} + │ │ rule: "descriptor DROPPED in transaction before removal" │ │ │ ├── • AliasType:{DescID: 107} - │ │ DROPPED → ABSENT + │ │ │ DROPPED → ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DROPPED AliasType:{DescID: 107} + │ │ rule: "descriptor DROPPED in transaction before removal" │ │ │ ├── • Table:{DescID: 108} - │ │ DROPPED → ABSENT + │ │ │ DROPPED → ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DROPPED Table:{DescID: 108} + │ │ rule: "descriptor DROPPED in transaction before removal" │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ DELETE_ONLY → ABSENT diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion index 67e911605293..1bf6c136a867 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion @@ -57,7 +57,67 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 5 elements transitioning toward ABSENT +│ ├── • 26 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 108} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 108, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 108, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • Table:{DescID: 108} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • TableLocalityRegionalByRow:{DescID: 108} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ │ WRITE_ONLY → DELETE_ONLY @@ -65,34 +125,219 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 108, Name: k, ColumnID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 2} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from ABSENT ColumnDefaultExpression:{DescID: 108, ColumnID: 2} +│ │ │ rule: "column type dependents removed right before column type" +│ │ │ +│ │ ├── • ColumnDefaultExpression:{DescID: 108, ColumnID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ -│ │ └── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} -│ │ │ VALIDATED → DELETE_ONLY +│ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ rule: "column no longer public before dependents" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index dependents removal ops on relation drop" +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index dependents removal ops on relation drop" +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ │ VALIDATED → DELETE_ONLY +│ │ │ │ +│ │ │ ├── • skip VALIDATED → WRITE_ONLY operations +│ │ │ │ rule: "skip index removal ops on relation drop" +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip index removal ops on relation drop" +│ │ │ +│ │ ├── • IndexPartitioning:{DescID: 108, IndexID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index dependents removal ops on relation drop" +│ │ │ +│ │ └── • IndexName:{DescID: 108, Name: table_regional_by_row_pkey, IndexID: 1} +│ │ │ PUBLIC → ABSENT │ │ │ -│ │ ├── • skip VALIDATED → WRITE_ONLY operations -│ │ │ rule: "skip index removal ops on relation drop" +│ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" │ │ │ -│ │ └── • skip WRITE_ONLY → DELETE_ONLY operations -│ │ rule: "skip index removal ops on relation drop" +│ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ rule: "index no longer public before dependents" +│ │ │ +│ │ └── • skip PUBLIC → ABSENT operations +│ │ rule: "skip index dependents removal ops on relation drop" │ │ -│ └── • 4 Mutation operations +│ └── • 11 Mutation operations +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 108 +│ │ +│ ├── • RemoveAllTableComments +│ │ TableID: 108 +│ │ +│ ├── • RemoveColumnDefaultExpression +│ │ ColumnID: 2 +│ │ TableID: 108 +│ │ +│ ├── • UpdateTableBackReferencesInTypes +│ │ BackReferencedTableID: 108 +│ │ TypeIDs: +│ │ - 105 +│ │ - 107 +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DatabaseID: 104 +│ │ DescriptorID: 108 +│ │ Name: table_regional_by_row +│ │ SchemaID: 106 +│ │ +│ ├── • RemoveDroppedColumnType +│ │ ColumnID: 2 +│ │ TableID: 108 +│ │ +│ ├── • UpdateTableBackReferencesInTypes +│ │ BackReferencedTableID: 108 +│ │ TypeIDs: +│ │ - 105 +│ │ - 107 │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 105 @@ -115,7 +360,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ - 108 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 6 MutationType ops pending │ Statements: │ - statement: DROP TABLE multi_region_test_db.public.table_regional_by_row │ redactedstatement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› @@ -123,274 +368,15 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ └── • PostCommitNonRevertiblePhase │ - ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase - │ │ - │ ├── • 21 elements transitioning toward ABSENT - │ │ │ - │ │ ├── • Namespace:{DescID: 108, Name: table_regional_by_row, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 108} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 108, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 108, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • Table:{DescID: 108} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • TableLocalityRegionalByRow:{DescID: 108} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: k, ColumnID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: crdb_region, ColumnID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from ABSENT ColumnDefaultExpression:{DescID: 108, ColumnID: 2} - │ │ │ rule: "column type dependents removed right before column type" - │ │ │ - │ │ ├── • ColumnDefaultExpression:{DescID: 108, ColumnID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 2} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index dependents removal ops on relation drop" - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index dependents removal ops on relation drop" - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • IndexPartitioning:{DescID: 108, IndexID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index dependents removal ops on relation drop" - │ │ │ - │ │ └── • IndexName:{DescID: 108, Name: table_regional_by_row_pkey, IndexID: 1} - │ │ │ PUBLIC → ABSENT - │ │ │ - │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ rule: "index no longer public before dependents" - │ │ │ - │ │ └── • skip PUBLIC → ABSENT operations - │ │ rule: "skip index dependents removal ops on relation drop" - │ │ - │ └── • 11 Mutation operations - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 108 - │ │ - │ ├── • RemoveAllTableComments - │ │ TableID: 108 - │ │ - │ ├── • RemoveColumnDefaultExpression - │ │ ColumnID: 2 - │ │ TableID: 108 - │ │ - │ ├── • UpdateTableBackReferencesInTypes - │ │ BackReferencedTableID: 108 - │ │ TypeIDs: - │ │ - 105 - │ │ - 107 - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DatabaseID: 104 - │ │ DescriptorID: 108 - │ │ Name: table_regional_by_row - │ │ SchemaID: 106 - │ │ - │ ├── • RemoveDroppedColumnType - │ │ ColumnID: 2 - │ │ TableID: 108 - │ │ - │ ├── • UpdateTableBackReferencesInTypes - │ │ BackReferencedTableID: 108 - │ │ TypeIDs: - │ │ - 105 - │ │ - 107 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 105 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 107 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 108 - │ │ - │ └── • UpdateSchemaChangerJob - │ IsNonCancelable: true - │ JobID: 1 - │ RunningStatus: PostCommitNonRevertiblePhase stage 2 of 2 with 6 MutationType ops pending - │ - └── • Stage 2 of 2 in PostCommitNonRevertiblePhase + └── • Stage 1 of 1 in PostCommitNonRevertiblePhase │ ├── • 6 elements transitioning toward ABSENT │ │ │ ├── • Table:{DescID: 108} - │ │ DROPPED → ABSENT + │ │ │ DROPPED → ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DROPPED Table:{DescID: 108} + │ │ rule: "descriptor DROPPED in transaction before removal" │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ DELETE_ONLY → ABSENT diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region index bed484f218e5..932e05048a03 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region @@ -51,7 +51,67 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 4 elements transitioning toward ABSENT +│ ├── • 20 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 108} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 108, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 108, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • Table:{DescID: 108} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ │ WRITE_ONLY → DELETE_ONLY @@ -59,28 +119,137 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 108, Name: a, ColumnID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 4294967295} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 108, ColumnID: 4294967294} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ -│ │ └── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} -│ │ │ VALIDATED → DELETE_ONLY +│ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} +│ │ │ rule: "column no longer public before dependents" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index dependents removal ops on relation drop" +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ │ VALIDATED → DELETE_ONLY +│ │ │ │ +│ │ │ ├── • skip VALIDATED → WRITE_ONLY operations +│ │ │ │ rule: "skip index removal ops on relation drop" +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip index removal ops on relation drop" +│ │ │ +│ │ └── • IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} +│ │ │ PUBLIC → ABSENT │ │ │ -│ │ ├── • skip VALIDATED → WRITE_ONLY operations -│ │ │ rule: "skip index removal ops on relation drop" +│ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} +│ │ │ rule: "descriptor drop right before dependent element removal" │ │ │ -│ │ └── • skip WRITE_ONLY → DELETE_ONLY operations -│ │ rule: "skip index removal ops on relation drop" +│ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} +│ │ │ rule: "index no longer public before dependents" +│ │ │ +│ │ └── • skip PUBLIC → ABSENT operations +│ │ rule: "skip index dependents removal ops on relation drop" │ │ -│ └── • 3 Mutation operations +│ └── • 7 Mutation operations +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 108 +│ │ +│ ├── • RemoveAllTableComments +│ │ TableID: 108 +│ │ +│ ├── • RemoveBackReferenceInTypes +│ │ BackReferencedDescID: 108 +│ │ TypeIDs: +│ │ - 105 +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DatabaseID: 104 +│ │ DescriptorID: 108 +│ │ Name: table_regional_by_table +│ │ SchemaID: 106 │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 105 @@ -98,7 +267,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ - 108 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops pending │ Statements: │ - statement: DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE │ redactedstatement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› @@ -107,195 +276,15 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ └── • PostCommitNonRevertiblePhase │ - ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase - │ │ - │ ├── • 16 elements transitioning toward ABSENT - │ │ │ - │ │ ├── • Namespace:{DescID: 108, Name: table_regional_by_table, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 108} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 108, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 108, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • Table:{DescID: 108} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ ├── • ObjectParent:{DescID: 108, ReferencedDescID: 106} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • TableLocalitySecondaryRegion:{DescID: 108, ReferencedDescID: 105} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: a, ColumnID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967295} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 4294967294} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 108, ColumnID: 1} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index dependents removal ops on relation drop" - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ └── • IndexName:{DescID: 108, Name: table_regional_by_table_pkey, IndexID: 1} - │ │ │ PUBLIC → ABSENT - │ │ │ - │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 108} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1} - │ │ │ rule: "index no longer public before dependents" - │ │ │ - │ │ └── • skip PUBLIC → ABSENT operations - │ │ rule: "skip index dependents removal ops on relation drop" - │ │ - │ └── • 7 Mutation operations - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 108 - │ │ - │ ├── • RemoveAllTableComments - │ │ TableID: 108 - │ │ - │ ├── • RemoveBackReferenceInTypes - │ │ BackReferencedDescID: 108 - │ │ TypeIDs: - │ │ - 105 - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DatabaseID: 104 - │ │ DescriptorID: 108 - │ │ Name: table_regional_by_table - │ │ SchemaID: 106 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 105 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 108 - │ │ - │ └── • UpdateSchemaChangerJob - │ IsNonCancelable: true - │ JobID: 1 - │ RunningStatus: PostCommitNonRevertiblePhase stage 2 of 2 with 5 MutationType ops pending - │ - └── • Stage 2 of 2 in PostCommitNonRevertiblePhase + └── • Stage 1 of 1 in PostCommitNonRevertiblePhase │ ├── • 5 elements transitioning toward ABSENT │ │ │ ├── • Table:{DescID: 108} - │ │ DROPPED → ABSENT + │ │ │ DROPPED → ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DROPPED Table:{DescID: 108} + │ │ rule: "descriptor DROPPED in transaction before removal" │ │ │ ├── • Column:{DescID: 108, ColumnID: 1} │ │ │ DELETE_ONLY → ABSENT diff --git a/pkg/sql/opt/exec/execbuilder/testdata/show_trace b/pkg/sql/opt/exec/execbuilder/testdata/show_trace index 192e5ca1c607..4a75e41327af 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/show_trace +++ b/pkg/sql/opt/exec/execbuilder/testdata/show_trace @@ -164,9 +164,9 @@ SET tracing = off query TT $trace_query ---- -batch flow coordinator Put /Table/3/1/109/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:OFFLINE offline_reason:"DROP TABLE t.public.kv2" view_query:"" is_materialized_view:false refresh_view_required:false drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:2 import_start_wall_time:0 > -sql query rows affected: 0 -commit sql txn Put /Table/3/1/109/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:OFFLINE offline_reason:"DROP TABLE t.public.kv2" view_query:"" is_materialized_view:false refresh_view_required:false declarative_schema_changer_state:<...> > metadata:<...> target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:OFFLINE current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:VALIDATED current_statuses:PUBLIC target_ranks:0 target_ranks:1 target_ranks:2 target_ranks:3 target_ranks:4 target_ranks:5 target_ranks:6 target_ranks:7 target_ranks:8 target_ranks:9 target_ranks:10 target_ranks:11 target_ranks:12 target_ranks:13 target_ranks:14 target_ranks:15 target_ranks:16 target_ranks:17 target_ranks:18 target_ranks:19 target_ranks:20 target_ranks:21 target_ranks:22 target_ranks:23 target_ranks:24 target_ranks:25 target_ranks:26 target_ranks:27 relevant_statements: > authorization: > drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:2 import_start_wall_time:0 > +sql query rows affected: 0 +commit sql txn Put /Table/3/1/109/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false refresh_view_required:false declarative_schema_changer_state:<...> > metadata:<...> target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DROPPED current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT target_ranks:0 target_ranks:1 target_ranks:2 target_ranks:3 target_ranks:4 target_ranks:5 target_ranks:6 target_ranks:7 target_ranks:8 target_ranks:9 target_ranks:10 target_ranks:11 target_ranks:12 target_ranks:13 target_ranks:14 target_ranks:15 target_ranks:16 target_ranks:17 target_ranks:18 target_ranks:19 target_ranks:20 target_ranks:21 target_ranks:22 target_ranks:23 target_ranks:24 target_ranks:25 target_ranks:26 target_ranks:27 relevant_statements: > authorization: > drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:2 import_start_wall_time:0 > +commit sql txn Del /NamespaceTable/30/1/106/107/"kv2"/4/1 statement ok SET tracing = on,kv,results; DELETE FROM t.kv @@ -205,9 +205,9 @@ SET tracing = off query TT $trace_query ---- -batch flow coordinator Put /Table/3/1/108/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false > next_index_id:4 privileges: users: owner_proto:"root" version:2 > next_mutation_id:3 format_version:3 state:OFFLINE offline_reason:"DROP TABLE t.public.kv" view_query:"" is_materialized_view:false refresh_view_required:false drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:4 import_start_wall_time:0 > -sql query rows affected: 0 -commit sql txn Put /Table/3/1/108/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false > next_index_id:4 privileges: users: owner_proto:"root" version:2 > next_mutation_id:3 format_version:3 state:OFFLINE offline_reason:"DROP TABLE t.public.kv" view_query:"" is_materialized_view:false refresh_view_required:false declarative_schema_changer_state:<...> > metadata:<...> target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:OFFLINE current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:WRITE_ONLY current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:PUBLIC current_statuses:VALIDATED current_statuses:PUBLIC target_ranks:0 target_ranks:1 target_ranks:2 target_ranks:3 target_ranks:4 target_ranks:5 target_ranks:6 target_ranks:7 target_ranks:8 target_ranks:9 target_ranks:10 target_ranks:11 target_ranks:12 target_ranks:13 target_ranks:14 target_ranks:15 target_ranks:16 target_ranks:17 target_ranks:18 target_ranks:19 target_ranks:20 target_ranks:21 target_ranks:22 relevant_statements: > authorization: > drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:4 import_start_wall_time:0 > +sql query rows affected: 0 +commit sql txn Put /Table/3/1/108/2/1 -> table: parent_id:106 unexposed_parent_schema_id:107 columns: nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" use_delete_preserving_encoding:false created_at_nanos:... constraint_id:1 not_visible:false > next_index_id:4 privileges: users: owner_proto:"root" version:2 > next_mutation_id:3 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false refresh_view_required:false declarative_schema_changer_state:<...> > metadata:<...> target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > is_nullable:true is_relation_being_dropped:true > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > targets: > > metadata: target_status:ABSENT > targets: > metadata: target_status:ABSENT > current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DROPPED current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:ABSENT current_statuses:DELETE_ONLY current_statuses:ABSENT target_ranks:0 target_ranks:1 target_ranks:2 target_ranks:3 target_ranks:4 target_ranks:5 target_ranks:6 target_ranks:7 target_ranks:8 target_ranks:9 target_ranks:10 target_ranks:11 target_ranks:12 target_ranks:13 target_ranks:14 target_ranks:15 target_ranks:16 target_ranks:17 target_ranks:18 target_ranks:19 target_ranks:20 target_ranks:21 target_ranks:22 relevant_statements: > authorization: > drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false exclude_data_from_backup:false next_constraint_id:4 import_start_wall_time:0 > +commit sql txn Del /NamespaceTable/30/1/106/107/"kv"/4/1 # Check that session tracing does not inhibit the fast path for inserts & # friends (the path resulting in 1PC transactions). diff --git a/pkg/sql/schemachanger/scop/ops.go b/pkg/sql/schemachanger/scop/ops.go index 2c1f7d57f4e5..a89fbbe01c12 100644 --- a/pkg/sql/schemachanger/scop/ops.go +++ b/pkg/sql/schemachanger/scop/ops.go @@ -16,7 +16,7 @@ type Op interface { } // Type represents the type of operation for an Op. Ops can be grouped into the -// the same Stage only if they share a type. +// same Stage only if they share a type. type Type int //go:generate stringer -type=Type @@ -30,6 +30,13 @@ const ( // ValidationType represents constraint and unique index validations // performed using internal queries. ValidationType + + maxType int = iota - 1 ) +// IsValid is true if the Type has a valid value. +func (t Type) IsValid() bool { + return t > 0 && t <= Type(maxType) +} + type baseOp struct{} diff --git a/pkg/sql/schemachanger/scpb/constants.go b/pkg/sql/schemachanger/scpb/constants.go index b271304f431b..354c74a19b32 100644 --- a/pkg/sql/schemachanger/scpb/constants.go +++ b/pkg/sql/schemachanger/scpb/constants.go @@ -10,6 +10,8 @@ package scpb +import "github.com/cockroachdb/errors" + const ( // PlaceHolderRoleName placeholder string for non-fetched role names. PlaceHolderRoleName string = "__placeholder_role_name__" @@ -46,6 +48,18 @@ func (t TargetStatus) Status() Status { return Status(t) } +// InitialStatus returns the initial status for this TargetStatus. +func (t TargetStatus) InitialStatus() Status { + switch t { + case ToAbsent: + return Status_PUBLIC + case ToPublic, Transient: + return Status_ABSENT + default: + panic(errors.AssertionFailedf("unknown target status %v", t.Status())) + } +} + // AsTargetStatus returns the Status as a TargetStatus. func AsTargetStatus(s Status) TargetStatus { switch s { diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/BUILD.bazel b/pkg/sql/schemachanger/scplan/internal/opgen/BUILD.bazel index 36287b0db1c5..fc43df005141 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/BUILD.bazel +++ b/pkg/sql/schemachanger/scplan/internal/opgen/BUILD.bazel @@ -66,6 +66,7 @@ go_library( "//pkg/sql/schemachanger/scplan/internal/scgraph", "//pkg/sql/schemachanger/screl", "//pkg/sql/sem/catid", + "//pkg/util/iterutil", "//pkg/util/log", "//pkg/util/protoutil", "//pkg/util/timeutil", diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/op_gen.go b/pkg/sql/schemachanger/scplan/internal/opgen/op_gen.go index 688022d636d0..fc6663e016ed 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/op_gen.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/op_gen.go @@ -18,15 +18,66 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" + "github.com/cockroachdb/cockroach/pkg/util/iterutil" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/timeutil" + "github.com/cockroachdb/errors" ) type registry struct { - targets []target + targets []target + targetMap map[targetKey]int } -var opRegistry = ®istry{} +type targetKey struct { + elType reflect.Type + targetStatus scpb.Status +} + +var opRegistry = ®istry{ + targetMap: make(map[targetKey]int), +} + +// Transition is used to introspect the operation transitions for elements. +type Transition interface { + From() scpb.Status + To() scpb.Status + OpType() scop.Type +} + +// HasTransient returns true if the element of this type has +// Transient transitions +func HasTransient(elType scpb.Element) bool { + return hasTarget(elType, scpb.Transient) +} + +// HasPublic returns true if the element of this type has +// ToPublic transitions +func HasPublic(elType scpb.Element) bool { + return hasTarget(elType, scpb.ToPublic) +} + +func hasTarget(elType scpb.Element, s scpb.TargetStatus) bool { + _, ok := findTarget(elType, s.Status()) + return ok +} + +// IterateTransitions iterates the transitions for a given element and +// TargetStatus. +func IterateTransitions( + elType scpb.Element, target scpb.TargetStatus, fn func(t Transition) error, +) error { + t, ok := findTarget(elType, target.Status()) + if !ok { + return errors.Errorf("failed to find table %T to %v", elType, target) + } + for i := range t.transitions { + if err := fn(&t.transitions[i]); err != nil { + return iterutil.Map(err) + } + } + return nil +} // BuildGraph constructs a graph with operation edges populated from an initial // state. @@ -78,7 +129,7 @@ func (r *registry) buildGraph(cs scpb.CurrentState) (_ *scgraph.Graph, err error ops = e.ops(e.n.Element(), &md) } if err := g.AddOpEdges( - e.n.Target, e.from, e.to, e.revertible, e.canFail, e.minPhase, ops..., + e.n.Target, e.from, e.to, e.revertible, e.canFail, ops..., ); err != nil { return nil, err } @@ -110,16 +161,9 @@ func NextStatus(e scpb.Element, target, current scpb.Status) scpb.Status { } func findTarget(e scpb.Element, s scpb.Status) (_ target, found bool) { - et := reflect.TypeOf(e) - for _, t := range opRegistry.targets { - if t.status != s { - continue - } - if reflect.TypeOf(t.e) != et { - continue - } - return t, true /* found */ - + idx, ok := opRegistry.targetMap[makeTargetKey(reflect.TypeOf(e), s)] + if !ok { + return target{}, false } - return target{}, false /* found */ + return opRegistry.targets[idx], true } diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/register.go b/pkg/sql/schemachanger/scplan/internal/opgen/register.go index e86909da2b30..ea7390354d74 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/register.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/register.go @@ -62,7 +62,20 @@ func (r *registry) register(e scpb.Element, targetSpecs ...targetSpec) { targets, err := buildTargets(e, fullTargetSpecs) onErrPanic(err) onErrPanic(validateTargets(targets)) + start := len(r.targets) r.targets = append(r.targets, targets...) + elType := reflect.TypeOf(e) + for i := range targets { + r.targetMap[makeTargetKey(elType, targets[i].status)] = start + i + } + +} + +func makeTargetKey(elType reflect.Type, status scpb.Status) targetKey { + return targetKey{ + elType: elType, + targetStatus: status, + } } func populateAndValidateSpecs(targetSpecs []targetSpec) ([]targetSpec, error) { diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/target.go b/pkg/sql/schemachanger/scplan/internal/opgen/target.go index be20f91cf563..ff5600c900e1 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/target.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/target.go @@ -34,7 +34,18 @@ type transition struct { canFail bool ops opsFunc opType scop.Type - minPhase scop.Phase +} + +func (t transition) OpType() scop.Type { + return t.opType +} + +func (t transition) From() scpb.Status { + return t.from +} + +func (t transition) To() scpb.Status { + return t.to } func makeTarget(e scpb.Element, spec targetSpec) (t target, err error) { @@ -106,7 +117,6 @@ func makeTransitions(e scpb.Element, spec targetSpec) (ret []transition, err err } } t.revertible = tbs.isRevertible - t.minPhase = tbs.currentMinPhase if t.opType != scop.MutationType && t.opType != 0 { lastTransitionWhichCanFail = i } @@ -129,9 +139,8 @@ func makeTransitions(e scpb.Element, spec targetSpec) (ret []transition, err err } type transitionBuildState struct { - from scpb.Status - currentMinPhase scop.Phase - isRevertible bool + from scpb.Status + isRevertible bool isEquivMapped map[scpb.Status]bool isTo map[scpb.Status]bool @@ -159,11 +168,7 @@ func (tbs *transitionBuildState) withTransition(s transitionSpec, isFirst bool) return errors.Errorf("%s was featured as 'from' in a previous equivalence mapping", s.to) } - // Check that the minimum phase is monotonically increasing. tbs.isRevertible = tbs.isRevertible && s.revertible - if !isFirst && tbs.currentMinPhase < scop.PostCommitPhase { - tbs.currentMinPhase = scop.PostCommitPhase - } tbs.isEquivMapped[tbs.from] = true tbs.isTo[s.to] = true tbs.isFrom[tbs.from] = true diff --git a/pkg/sql/schemachanger/scplan/internal/rules/BUILD.bazel b/pkg/sql/schemachanger/scplan/internal/rules/BUILD.bazel index a242eb13e2ec..a64d9aba221c 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/BUILD.bazel +++ b/pkg/sql/schemachanger/scplan/internal/rules/BUILD.bazel @@ -14,6 +14,7 @@ go_library( "dep_drop_index_and_column.go", "dep_drop_object.go", "dep_swap_index.go", + "dep_two_version.go", "helpers.go", "op_drop.go", "op_index_and_column.go", @@ -25,6 +26,7 @@ go_library( "//pkg/sql/catalog/descpb", "//pkg/sql/schemachanger/rel", "//pkg/sql/schemachanger/scpb", + "//pkg/sql/schemachanger/scplan/internal/opgen", "//pkg/sql/schemachanger/scplan/internal/scgraph", "//pkg/sql/schemachanger/screl", "//pkg/sql/sem/catid", diff --git a/pkg/sql/schemachanger/scplan/internal/rules/dep_drop_object.go b/pkg/sql/schemachanger/scplan/internal/rules/dep_drop_object.go index 485b29140476..71218ce6c5cb 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/dep_drop_object.go +++ b/pkg/sql/schemachanger/scplan/internal/rules/dep_drop_object.go @@ -18,7 +18,11 @@ import ( ) // These rules ensure that: -// - a descriptor element reaches the DROPPED state in the statement txn before +// - a descriptor reaches the TXN_DROPPED state in the statement phase, and +// it does not reach DROPPED until the pre-commit phase. +// - a descriptor reaches ABSENT in a different transaction than it reaches +// DROPPED (i.e. it cannot be removed until PostCommit). +// - a descriptor element reaches the DROPPED state in the txn before // its dependent elements (namespace entry, comments, column names, etc) reach // the ABSENT state; // - for those dependent elements which have to wait post-commit to reach the @@ -28,6 +32,31 @@ import ( // removal. func init() { + registerDepRule( + "descriptor TXN_DROPPED before DROPPED", + scgraph.PreviousStagePrecedence, + "txn_dropped", "dropped", + func(from, to nodeVars) rel.Clauses { + return rel.Clauses{ + from.typeFilter(IsDescriptor), + from.el.AttrEqVar(screl.DescID, "_"), + from.el.AttrEqVar(rel.Self, to.el), + statusesToAbsent(from, scpb.Status_TXN_DROPPED, to, scpb.Status_DROPPED), + } + }) + registerDepRule( + "descriptor DROPPED in transaction before removal", + scgraph.PreviousTransactionPrecedence, + "dropped", "absent", + func(from, to nodeVars) rel.Clauses { + return rel.Clauses{ + from.typeFilter(IsDescriptor), + from.el.AttrEqVar(screl.DescID, "_"), + from.el.AttrEqVar(rel.Self, to.el), + statusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }) + registerDepRule( "descriptor drop right before dependent element removal", scgraph.SameStagePrecedence, diff --git a/pkg/sql/schemachanger/scplan/internal/rules/dep_two_version.go b/pkg/sql/schemachanger/scplan/internal/rules/dep_two_version.go new file mode 100644 index 000000000000..f54fc2b67323 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/dep_two_version.go @@ -0,0 +1,162 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package rules + +import ( + "fmt" + "reflect" + "strings" + + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/opgen" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// These rules ensure that changes to properties of descriptors which need to +// be sequenced in order to safely enact online schema changes are sequenced +// in separate transactions. +func init() { + + findNoopSourceStatuses := func( + el scpb.Element, targetStatus scpb.TargetStatus, + ) map[scpb.Status][]scpb.Status { + // We want to skip the dependency edges if the status which got us into + // the current status was a no-op. We track the no-op status parent nodes, + // and we'll add a not-join to make sure there does not exist a node + // with such a status when installing the rule. + // + // This is necessary to deal with cases like the transition from + // BACKFILL_ONLY to its equivalent DELETE_ONLY in the rollback of an + // ADD COLUMN. We don't want or need a dependency edge from DELETE_ONLY + // to ABSENT in that case, but if we didn't check whether we got to + // DELETE_ONLY from BACKFILL_ONLY, then we'd have one implicitly. + statusMap := map[scpb.Status][]scpb.Status{} + if err := opgen.IterateTransitions(el, targetStatus, func( + t opgen.Transition, + ) error { + if !t.OpType().IsValid() { + statusMap[t.To()] = append(statusMap[t.To()], t.From()) + } + return nil + }); err != nil { + panic(err) + } + return statusMap + } + clausesForTwoVersionEdge := func( + from, to nodeVars, + el scpb.Element, + targetStatus scpb.TargetStatus, + t opgen.Transition, + prePrevStatuses []scpb.Status, + ) rel.Clauses { + clauses := rel.Clauses{ + from.Type(el), + to.Type(el), + from.el.AttrEqVar(screl.DescID, "_"), + from.el.AttrEqVar(rel.Self, to.el), + from.target.AttrEqVar(rel.Self, to.target), + from.target.AttrEq(screl.TargetStatus, targetStatus.Status()), + from.node.AttrEq(screl.CurrentStatus, t.From()), + to.node.AttrEq(screl.CurrentStatus, t.To()), + descriptorIsNotBeingDropped(from.el), + } + if len(prePrevStatuses) > 0 { + clauses = append(clauses, + getNotJoinOnNodeWithStatusIn(prePrevStatuses)(from.target), + ) + } + return clauses + } + addRules := func(el scpb.Element, targetStatus scpb.TargetStatus) { + statusMap := findNoopSourceStatuses(el, targetStatus) + if err := opgen.IterateTransitions(el, targetStatus, func( + t opgen.Transition, + ) error { + elemName := reflect.TypeOf(el).Elem().Name() + ruleName := scgraph.RuleName(fmt.Sprintf( + "%s transitions to %s uphold 2-version invariant: %s->%s", + elemName, targetStatus.Status(), t.From(), t.To(), + )) + registerDepRule( + ruleName, + scgraph.PreviousTransactionPrecedence, + "prev", "next", + func(from, to nodeVars) rel.Clauses { + return clausesForTwoVersionEdge( + from, to, el, targetStatus, t, statusMap[t.From()], + ) + }, + ) + return nil + }); err != nil { + panic(err) + } + } + _ = forEachElement(func(el scpb.Element) error { + if !isSubjectTo2VersionInvariant(el) { + return nil + } + if opgen.HasPublic(el) { + addRules(el, scpb.ToPublic) + } + if opgen.HasTransient(el) { + addRules(el, scpb.Transient) + } + addRules(el, scpb.ToAbsent) // every element has ToAbsent + return nil + }) +} + +// notJoinOnNodeWithStatusIn is a cache to memoize getNotJoinOnNodeWithStatusIn. +var notJoinOnNodeWithStatusIn = map[string]rel.Rule1{} + +// getNoJoinOnNodeWithStatusIn returns a not-join rule which takes a variable +// corresponding to a target in the graph as input and will exclude that target +// if the graph contains a node with that target in any of the listed status +// values. +func getNotJoinOnNodeWithStatusIn(statues []scpb.Status) rel.Rule1 { + makeStatusesStrings := func(statuses []scpb.Status) []string { + ret := make([]string, len(statuses)) + for i, status := range statuses { + ret[i] = status.String() + } + return ret + } + makeStatusesString := func(statuses []scpb.Status) string { + return strings.Join(makeStatusesStrings(statuses), "_") + } + boxStatuses := func(input []scpb.Status) []interface{} { + ret := make([]interface{}, len(input)) + for i, s := range input { + ret[i] = s + } + return ret + } + name := makeStatusesString(statues) + if got, ok := notJoinOnNodeWithStatusIn[name]; ok { + return got + } + r := screl.Schema.DefNotJoin1( + fmt.Sprintf("nodeNotExistsWithStatusIn_%s", name), + "sharedTarget", func(target rel.Var) rel.Clauses { + n := rel.Var("n") + return rel.Clauses{ + n.Type((*screl.Node)(nil)), + n.AttrEqVar(screl.Target, target), + n.AttrIn(screl.CurrentStatus, boxStatuses(statues)...), + } + }) + notJoinOnNodeWithStatusIn[name] = r + return r +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/helpers.go b/pkg/sql/schemachanger/scplan/internal/rules/helpers.go index 56c3d914f4cc..7bb690c66237 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/helpers.go +++ b/pkg/sql/schemachanger/scplan/internal/rules/helpers.go @@ -254,13 +254,17 @@ func forEachElement(fn func(element scpb.Element) error) error { // owns its corresponding descriptor. func IsDescriptor(e scpb.Element) bool { switch e.(type) { - case *scpb.Database, *scpb.Schema, *scpb.Table, *scpb.View, *scpb.Sequence, *scpb.AliasType, *scpb.EnumType: + case *scpb.Database, *scpb.Schema, *scpb.Table, *scpb.View, *scpb.Sequence, + *scpb.AliasType, *scpb.EnumType: return true } return false } func isSubjectTo2VersionInvariant(e scpb.Element) bool { + // TODO(ajwerner): This should include constraints and enum values but it + // currently does not because we do not support dropping them unless we're + // dropping the descriptor and we do not support adding them. return isIndex(e) || isColumn(e) } @@ -465,3 +469,20 @@ func registerDepRuleForDrop( ) }) } + +// descriptorIsNotBeingDropped creates a clause which leads to the outer clause +// failing to unify if the passed element is part of a descriptor and +// that descriptor is being dropped. +var descriptorIsNotBeingDropped = screl.Schema.DefNotJoin1( + "descriptorIsNotBeingDropped", "element", func( + element rel.Var, + ) rel.Clauses { + descriptor := mkNodeVars("descriptor") + return rel.Clauses{ + descriptor.typeFilter(IsDescriptor), + descriptor.joinTarget(), + joinOnDescIDUntyped(descriptor.el, element, "id"), + descriptor.targetStatus(scpb.ToAbsent), + } + }, +) diff --git a/pkg/sql/schemachanger/scplan/internal/rules/rules_test.go b/pkg/sql/schemachanger/scplan/internal/rules/rules_test.go index 2635acc9c610..9912e5909c0f 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/rules_test.go +++ b/pkg/sql/schemachanger/scplan/internal/rules/rules_test.go @@ -11,9 +11,7 @@ package rules import ( - "fmt" "sort" - "strings" "testing" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" @@ -40,16 +38,11 @@ func TestRulesYAML(t *testing.T) { return s[i].Name < s[j].Name }) for _, def := range s { - var clauses yaml.Node - if err := clauses.Encode(def.Clauses()); err != nil { + var rule yaml.Node + if err := rule.Encode(def); err != nil { panic(err) } - m.Content = append(m.Content, &yaml.Node{ - Kind: yaml.ScalarNode, - Value: fmt.Sprintf( - "%s(%v)", def.Name, strings.Join(toStrings(def.Params()), ", "), - ), - }, &clauses) + m.Content = append(m.Content, rule.Content...) } out, err := yaml.Marshal(m) if err != nil { @@ -83,14 +76,6 @@ func TestRulesYAML(t *testing.T) { }) } -func toStrings(params []rel.Var) []string { - ret := make([]string, 0, len(params)) - for _, p := range params { - ret = append(ret, string(p)) - } - return ret -} - func (r registeredDepRule) MarshalYAML() (interface{}, error) { var query yaml.Node if err := query.Encode(r.q.Clauses()); err != nil { diff --git a/pkg/sql/schemachanger/scplan/internal/rules/testdata/deprules b/pkg/sql/schemachanger/scplan/internal/rules/testdata/deprules index be551f8434aa..5ca9da05c0f8 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/testdata/deprules +++ b/pkg/sql/schemachanger/scplan/internal/rules/testdata/deprules @@ -1,54 +1,196 @@ rules ---- -columnInIndex(index-column, index, table-id, column-id, index-id): +columnInIndex($index-column, $index, $table-id, $column-id, $index-id): - $index-column[Type] = '*scpb.IndexColumn' - $index-column[DescID] = $_ - $index-column[ColumnID] = $column-id - $index[IndexID] = $index-id - joinOnIndexID($index, $index-column, $table-id, $index-id) -columnInSwappedInPrimaryIndex(index-column, index, table-id, column-id, index-id): +columnInSwappedInPrimaryIndex($index-column, $index, $table-id, $column-id, $index-id): - columnInIndex($index-column, $index, $table-id, $column-id, $index-id) - sourceIndexIsSet($index) -joinOnColumnID(a, b, desc-id, col-id): +descriptorIsNotBeingDropped($element): + not-join: + - $descriptor[Type] IN ['*scpb.Database', '*scpb.Schema', '*scpb.View', '*scpb.Sequence', '*scpb.Table', '*scpb.EnumType', '*scpb.AliasType'] + - joinTarget($descriptor, $descriptor-target) + - joinOnDescID($descriptor, $element, $id) + - $descriptor-target[TargetStatus] = ABSENT +joinOnColumnID($a, $b, $desc-id, $col-id): - joinOnDescID($a, $b, $desc-id) - $a[ColumnID] = $col-id - $b[ColumnID] = $col-id -joinOnConstraintID(a, b, desc-id, constraint-id): +joinOnConstraintID($a, $b, $desc-id, $constraint-id): - joinOnDescID($a, $b, $desc-id) - $a[ConstraintID] = $constraint-id - $b[ConstraintID] = $constraint-id -joinOnDescID(a, b, id): +joinOnDescID($a, $b, $id): - $a[DescID] = $id - $b[DescID] = $id -joinOnIndexID(a, b, desc-id, index-id): +joinOnIndexID($a, $b, $desc-id, $index-id): - joinOnDescID($a, $b, $desc-id) - $a[IndexID] = $index-id - $b[IndexID] = $index-id -joinReferencedDescID(referrer, referenced, id): +joinReferencedDescID($referrer, $referenced, $id): - $referrer[ReferencedDescID] = $id - $referenced[DescID] = $id -joinTarget(element, target): +joinTarget($element, $target): - $target[Type] = '*scpb.Target' - $target[Element] = $element - $element[DescID] = $_ -joinTargetNode(element, target, node): +joinTargetNode($element, $target, $node): - joinTarget($element, $target) - $node[Type] = '*screl.Node' - $node[Target] = $target -sourceIndexIsSet(index): +nodeNotExistsWithStatusIn_BACKFILLED_BACKFILL_ONLY($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [BACKFILLED, BACKFILL_ONLY] +nodeNotExistsWithStatusIn_TRANSIENT_BACKFILLED_TRANSIENT_BACKFILL_ONLY($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_BACKFILLED, TRANSIENT_BACKFILL_ONLY] +nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_DELETE_ONLY] +? nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY_BACKFILLED_TRANSIENT_BACKFILLED_BACKFILL_ONLY_TRANSIENT_BACKFILL_ONLY($sharedTarget) +: not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_DELETE_ONLY, BACKFILLED, TRANSIENT_BACKFILLED, BACKFILL_ONLY, TRANSIENT_BACKFILL_ONLY] +nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_VALIDATED] +nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_TRANSIENT_MERGE_ONLY_TRANSIENT_MERGED($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_VALIDATED, TRANSIENT_MERGE_ONLY, TRANSIENT_MERGED] +nodeNotExistsWithStatusIn_VALIDATED_MERGE_ONLY_MERGED($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [VALIDATED, MERGE_ONLY, MERGED] +nodeNotExistsWithStatusIn_VALIDATED_TRANSIENT_WRITE_ONLY_MERGE_ONLY_TRANSIENT_MERGE_ONLY_MERGED_TRANSIENT_MERGED($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [VALIDATED, TRANSIENT_WRITE_ONLY, MERGE_ONLY, TRANSIENT_MERGE_ONLY, MERGED, TRANSIENT_MERGED] +sourceIndexIsSet($index): - $index[SourceIndexID] != 0 -toAbsent(target1, target2): +toAbsent($target1, $target2): - $target1[TargetStatus] = ABSENT - $target2[TargetStatus] = ABSENT -toPublicOrTransient(target1, target2): +toPublicOrTransient($target1, $target2): - $target1[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] - $target2[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] -transient(target1, target2): +transient($target1, $target2): - $target1[TargetStatus] = TRANSIENT_ABSENT - $target2[TargetStatus] = TRANSIENT_ABSENT deprules ---- +- name: 'Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = PUBLIC + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = ABSENT + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) - name: DEFAULT or ON UPDATE existence precedes writes to column from: expr-node kind: Precedence @@ -62,6 +204,1038 @@ deprules - $column-node[CurrentStatus] = WRITE_ONLY - joinTargetNode($expr, $expr-target, $expr-node) - joinTargetNode($column, $column-target, $column-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = BACKFILLED + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = BACKFILL_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped($prev) + - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY_BACKFILLED_TRANSIENT_BACKFILLED_BACKFILL_ONLY_TRANSIENT_BACKFILL_ONLY($prev-target) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = MERGED + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = MERGE_ONLY + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = PUBLIC + - $next-node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_ABSENT + - $next-node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_BACKFILLED + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGED->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_MERGED + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_MERGE_ONLY + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = VALIDATED + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED($prev-target) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - nodeNotExistsWithStatusIn_VALIDATED_TRANSIENT_WRITE_ONLY_MERGE_ONLY_TRANSIENT_MERGE_ONLY_MERGED_TRANSIENT_MERGED($prev-target) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = ABSENT + - $next-node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = BACKFILLED + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = BACKFILL_ONLY + - $next-node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = MERGED + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = MERGE_ONLY + - $next-node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = VALIDATED + - $next-node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = ABSENT + - $next-node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = BACKFILLED + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = BACKFILL_ONLY + - $next-node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = MERGED + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = MERGE_ONLY + - $next-node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = PUBLIC + - $next-node[CurrentStatus] = TRANSIENT_VALIDATED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->TRANSIENT_DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_BACKFILLED + - $next-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY + - $next-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-node[CurrentStatus] = TRANSIENT_ABSENT + - descriptorIsNotBeingDropped($prev) + - nodeNotExistsWithStatusIn_TRANSIENT_BACKFILLED_TRANSIENT_BACKFILL_ONLY($prev-target) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_MERGED->TRANSIENT_WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_MERGED + - $next-node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->TRANSIENT_WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_MERGE_ONLY + - $next-node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_TRANSIENT_MERGE_ONLY_TRANSIENT_MERGED($prev-target) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = VALIDATED + - $next-node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = BACKFILLED + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = BACKFILL_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped($prev) + - nodeNotExistsWithStatusIn_BACKFILLED_BACKFILL_ONLY($prev-target) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = MERGED + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = MERGE_ONLY + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = PUBLIC + - $next-node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = VALIDATED + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - nodeNotExistsWithStatusIn_VALIDATED_MERGE_ONLY_MERGED($prev-target) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = ABSENT + - $next-node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = BACKFILLED + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = BACKFILL_ONLY + - $next-node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = MERGED + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = MERGE_ONLY + - $next-node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = VALIDATED + - $next-node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = PUBLIC + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped($prev) + - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY($prev-target) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_ABSENT + - $next-node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = ABSENT + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = ABSENT + - $next-node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = DELETE_ONLY + - $next-node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-node[CurrentStatus] = TRANSIENT_ABSENT + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-node + kind: PreviousTransactionPrecedence + to: next-node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $_ + - $prev[Self] = $next + - $prev-target[Self] = $next-target + - $prev-target[TargetStatus] = TRANSIENT_ABSENT + - $prev-node[CurrentStatus] = WRITE_ONLY + - $next-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped($prev) + - joinTargetNode($prev, $prev-target, $prev-node) + - joinTargetNode($next, $next-target, $next-node) - name: column dependents exist before column becomes public from: dependent-node kind: Precedence @@ -164,10 +1338,9 @@ deprules - $column[Type] = '*scpb.Column' - $dependent[Type] IN ['*scpb.ColumnName', '*scpb.ColumnType', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner', '*scpb.ColumnComment', '*scpb.IndexColumn'] - joinOnColumnID($column, $dependent, $table-id, $col-id) - - $column-target[TargetStatus] = TRANSIENT_ABSENT + - transient($column-target, $dependent-target) - $column-node[CurrentStatus] = TRANSIENT_WRITE_ONLY - - $dependent-target[TargetStatus] = ABSENT - - $dependent-node[CurrentStatus] = ABSENT + - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($column, $column-target, $column-node) - joinTargetNode($dependent, $dependent-target, $dependent-node) - name: column no longer public before dependents @@ -178,10 +1351,10 @@ deprules - $column[Type] = '*scpb.Column' - $dependent[Type] IN ['*scpb.ColumnName', '*scpb.ColumnType', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner', '*scpb.ColumnComment', '*scpb.IndexColumn'] - joinOnColumnID($column, $dependent, $table-id, $col-id) - - $column-target[TargetStatus] = ABSENT - - $column-node[CurrentStatus] = WRITE_ONLY - - $dependent-target[TargetStatus] = TRANSIENT_ABSENT - - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT + - $column-target[TargetStatus] = TRANSIENT_ABSENT + - $column-node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $dependent-target[TargetStatus] = ABSENT + - $dependent-node[CurrentStatus] = ABSENT - joinTargetNode($column, $column-target, $column-node) - joinTargetNode($dependent, $dependent-target, $dependent-node) - name: column no longer public before dependents @@ -192,8 +1365,9 @@ deprules - $column[Type] = '*scpb.Column' - $dependent[Type] IN ['*scpb.ColumnName', '*scpb.ColumnType', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner', '*scpb.ColumnComment', '*scpb.IndexColumn'] - joinOnColumnID($column, $dependent, $table-id, $col-id) - - transient($column-target, $dependent-target) - - $column-node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $column-target[TargetStatus] = ABSENT + - $column-node[CurrentStatus] = WRITE_ONLY + - $dependent-target[TargetStatus] = TRANSIENT_ABSENT - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($column, $column-target, $column-node) - joinTargetNode($dependent, $dependent-target, $dependent-node) @@ -224,19 +1398,6 @@ deprules - relationIsNotBeingDropped(*scpb.ColumnType)($column-type) - joinTargetNode($column-type, $column-type-target, $column-type-node) - joinTargetNode($column, $column-target, $column-node) -- name: constraint dependent absent right before constraint - from: dependent-node - kind: SameStagePrecedence - to: constraint-node - query: - - $dependent[Type] IN ['*scpb.ConstraintName', '*scpb.ConstraintComment'] - - $constraint[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - - joinOnConstraintID($dependent, $constraint, $table-id, $constraint-id) - - toAbsent($dependent-target, $constraint-target) - - $dependent-node[CurrentStatus] = VALIDATED - - $constraint-node[CurrentStatus] = ABSENT - - joinTargetNode($dependent, $dependent-target, $dependent-node) - - joinTargetNode($constraint, $constraint-target, $constraint-node) - name: constraint dependent absent right before constraint from: dependent-node kind: SameStagePrecedence @@ -258,9 +1419,10 @@ deprules - $dependent[Type] IN ['*scpb.ConstraintName', '*scpb.ConstraintComment'] - $constraint[Type] IN ['*scpb.UniqueWithoutIndexConstraint', '*scpb.CheckConstraint', '*scpb.ForeignKeyConstraint'] - joinOnConstraintID($dependent, $constraint, $table-id, $constraint-id) - - transient($dependent-target, $constraint-target) + - $dependent-target[TargetStatus] = TRANSIENT_ABSENT - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - - $constraint-node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-target[TargetStatus] = ABSENT + - $constraint-node[CurrentStatus] = ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($constraint, $constraint-target, $constraint-node) - name: constraint dependent absent right before constraint @@ -271,10 +1433,10 @@ deprules - $dependent[Type] IN ['*scpb.ConstraintName', '*scpb.ConstraintComment'] - $constraint[Type] IN ['*scpb.UniqueWithoutIndexConstraint', '*scpb.CheckConstraint', '*scpb.ForeignKeyConstraint'] - joinOnConstraintID($dependent, $constraint, $table-id, $constraint-id) - - $dependent-target[TargetStatus] = TRANSIENT_ABSENT - - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - - $constraint-target[TargetStatus] = ABSENT - - $constraint-node[CurrentStatus] = ABSENT + - $dependent-target[TargetStatus] = ABSENT + - $dependent-node[CurrentStatus] = ABSENT + - $constraint-target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($constraint, $constraint-target, $constraint-node) - name: constraint dependent absent right before constraint @@ -283,12 +1445,11 @@ deprules to: constraint-node query: - $dependent[Type] IN ['*scpb.ConstraintName', '*scpb.ConstraintComment'] - - $constraint[Type] IN ['*scpb.UniqueWithoutIndexConstraint', '*scpb.CheckConstraint', '*scpb.ForeignKeyConstraint'] + - $constraint[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - joinOnConstraintID($dependent, $constraint, $table-id, $constraint-id) - - $dependent-target[TargetStatus] = ABSENT - - $dependent-node[CurrentStatus] = ABSENT - - $constraint-target[TargetStatus] = TRANSIENT_ABSENT - - $constraint-node[CurrentStatus] = TRANSIENT_ABSENT + - toAbsent($dependent-target, $constraint-target) + - $dependent-node[CurrentStatus] = VALIDATED + - $constraint-node[CurrentStatus] = ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($constraint, $constraint-target, $constraint-node) - name: constraint dependent absent right before constraint @@ -332,6 +1493,19 @@ deprules - $constraint-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($constraint, $constraint-target, $constraint-node) +- name: constraint dependent absent right before constraint + from: dependent-node + kind: SameStagePrecedence + to: constraint-node + query: + - $dependent[Type] IN ['*scpb.ConstraintName', '*scpb.ConstraintComment'] + - $constraint[Type] IN ['*scpb.UniqueWithoutIndexConstraint', '*scpb.CheckConstraint', '*scpb.ForeignKeyConstraint'] + - joinOnConstraintID($dependent, $constraint, $table-id, $constraint-id) + - transient($dependent-target, $constraint-target) + - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-target, $dependent-node) + - joinTargetNode($constraint, $constraint-target, $constraint-node) - name: constraint dependent public right before constraint from: constraint-node kind: SameStagePrecedence @@ -353,10 +1527,10 @@ deprules - $dependent[Type] IN ['*scpb.ColumnName', '*scpb.ColumnType', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner', '*scpb.ColumnComment', '*scpb.IndexColumn'] - $column[Type] = '*scpb.Column' - joinOnColumnID($dependent, $column, $table-id, $col-id) - - $dependent-target[TargetStatus] = ABSENT - - $dependent-node[CurrentStatus] = ABSENT - - $column-target[TargetStatus] = TRANSIENT_ABSENT - - $column-node[CurrentStatus] = TRANSIENT_ABSENT + - $dependent-target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT + - $column-target[TargetStatus] = ABSENT + - $column-node[CurrentStatus] = ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($column, $column-target, $column-node) - name: dependents removed before column @@ -380,8 +1554,9 @@ deprules - $dependent[Type] IN ['*scpb.ColumnName', '*scpb.ColumnType', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner', '*scpb.ColumnComment', '*scpb.IndexColumn'] - $column[Type] = '*scpb.Column' - joinOnColumnID($dependent, $column, $table-id, $col-id) - - transient($dependent-target, $column-target) - - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT + - $dependent-target[TargetStatus] = ABSENT + - $dependent-node[CurrentStatus] = ABSENT + - $column-target[TargetStatus] = TRANSIENT_ABSENT - $column-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($column, $column-target, $column-node) @@ -393,10 +1568,9 @@ deprules - $dependent[Type] IN ['*scpb.ColumnName', '*scpb.ColumnType', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner', '*scpb.ColumnComment', '*scpb.IndexColumn'] - $column[Type] = '*scpb.Column' - joinOnColumnID($dependent, $column, $table-id, $col-id) - - $dependent-target[TargetStatus] = TRANSIENT_ABSENT + - transient($dependent-target, $column-target) - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - - $column-target[TargetStatus] = ABSENT - - $column-node[CurrentStatus] = ABSENT + - $column-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($column, $column-target, $column-node) - name: dependents removed before index @@ -421,10 +1595,9 @@ deprules - $dependent[Type] IN ['*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.SecondaryIndexPartial', '*scpb.IndexComment', '*scpb.IndexColumn'] - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - joinOnIndexID($dependent, $index, $table-id, $index-id) - - $dependent-target[TargetStatus] = TRANSIENT_ABSENT + - transient($dependent-target, $index-target) - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - - $index-target[TargetStatus] = ABSENT - - $index-node[CurrentStatus] = ABSENT + - $index-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($index, $index-target, $index-node) - name: dependents removed before index @@ -435,9 +1608,10 @@ deprules - $dependent[Type] IN ['*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.SecondaryIndexPartial', '*scpb.IndexComment', '*scpb.IndexColumn'] - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - joinOnIndexID($dependent, $index, $table-id, $index-id) - - transient($dependent-target, $index-target) + - $dependent-target[TargetStatus] = TRANSIENT_ABSENT - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - - $index-node[CurrentStatus] = TRANSIENT_ABSENT + - $index-target[TargetStatus] = ABSENT + - $index-node[CurrentStatus] = ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($index, $index-target, $index-node) - name: dependents removed before index @@ -453,6 +1627,32 @@ deprules - $index-node[CurrentStatus] = ABSENT - joinTargetNode($dependent, $dependent-target, $dependent-node) - joinTargetNode($index, $index-target, $index-node) +- name: descriptor DROPPED in transaction before removal + from: dropped-node + kind: PreviousTransactionPrecedence + to: absent-node + query: + - $dropped[Type] IN ['*scpb.Database', '*scpb.Schema', '*scpb.View', '*scpb.Sequence', '*scpb.Table', '*scpb.EnumType', '*scpb.AliasType'] + - $dropped[DescID] = $_ + - $dropped[Self] = $absent + - toAbsent($dropped-target, $absent-target) + - $dropped-node[CurrentStatus] = DROPPED + - $absent-node[CurrentStatus] = ABSENT + - joinTargetNode($dropped, $dropped-target, $dropped-node) + - joinTargetNode($absent, $absent-target, $absent-node) +- name: descriptor TXN_DROPPED before DROPPED + from: txn_dropped-node + kind: PreviousStagePrecedence + to: dropped-node + query: + - $txn_dropped[Type] IN ['*scpb.Database', '*scpb.Schema', '*scpb.View', '*scpb.Sequence', '*scpb.Table', '*scpb.EnumType', '*scpb.AliasType'] + - $txn_dropped[DescID] = $_ + - $txn_dropped[Self] = $dropped + - toAbsent($txn_dropped-target, $dropped-target) + - $txn_dropped-node[CurrentStatus] = TXN_DROPPED + - $dropped-node[CurrentStatus] = DROPPED + - joinTargetNode($txn_dropped, $txn_dropped-target, $txn_dropped-node) + - joinTargetNode($dropped, $dropped-target, $dropped-node) - name: descriptor drop right before dependent element removal from: descriptor-node kind: SameStagePrecedence @@ -593,10 +1793,9 @@ deprules - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - $dependent[Type] IN ['*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.SecondaryIndexPartial', '*scpb.IndexComment', '*scpb.IndexColumn'] - joinOnIndexID($index, $dependent, $table-id, $index-id) - - $index-target[TargetStatus] = TRANSIENT_ABSENT + - transient($index-target, $dependent-target) - $index-node[CurrentStatus] = TRANSIENT_VALIDATED - - $dependent-target[TargetStatus] = ABSENT - - $dependent-node[CurrentStatus] = ABSENT + - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($dependent, $dependent-target, $dependent-node) - name: index no longer public before dependents @@ -607,10 +1806,10 @@ deprules - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - $dependent[Type] IN ['*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.SecondaryIndexPartial', '*scpb.IndexComment', '*scpb.IndexColumn'] - joinOnIndexID($index, $dependent, $table-id, $index-id) - - $index-target[TargetStatus] = ABSENT - - $index-node[CurrentStatus] = VALIDATED - - $dependent-target[TargetStatus] = TRANSIENT_ABSENT - - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT + - $index-target[TargetStatus] = TRANSIENT_ABSENT + - $index-node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-target[TargetStatus] = ABSENT + - $dependent-node[CurrentStatus] = ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($dependent, $dependent-target, $dependent-node) - name: index no longer public before dependents @@ -621,8 +1820,9 @@ deprules - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - $dependent[Type] IN ['*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.SecondaryIndexPartial', '*scpb.IndexComment', '*scpb.IndexColumn'] - joinOnIndexID($index, $dependent, $table-id, $index-id) - - transient($index-target, $dependent-target) - - $index-node[CurrentStatus] = TRANSIENT_VALIDATED + - $index-target[TargetStatus] = ABSENT + - $index-node[CurrentStatus] = VALIDATED + - $dependent-target[TargetStatus] = TRANSIENT_ABSENT - $dependent-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($dependent, $dependent-target, $dependent-node) @@ -664,9 +1864,10 @@ deprules - joinOnColumnID($index-column, $column, $table-id, $column-id) - joinOnColumnID($index-column, $column-type, $table-id, $column-id) - relationIsNotBeingDropped(*scpb.ColumnType)($column-type) - - toAbsent($index-target, $column-target) + - $index-target[TargetStatus] = ABSENT - $index-node[CurrentStatus] = ABSENT - - $column-node[CurrentStatus] = ABSENT + - $column-target[TargetStatus] = TRANSIENT_ABSENT + - $column-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($column, $column-target, $column-node) - name: indexes containing column reach absent before column @@ -681,10 +1882,10 @@ deprules - joinOnColumnID($index-column, $column, $table-id, $column-id) - joinOnColumnID($index-column, $column-type, $table-id, $column-id) - relationIsNotBeingDropped(*scpb.ColumnType)($column-type) - - $index-target[TargetStatus] = ABSENT - - $index-node[CurrentStatus] = ABSENT - - $column-target[TargetStatus] = TRANSIENT_ABSENT - - $column-node[CurrentStatus] = TRANSIENT_ABSENT + - $index-target[TargetStatus] = TRANSIENT_ABSENT + - $index-node[CurrentStatus] = TRANSIENT_ABSENT + - $column-target[TargetStatus] = ABSENT + - $column-node[CurrentStatus] = ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($column, $column-target, $column-node) - name: indexes containing column reach absent before column @@ -716,9 +1917,8 @@ deprules - joinOnColumnID($index-column, $column, $table-id, $column-id) - joinOnColumnID($index-column, $column-type, $table-id, $column-id) - relationIsNotBeingDropped(*scpb.ColumnType)($column-type) - - $index-target[TargetStatus] = TRANSIENT_ABSENT - - $index-node[CurrentStatus] = TRANSIENT_ABSENT - - $column-target[TargetStatus] = ABSENT + - toAbsent($index-target, $column-target) + - $index-node[CurrentStatus] = ABSENT - $column-node[CurrentStatus] = ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($column, $column-target, $column-node) @@ -751,8 +1951,9 @@ deprules - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - relationIsNotBeingDropped(*scpb.SecondaryIndexPartial)($partial-predicate) - - toAbsent($partial-predicate-target, $index-target) - - $partial-predicate-node[CurrentStatus] = ABSENT + - $partial-predicate-target[TargetStatus] = TRANSIENT_ABSENT + - $partial-predicate-node[CurrentStatus] = TRANSIENT_ABSENT + - $index-target[TargetStatus] = ABSENT - $index-node[CurrentStatus] = ABSENT - joinTargetNode($partial-predicate, $partial-predicate-target, $partial-predicate-node) - joinTargetNode($index, $index-target, $index-node) @@ -765,9 +1966,9 @@ deprules - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - relationIsNotBeingDropped(*scpb.SecondaryIndexPartial)($partial-predicate) - - transient($partial-predicate-target, $index-target) - - $partial-predicate-node[CurrentStatus] = TRANSIENT_ABSENT - - $index-node[CurrentStatus] = TRANSIENT_ABSENT + - toAbsent($partial-predicate-target, $index-target) + - $partial-predicate-node[CurrentStatus] = ABSENT + - $index-node[CurrentStatus] = ABSENT - joinTargetNode($partial-predicate, $partial-predicate-target, $partial-predicate-node) - joinTargetNode($index, $index-target, $index-node) - name: partial predicate removed right before secondary index when not dropping relation @@ -794,28 +1995,11 @@ deprules - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - relationIsNotBeingDropped(*scpb.SecondaryIndexPartial)($partial-predicate) - - $partial-predicate-target[TargetStatus] = TRANSIENT_ABSENT + - transient($partial-predicate-target, $index-target) - $partial-predicate-node[CurrentStatus] = TRANSIENT_ABSENT - - $index-target[TargetStatus] = ABSENT - - $index-node[CurrentStatus] = ABSENT + - $index-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($partial-predicate, $partial-predicate-target, $partial-predicate-node) - joinTargetNode($index, $index-target, $index-node) -- name: primary index swap - from: old-index-node - kind: SameStagePrecedence - to: new-index-node - query: - - $old-index[Type] = '*scpb.PrimaryIndex' - - $new-index[Type] = '*scpb.PrimaryIndex' - - joinOnDescID($old-index, $new-index, $table-id) - - $old-index[IndexID] = $old-index-id - - $new-index[SourceIndexID] = $old-index-id - - $old-index-target[TargetStatus] = TRANSIENT_ABSENT - - $old-index-node[CurrentStatus] = TRANSIENT_VALIDATED - - $new-index-target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] - - $new-index-node[CurrentStatus] = PUBLIC - - joinTargetNode($old-index, $old-index-target, $old-index-node) - - joinTargetNode($new-index, $new-index-target, $new-index-node) - name: primary index swap from: old-index-node kind: SameStagePrecedence @@ -848,6 +2032,22 @@ deprules - $old-index-node[CurrentStatus] = PUBLIC - joinTargetNode($new-index, $new-index-target, $new-index-node) - joinTargetNode($old-index, $old-index-target, $old-index-node) +- name: primary index swap + from: old-index-node + kind: SameStagePrecedence + to: new-index-node + query: + - $old-index[Type] = '*scpb.PrimaryIndex' + - $new-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($old-index, $new-index, $table-id) + - $old-index[IndexID] = $old-index-id + - $new-index[SourceIndexID] = $old-index-id + - $old-index-target[TargetStatus] = TRANSIENT_ABSENT + - $old-index-node[CurrentStatus] = TRANSIENT_VALIDATED + - $new-index-target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $new-index-node[CurrentStatus] = PUBLIC + - joinTargetNode($old-index, $old-index-target, $old-index-node) + - joinTargetNode($new-index, $new-index-target, $new-index-node) - name: primary index with new columns should exist before secondary indexes from: primary-index-node kind: Precedence @@ -886,9 +2086,10 @@ deprules - $index[Type] = '*scpb.IndexColumn' - $index-column[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - joinOnIndexID($index, $index-column, $table-id, $index-id) - - transient($index-target, $index-column-target) + - $index-target[TargetStatus] = TRANSIENT_ABSENT - $index-node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - $index-column-node[CurrentStatus] = TRANSIENT_ABSENT + - $index-column-target[TargetStatus] = ABSENT + - $index-column-node[CurrentStatus] = ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($index-column, $index-column-target, $index-column-node) - name: remove columns from index right before removing index @@ -899,9 +2100,9 @@ deprules - $index[Type] = '*scpb.IndexColumn' - $index-column[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - joinOnIndexID($index, $index-column, $table-id, $index-id) - - toAbsent($index-target, $index-column-target) - - $index-node[CurrentStatus] = DELETE_ONLY - - $index-column-node[CurrentStatus] = ABSENT + - transient($index-target, $index-column-target) + - $index-node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $index-column-node[CurrentStatus] = TRANSIENT_ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($index-column, $index-column-target, $index-column-node) - name: remove columns from index right before removing index @@ -912,9 +2113,8 @@ deprules - $index[Type] = '*scpb.IndexColumn' - $index-column[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] - joinOnIndexID($index, $index-column, $table-id, $index-id) - - $index-target[TargetStatus] = TRANSIENT_ABSENT - - $index-node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - $index-column-target[TargetStatus] = ABSENT + - toAbsent($index-target, $index-column-target) + - $index-node[CurrentStatus] = DELETE_ONLY - $index-column-node[CurrentStatus] = ABSENT - joinTargetNode($index, $index-target, $index-node) - joinTargetNode($index-column, $index-column-target, $index-column-node) diff --git a/pkg/sql/schemachanger/scplan/internal/rules/testdata/oprules b/pkg/sql/schemachanger/scplan/internal/rules/testdata/oprules index 3207136def7c..9131c112a2e2 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/testdata/oprules +++ b/pkg/sql/schemachanger/scplan/internal/rules/testdata/oprules @@ -1,49 +1,95 @@ rules ---- -columnInIndex(index-column, index, table-id, column-id, index-id): +columnInIndex($index-column, $index, $table-id, $column-id, $index-id): - $index-column[Type] = '*scpb.IndexColumn' - $index-column[DescID] = $_ - $index-column[ColumnID] = $column-id - $index[IndexID] = $index-id - joinOnIndexID($index, $index-column, $table-id, $index-id) -columnInSwappedInPrimaryIndex(index-column, index, table-id, column-id, index-id): +columnInSwappedInPrimaryIndex($index-column, $index, $table-id, $column-id, $index-id): - columnInIndex($index-column, $index, $table-id, $column-id, $index-id) - sourceIndexIsSet($index) -joinOnColumnID(a, b, desc-id, col-id): +descriptorIsNotBeingDropped($element): + not-join: + - $descriptor[Type] IN ['*scpb.Database', '*scpb.Schema', '*scpb.View', '*scpb.Sequence', '*scpb.Table', '*scpb.EnumType', '*scpb.AliasType'] + - joinTarget($descriptor, $descriptor-target) + - joinOnDescID($descriptor, $element, $id) + - $descriptor-target[TargetStatus] = ABSENT +joinOnColumnID($a, $b, $desc-id, $col-id): - joinOnDescID($a, $b, $desc-id) - $a[ColumnID] = $col-id - $b[ColumnID] = $col-id -joinOnConstraintID(a, b, desc-id, constraint-id): +joinOnConstraintID($a, $b, $desc-id, $constraint-id): - joinOnDescID($a, $b, $desc-id) - $a[ConstraintID] = $constraint-id - $b[ConstraintID] = $constraint-id -joinOnDescID(a, b, id): +joinOnDescID($a, $b, $id): - $a[DescID] = $id - $b[DescID] = $id -joinOnIndexID(a, b, desc-id, index-id): +joinOnIndexID($a, $b, $desc-id, $index-id): - joinOnDescID($a, $b, $desc-id) - $a[IndexID] = $index-id - $b[IndexID] = $index-id -joinReferencedDescID(referrer, referenced, id): +joinReferencedDescID($referrer, $referenced, $id): - $referrer[ReferencedDescID] = $id - $referenced[DescID] = $id -joinTarget(element, target): +joinTarget($element, $target): - $target[Type] = '*scpb.Target' - $target[Element] = $element - $element[DescID] = $_ -joinTargetNode(element, target, node): +joinTargetNode($element, $target, $node): - joinTarget($element, $target) - $node[Type] = '*screl.Node' - $node[Target] = $target -sourceIndexIsSet(index): +nodeNotExistsWithStatusIn_BACKFILLED_BACKFILL_ONLY($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [BACKFILLED, BACKFILL_ONLY] +nodeNotExistsWithStatusIn_TRANSIENT_BACKFILLED_TRANSIENT_BACKFILL_ONLY($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_BACKFILLED, TRANSIENT_BACKFILL_ONLY] +nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_DELETE_ONLY] +? nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY_BACKFILLED_TRANSIENT_BACKFILLED_BACKFILL_ONLY_TRANSIENT_BACKFILL_ONLY($sharedTarget) +: not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_DELETE_ONLY, BACKFILLED, TRANSIENT_BACKFILLED, BACKFILL_ONLY, TRANSIENT_BACKFILL_ONLY] +nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_VALIDATED] +nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_TRANSIENT_MERGE_ONLY_TRANSIENT_MERGED($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [TRANSIENT_VALIDATED, TRANSIENT_MERGE_ONLY, TRANSIENT_MERGED] +nodeNotExistsWithStatusIn_VALIDATED_MERGE_ONLY_MERGED($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [VALIDATED, MERGE_ONLY, MERGED] +nodeNotExistsWithStatusIn_VALIDATED_TRANSIENT_WRITE_ONLY_MERGE_ONLY_TRANSIENT_MERGE_ONLY_MERGED_TRANSIENT_MERGED($sharedTarget): + not-join: + - $n[Type] = '*screl.Node' + - $n[Target] = $sharedTarget + - $n[CurrentStatus] IN [VALIDATED, TRANSIENT_WRITE_ONLY, MERGE_ONLY, TRANSIENT_MERGE_ONLY, MERGED, TRANSIENT_MERGED] +sourceIndexIsSet($index): - $index[SourceIndexID] != 0 -toAbsent(target1, target2): +toAbsent($target1, $target2): - $target1[TargetStatus] = ABSENT - $target2[TargetStatus] = ABSENT -toPublicOrTransient(target1, target2): +toPublicOrTransient($target1, $target2): - $target1[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] - $target2[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] -transient(target1, target2): +transient($target1, $target2): - $target1[TargetStatus] = TRANSIENT_ABSENT - $target2[TargetStatus] = TRANSIENT_ABSENT diff --git a/pkg/sql/schemachanger/scplan/internal/scgraph/depedgekind_string.go b/pkg/sql/schemachanger/scplan/internal/scgraph/depedgekind_string.go index a768c9bd1415..39bd1beee19d 100644 --- a/pkg/sql/schemachanger/scplan/internal/scgraph/depedgekind_string.go +++ b/pkg/sql/schemachanger/scplan/internal/scgraph/depedgekind_string.go @@ -11,11 +11,12 @@ func _() { _ = x[Precedence-1] _ = x[SameStagePrecedence-2] _ = x[PreviousStagePrecedence-3] + _ = x[PreviousTransactionPrecedence-4] } -const _DepEdgeKind_name = "PrecedenceSameStagePrecedencePreviousStagePrecedence" +const _DepEdgeKind_name = "PrecedenceSameStagePrecedencePreviousStagePrecedencePreviousTransactionPrecedence" -var _DepEdgeKind_index = [...]uint8{0, 10, 29, 52} +var _DepEdgeKind_index = [...]uint8{0, 10, 29, 52, 81} func (i DepEdgeKind) String() string { i -= 1 diff --git a/pkg/sql/schemachanger/scplan/internal/scgraph/edge.go b/pkg/sql/schemachanger/scplan/internal/scgraph/edge.go index 646b93480b40..23d6821f2087 100644 --- a/pkg/sql/schemachanger/scplan/internal/scgraph/edge.go +++ b/pkg/sql/schemachanger/scplan/internal/scgraph/edge.go @@ -41,8 +41,6 @@ type OpEdge struct { // permanently or publishes new information externally has yet been // run for this target. revertible bool - - minPhase scop.Phase } // From implements the Edge interface. @@ -67,11 +65,6 @@ func (oe *OpEdge) Type() scop.Type { return oe.typ } -// IsPhaseSatisfied returns true iff the operations can run in the given phase. -func (oe *OpEdge) IsPhaseSatisfied(phase scop.Phase) bool { - return phase >= oe.minPhase -} - // String returns a string representation of this edge func (oe *OpEdge) String() string { from := screl.NodeString(oe.from) @@ -102,6 +95,12 @@ const ( // be reached before the destination (to), and _must_ do so in a previous // stage. PreviousStagePrecedence + + // PreviousTransactionPrecedence is like PreviousStagePrecedence but does + // not allow the transition to occur unless the current phase is at least + // PostCommitPhase, because StatementPhase and PreCommitPhase are special + // in that they take place in the same transaction. + PreviousTransactionPrecedence ) // DepEdge represents a dependency between two nodes. A dependency diff --git a/pkg/sql/schemachanger/scplan/internal/scgraph/graph.go b/pkg/sql/schemachanger/scplan/internal/scgraph/graph.go index 611c347e1b38..1bc4c7b976e4 100644 --- a/pkg/sql/schemachanger/scplan/internal/scgraph/graph.go +++ b/pkg/sql/schemachanger/scplan/internal/scgraph/graph.go @@ -202,17 +202,12 @@ func (g *Graph) GetOpEdgeFrom(n *screl.Node) (*OpEdge, bool) { // AddOpEdges adds an op edges connecting the nodes for two statuses of a target. func (g *Graph) AddOpEdges( - t *scpb.Target, - from, to scpb.Status, - revertible, canFail bool, - minPhase scop.Phase, - ops ...scop.Op, + t *scpb.Target, from, to scpb.Status, revertible, canFail bool, ops ...scop.Op, ) (err error) { oe := &OpEdge{ op: ops, revertible: revertible, canFail: canFail, - minPhase: minPhase, } if oe.from, err = g.getOrCreateNode(t, from); err != nil { return err diff --git a/pkg/sql/schemachanger/scplan/internal/scgraph/graph_test.go b/pkg/sql/schemachanger/scplan/internal/scgraph/graph_test.go index 34cc493a39c3..f2d7b4cfd87b 100644 --- a/pkg/sql/schemachanger/scplan/internal/scgraph/graph_test.go +++ b/pkg/sql/schemachanger/scplan/internal/scgraph/graph_test.go @@ -118,7 +118,6 @@ func TestGraphRanks(t *testing.T) { scpb.Status_ABSENT, scpb.Status_PUBLIC, revertible, canFail, - scop.StatementPhase, &scop.MakeColumnAbsent{}, )) } else { @@ -127,7 +126,6 @@ func TestGraphRanks(t *testing.T) { scpb.Status_PUBLIC, scpb.Status_ABSENT, revertible, canFail, - scop.StatementPhase, &scop.MakeColumnAbsent{}, )) } diff --git a/pkg/sql/schemachanger/scplan/internal/scstage/build.go b/pkg/sql/schemachanger/scplan/internal/scstage/build.go index 603e45864078..6c1912504bf6 100644 --- a/pkg/sql/schemachanger/scplan/internal/scstage/build.go +++ b/pkg/sql/schemachanger/scplan/internal/scstage/build.go @@ -288,10 +288,6 @@ type stageBuilder struct { type currentTargetState struct { n *screl.Node e *scgraph.OpEdge - - // hasOpEdgeWithOps is true iff this stage already includes an op edge with - // ops for this target. - hasOpEdgeWithOps bool } func (sb stageBuilder) makeCurrentTargetState(n *screl.Node) currentTargetState { @@ -299,11 +295,7 @@ func (sb stageBuilder) makeCurrentTargetState(n *screl.Node) currentTargetState if !found || !sb.isOutgoingOpEdgeAllowed(e) { return currentTargetState{n: n} } - return currentTargetState{ - n: n, - e: e, - hasOpEdgeWithOps: !sb.bc.g.IsNoOp(e), - } + return currentTargetState{n: n, e: e} } // isOutgoingOpEdgeAllowed returns false iff there is something preventing using @@ -322,9 +314,6 @@ func (sb stageBuilder) isOutgoingOpEdgeAllowed(e *scgraph.OpEdge) bool { if e.Type() != sb.opType { return false } - if !e.IsPhaseSatisfied(sb.bs.phase) && !sb.bc.g.IsNoOp(e) { - return false - } // We allow non-revertible ops to be included at stages preceding // PostCommitNonRevertible if nothing left in the schema change at this // point can fail. The caller is responsible for detecting whether any @@ -351,18 +340,7 @@ func (sb stageBuilder) canMakeProgress() bool { } func (sb stageBuilder) nextTargetState(t currentTargetState) currentTargetState { - next := sb.makeCurrentTargetState(t.e.To()) - if t.hasOpEdgeWithOps { - if next.hasOpEdgeWithOps { - // Prevent having more than one non-no-op op edge per target in a - // stage. This upholds the 2-version invariant. - // TODO(postamar): uphold the 2-version invariant using dep rules instead. - next.e = nil - } else { - next.hasOpEdgeWithOps = true - } - } - return next + return sb.makeCurrentTargetState(t.e.To()) } // hasUnmeetableOutboundDeps returns true iff the candidate node has inbound @@ -373,8 +351,7 @@ func (sb stageBuilder) nextTargetState(t currentTargetState) currentTargetState // scheduled. func (sb stageBuilder) hasUnmetInboundDeps(n *screl.Node) (ret bool) { _ = sb.bc.g.ForEachDepEdgeTo(n, func(de *scgraph.DepEdge) error { - if sb.isUnmetInboundDep(de) { - ret = true + if ret = sb.isUnmetInboundDep(de); ret { return iterutil.StopIteration() } return nil @@ -382,10 +359,18 @@ func (sb stageBuilder) hasUnmetInboundDeps(n *screl.Node) (ret bool) { return ret } -func (sb *stageBuilder) isUnmetInboundDep(de *scgraph.DepEdge) bool { +func (sb stageBuilder) isUnmetInboundDep(de *scgraph.DepEdge) bool { _, fromIsFulfilled := sb.bs.fulfilled[de.From()] _, fromIsCandidate := sb.fulfilling[de.From()] switch de.Kind() { + + case scgraph.PreviousTransactionPrecedence: + return !fromIsFulfilled || + (sb.bs.phase <= scop.PreCommitPhase && + // If it has been fulfilled implicitly because it's the initial + // status, then the current stage doesn't matter. + de.From().CurrentStatus != + scpb.TargetStatus(de.From().TargetStatus).InitialStatus()) case scgraph.PreviousStagePrecedence: // True iff the source node has not been fulfilled in an earlier stage. return !fromIsFulfilled diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column index 5fd14c8e1038..a6b84e618af1 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column @@ -312,7 +312,7 @@ PostCommitPhase stage 7 of 7 with 1 ValidationType op PostCommitNonRevertiblePhase stage 1 of 3 with 9 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY + [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 104, Name: foo_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], WRITE_ONLY] -> PUBLIC [[PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC], VALIDATED] -> PUBLIC @@ -368,18 +368,18 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 9 MutationType ops JobID: 1 PostCommitNonRevertiblePhase stage 2 of 3 with 5 MutationType ops transitions: - [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_DELETE_ONLY] -> TRANSIENT_ABSENT ops: - *scop.MakeDroppedIndexDeleteOnly - IndexID: 1 - TableID: 104 *scop.CreateGcJobForIndex IndexID: 3 TableID: 104 *scop.MakeIndexAbsent IndexID: 3 TableID: 104 + *scop.MakeDroppedIndexDeleteOnly + IndexID: 1 + TableID: 104 *scop.SetJobStateOnDescriptor DescriptorID: 104 *scop.UpdateSchemaChangerJob @@ -662,7 +662,7 @@ PostCommitPhase stage 7 of 7 with 1 ValidationType op PostCommitNonRevertiblePhase stage 1 of 3 with 11 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY + [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 104, Name: foo_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], WRITE_ONLY] -> PUBLIC [[PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC], VALIDATED] -> PUBLIC @@ -731,18 +731,18 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 11 MutationType ops JobID: 1 PostCommitNonRevertiblePhase stage 2 of 3 with 5 MutationType ops transitions: - [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_DELETE_ONLY] -> TRANSIENT_ABSENT ops: - *scop.MakeDroppedIndexDeleteOnly - IndexID: 1 - TableID: 104 *scop.CreateGcJobForIndex IndexID: 3 TableID: 104 *scop.MakeIndexAbsent IndexID: 3 TableID: 104 + *scop.MakeDroppedIndexDeleteOnly + IndexID: 1 + TableID: 104 *scop.SetJobStateOnDescriptor DescriptorID: 104 *scop.UpdateSchemaChangerJob @@ -954,7 +954,7 @@ PostCommitPhase stage 7 of 7 with 1 ValidationType op PostCommitNonRevertiblePhase stage 1 of 3 with 9 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY + [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 104, Name: foo_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], WRITE_ONLY] -> PUBLIC [[PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC], VALIDATED] -> PUBLIC @@ -1010,18 +1010,18 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 9 MutationType ops JobID: 1 PostCommitNonRevertiblePhase stage 2 of 3 with 5 MutationType ops transitions: - [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_DELETE_ONLY] -> TRANSIENT_ABSENT ops: - *scop.MakeDroppedIndexDeleteOnly - IndexID: 1 - TableID: 104 *scop.CreateGcJobForIndex IndexID: 3 TableID: 104 *scop.MakeIndexAbsent IndexID: 3 TableID: 104 + *scop.MakeDroppedIndexDeleteOnly + IndexID: 1 + TableID: 104 *scop.SetJobStateOnDescriptor DescriptorID: 104 *scop.UpdateSchemaChangerJob @@ -1447,7 +1447,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 10 MutationType ops transitions: [[IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> WRITE_ONLY + [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 108, Name: t_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[PrimaryIndex:{DescID: 108, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC], VALIDATED] -> PUBLIC [[IndexName:{DescID: 108, Name: t_pkey, IndexID: 2}, PUBLIC], ABSENT] -> PUBLIC @@ -1500,13 +1500,10 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 10 MutationType ops JobID: 1 PostCommitNonRevertiblePhase stage 2 of 3 with 7 MutationType ops transitions: - [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[TemporaryIndex:{DescID: 108, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_DELETE_ONLY] -> TRANSIENT_ABSENT [[TemporaryIndex:{DescID: 108, IndexID: 5, ConstraintID: 5, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_DELETE_ONLY] -> TRANSIENT_ABSENT ops: - *scop.MakeDroppedIndexDeleteOnly - IndexID: 1 - TableID: 108 *scop.CreateGcJobForIndex IndexID: 3 TableID: 108 @@ -1519,6 +1516,9 @@ PostCommitNonRevertiblePhase stage 2 of 3 with 7 MutationType ops *scop.MakeIndexAbsent IndexID: 5 TableID: 108 + *scop.MakeDroppedIndexDeleteOnly + IndexID: 1 + TableID: 108 *scop.SetJobStateOnDescriptor DescriptorID: 108 *scop.UpdateSchemaChangerJob @@ -1968,6 +1968,14 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 8 MutationType ops deps ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 ---- +- from: [Column:{DescID: 109, ColumnID: 2}, ABSENT] + to: [Column:{DescID: 109, ColumnID: 2}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY +- from: [Column:{DescID: 109, ColumnID: 2}, DELETE_ONLY] + to: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY - from: [Column:{DescID: 109, ColumnID: 2}, DELETE_ONLY] to: [ColumnDefaultExpression:{DescID: 109, ColumnID: 2}, PUBLIC] kind: Precedence @@ -2012,6 +2020,10 @@ ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 to: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, DELETE_ONLY] kind: Precedence rule: column existence precedes temp index existence +- from: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] + to: [Column:{DescID: 109, ColumnID: 2}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC - from: [Column:{DescID: 109, ColumnID: 2}, WRITE_ONLY] to: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, WRITE_ONLY] kind: Precedence @@ -2116,6 +2128,14 @@ ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] kind: SameStagePrecedence rules: [index dependents exist before index becomes public; index named right before index becomes public] +- from: [PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, PUBLIC] + to: [PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, VALIDATED] to: [IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT] kind: Precedence @@ -2124,10 +2144,22 @@ ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 to: [IndexName:{DescID: 109, Name: baz_pkey, IndexID: 1}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, VALIDATED] + to: [PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY - from: [PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, VALIDATED] to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] kind: SameStagePrecedence rule: primary index swap +- from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, ABSENT] + to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY +- from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] + to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY - from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] to: [IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 2}, PUBLIC] kind: Precedence @@ -2140,6 +2172,22 @@ ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 to: [IndexName:{DescID: 109, Name: baz_pkey, IndexID: 2}, PUBLIC] kind: Precedence rule: index existence precedes index dependents +- from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] + to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED +- from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, MERGE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY +- from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, MERGED] + to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY +- from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, MERGE_ONLY] + to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, MERGED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED - from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] to: [Column:{DescID: 109, ColumnID: 2}, PUBLIC] kind: Precedence @@ -2152,6 +2200,22 @@ ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 to: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, DELETE_ONLY] kind: Precedence rule: primary index with new columns should exist before temp indexes +- from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, VALIDATED] + to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC +- from: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, WRITE_ONLY] + to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED +- from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, ABSENT] + to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILL_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY +- from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILLED] + to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY - from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILL_ONLY] to: [IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 4}, PUBLIC] kind: Precedence @@ -2164,6 +2228,34 @@ ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 to: [IndexName:{DescID: 109, Name: baz_g_key, IndexID: 4}, PUBLIC] kind: Precedence rule: index existence precedes index dependents +- from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILL_ONLY] + to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILLED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED +- from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, MERGE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY +- from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, MERGED] + to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY +- from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, MERGE_ONLY] + to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, MERGED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED +- from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, VALIDATED] + to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC +- from: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, WRITE_ONLY] + to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED +- from: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, ABSENT] + to: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY - from: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, DELETE_ONLY] to: [IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 3}, PUBLIC] kind: Precedence @@ -2172,10 +2264,26 @@ ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 to: [IndexColumn:{DescID: 109, ColumnID: 2, IndexID: 3}, PUBLIC] kind: Precedence rule: temp index existence precedes index dependents +- from: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, DELETE_ONLY] + to: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + to: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, WRITE_ONLY] to: [PrimaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] kind: Precedence rule: temp index is WRITE_ONLY before backfill +- from: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, WRITE_ONLY] + to: [TemporaryIndex:{DescID: 109, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY +- from: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, ABSENT] + to: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY - from: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, DELETE_ONLY] to: [IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 5}, PUBLIC] kind: Precedence @@ -2184,7 +2292,19 @@ ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 to: [IndexColumn:{DescID: 109, ColumnID: 2, IndexID: 5}, PUBLIC] kind: Precedence rule: temp index existence precedes index dependents +- from: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, DELETE_ONLY] + to: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, TRANSIENT_DELETE_ONLY] + to: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, WRITE_ONLY] to: [SecondaryIndex:{DescID: 109, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILLED] kind: Precedence rule: temp index is WRITE_ONLY before backfill +- from: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, WRITE_ONLY] + to: [TemporaryIndex:{DescID: 109, IndexID: 5, ConstraintID: 4, SourceIndexID: 2}, TRANSIENT_DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key b/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key index 06c1ab8ee30d..b19017aadefc 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key @@ -345,7 +345,7 @@ PostCommitNonRevertiblePhase stage 1 of 4 with 6 MutationType ops PostCommitNonRevertiblePhase stage 2 of 4 with 12 MutationType ops transitions: [[PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT], DELETE_ONLY] -> ABSENT - [[PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_WRITE_ONLY + [[PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_VALIDATED [[IndexName:{DescID: 104, Name: t_pkey, IndexID: 2}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT [[IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT @@ -412,7 +412,7 @@ PostCommitNonRevertiblePhase stage 2 of 4 with 12 MutationType ops JobID: 1 PostCommitNonRevertiblePhase stage 3 of 4 with 3 MutationType ops transitions: - [[PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_WRITE_ONLY] -> TRANSIENT_DELETE_ONLY + [[PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_VALIDATED] -> TRANSIENT_DELETE_ONLY ops: *scop.MakeDroppedIndexDeleteOnly IndexID: 2 @@ -469,6 +469,18 @@ PostCommitNonRevertiblePhase stage 4 of 4 with 6 MutationType ops deps ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); ---- +- from: [Column:{DescID: 104, ColumnID: 3}, DELETE_ONLY] + to: [Column:{DescID: 104, ColumnID: 3}, ABSENT] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [Column:{DescID: 104, ColumnID: 3}, PUBLIC] + to: [Column:{DescID: 104, ColumnID: 3}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY +- from: [Column:{DescID: 104, ColumnID: 3}, WRITE_ONLY] + to: [Column:{DescID: 104, ColumnID: 3}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY - from: [Column:{DescID: 104, ColumnID: 3}, WRITE_ONLY] to: [ColumnDefaultExpression:{DescID: 104, ColumnID: 3}, ABSENT] kind: Precedence @@ -649,6 +661,14 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, PUBLIC] kind: Precedence rule: old index absent before new index public when swapping with transient +- from: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, ABSENT] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, PUBLIC] + to: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, VALIDATED] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1}, ABSENT] kind: Precedence @@ -665,10 +685,22 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); to: [IndexName:{DescID: 104, Name: t_pkey, IndexID: 1}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, VALIDATED] + to: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY - from: [PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1}, VALIDATED] to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] kind: SameStagePrecedence rule: primary index swap +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, ABSENT] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->BACKFILL_ONLY +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY - from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, PUBLIC] kind: Precedence @@ -685,6 +717,26 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); to: [IndexName:{DescID: 104, Name: t_pkey, IndexID: 2}, PUBLIC] kind: Precedence rule: index existence precedes index dependents +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, MERGE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, MERGED] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, MERGE_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, MERGED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGE_ONLY->MERGED +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED - from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] to: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, DELETE_ONLY] kind: Precedence @@ -693,6 +745,10 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); to: [Column:{DescID: 104, ColumnID: 3}, ABSENT] kind: Precedence rule: indexes containing column reach absent before column +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_VALIDATED] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, TRANSIENT_ABSENT] kind: Precedence @@ -709,10 +765,30 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); to: [IndexName:{DescID: 104, Name: t_pkey, IndexID: 2}, TRANSIENT_ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_VALIDATED] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_WRITE_ONLY - from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, TRANSIENT_VALIDATED] to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, PUBLIC] kind: SameStagePrecedence rule: primary index swap +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, VALIDATED] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC +- from: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, WRITE_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED +- from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, ABSENT] + to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILL_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY +- from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILLED] + to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY - from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILL_ONLY] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4}, PUBLIC] kind: Precedence @@ -725,6 +801,34 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); to: [IndexName:{DescID: 104, Name: t_pkey, IndexID: 4}, PUBLIC] kind: Precedence rule: index existence precedes index dependents +- from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILL_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILLED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED +- from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, MERGE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY +- from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, MERGED] + to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY +- from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, MERGE_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, MERGED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED +- from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, VALIDATED] + to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC +- from: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, WRITE_ONLY] + to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, ABSENT] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY - from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, DELETE_ONLY] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3}, PUBLIC] kind: Precedence @@ -737,10 +841,26 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); to: [IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3}, PUBLIC] kind: Precedence rule: temp index existence precedes index dependents +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, DELETE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, WRITE_ONLY] to: [PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] kind: Precedence rule: temp index is WRITE_ONLY before backfill +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, WRITE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY +- from: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, ABSENT] + to: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY - from: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, DELETE_ONLY] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5}, PUBLIC] kind: Precedence @@ -749,7 +869,19 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); to: [IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 5}, PUBLIC] kind: Precedence rule: temp index existence precedes index dependents +- from: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, DELETE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, TRANSIENT_DELETE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, WRITE_ONLY] to: [PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2}, BACKFILLED] kind: Precedence rule: temp index is WRITE_ONLY before backfill +- from: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, WRITE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, TRANSIENT_DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column b/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column index 514de177bf6f..24727848f31e 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column @@ -223,7 +223,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 19 MutationType ops [[IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY + [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 107, Name: foo_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT @@ -326,7 +326,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 19 MutationType ops JobID: 1 PostCommitNonRevertiblePhase stage 2 of 3 with 17 MutationType ops transitions: - [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], VALIDATED] -> DELETE_ONLY [[SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT], DELETE_ONLY] -> ABSENT [[View:{DescID: 108}, ABSENT], DROPPED] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], DELETE_ONLY] -> ABSENT @@ -336,9 +336,6 @@ PostCommitNonRevertiblePhase stage 2 of 3 with 17 MutationType ops [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], DELETE_ONLY] -> ABSENT [[TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_DELETE_ONLY] -> TRANSIENT_ABSENT ops: - *scop.MakeDroppedIndexDeleteOnly - IndexID: 1 - TableID: 107 *scop.LogEvent Element: SecondaryIndex: @@ -449,6 +446,9 @@ PostCommitNonRevertiblePhase stage 2 of 3 with 17 MutationType ops *scop.MakeIndexAbsent IndexID: 4 TableID: 107 + *scop.MakeDroppedIndexDeleteOnly + IndexID: 1 + TableID: 107 *scop.SetJobStateOnDescriptor DescriptorID: 104 *scop.SetJobStateOnDescriptor @@ -517,6 +517,18 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 9 MutationType ops deps ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; ---- +- from: [Column:{DescID: 107, ColumnID: 2}, DELETE_ONLY] + to: [Column:{DescID: 107, ColumnID: 2}, ABSENT] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [Column:{DescID: 107, ColumnID: 2}, PUBLIC] + to: [Column:{DescID: 107, ColumnID: 2}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY +- from: [Column:{DescID: 107, ColumnID: 2}, WRITE_ONLY] + to: [Column:{DescID: 107, ColumnID: 2}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY - from: [Column:{DescID: 107, ColumnID: 2}, WRITE_ONLY] to: [ColumnName:{DescID: 107, Name: v1, ColumnID: 2}, ABSENT] kind: Precedence @@ -701,6 +713,14 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; to: [Column:{DescID: 107, ColumnID: 2}, ABSENT] kind: Precedence rule: indexes containing column reach absent before column +- from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, PUBLIC] + to: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, VALIDATED] to: [IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1}, ABSENT] kind: Precedence @@ -717,10 +737,22 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; to: [IndexName:{DescID: 107, Name: foo_pkey, IndexID: 1}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, VALIDATED] + to: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY - from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, VALIDATED] to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, PUBLIC] kind: SameStagePrecedence rule: primary index swap +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, ABSENT] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILL_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY - from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILL_ONLY] to: [IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 3}, PUBLIC] kind: Precedence @@ -733,10 +765,42 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; to: [IndexName:{DescID: 107, Name: foo_pkey, IndexID: 3}, PUBLIC] kind: Precedence rule: index existence precedes index dependents +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILL_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, MERGE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, MERGED] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, MERGE_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, MERGED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, VALIDATED] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, WRITE_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED - from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT] to: [Column:{DescID: 107, ColumnID: 2}, ABSENT] kind: Precedence rule: indexes containing column reach absent before column +- from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, PUBLIC] + to: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, VALIDATED] to: [IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 2}, ABSENT] kind: Precedence @@ -753,6 +817,14 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; to: [IndexName:{DescID: 107, Name: foo_v2_key, IndexID: 2}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, VALIDATED] + to: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, ABSENT] + to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY - from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, DELETE_ONLY] to: [IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 4}, PUBLIC] kind: Precedence @@ -761,10 +833,22 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; to: [IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 4}, PUBLIC] kind: Precedence rule: temp index existence precedes index dependents +- from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, DELETE_ONLY] + to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY] to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED] kind: Precedence rule: temp index is WRITE_ONLY before backfill +- from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY] + to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY - from: [View:{DescID: 108}, ABSENT] to: [Column:{DescID: 108, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -845,6 +929,14 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; to: [UserPrivileges:{DescID: 108, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 108}, DROPPED] + to: [View:{DescID: 108}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 108}, TXN_DROPPED] + to: [View:{DescID: 108}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED ops ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; @@ -1070,7 +1162,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 20 MutationType ops [[IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT - [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY + [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], PUBLIC] -> VALIDATED [[IndexName:{DescID: 107, Name: foo_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT @@ -1175,7 +1267,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 20 MutationType ops JobID: 1 PostCommitNonRevertiblePhase stage 2 of 3 with 18 MutationType ops transitions: - [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], VALIDATED] -> DELETE_ONLY [[SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT], DELETE_ONLY] -> ABSENT [[View:{DescID: 108}, ABSENT], DROPPED] -> ABSENT [[Column:{DescID: 108, ColumnID: 1}, ABSENT], DELETE_ONLY] -> ABSENT @@ -1185,9 +1277,6 @@ PostCommitNonRevertiblePhase stage 2 of 3 with 18 MutationType ops [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], DELETE_ONLY] -> ABSENT [[TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, TRANSIENT_ABSENT], TRANSIENT_DELETE_ONLY] -> TRANSIENT_ABSENT ops: - *scop.MakeDroppedIndexDeleteOnly - IndexID: 1 - TableID: 107 *scop.LogEvent Element: SecondaryIndex: @@ -1298,6 +1387,9 @@ PostCommitNonRevertiblePhase stage 2 of 3 with 18 MutationType ops *scop.MakeIndexAbsent IndexID: 4 TableID: 107 + *scop.MakeDroppedIndexDeleteOnly + IndexID: 1 + TableID: 107 *scop.SetJobStateOnDescriptor DescriptorID: 104 *scop.SetJobStateOnDescriptor @@ -1372,6 +1464,18 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 10 MutationType ops deps ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; ---- +- from: [Column:{DescID: 107, ColumnID: 3}, DELETE_ONLY] + to: [Column:{DescID: 107, ColumnID: 3}, ABSENT] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [Column:{DescID: 107, ColumnID: 3}, PUBLIC] + to: [Column:{DescID: 107, ColumnID: 3}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY +- from: [Column:{DescID: 107, ColumnID: 3}, WRITE_ONLY] + to: [Column:{DescID: 107, ColumnID: 3}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY - from: [Column:{DescID: 107, ColumnID: 3}, WRITE_ONLY] to: [ColumnDefaultExpression:{DescID: 107, ColumnID: 3}, ABSENT] kind: Precedence @@ -1568,6 +1672,14 @@ ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; to: [Column:{DescID: 107, ColumnID: 3}, ABSENT] kind: Precedence rule: indexes containing column reach absent before column +- from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, PUBLIC] + to: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, VALIDATED] to: [IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1}, ABSENT] kind: Precedence @@ -1584,10 +1696,22 @@ ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; to: [IndexName:{DescID: 107, Name: foo_pkey, IndexID: 1}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, VALIDATED] + to: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY - from: [PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, VALIDATED] to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, PUBLIC] kind: SameStagePrecedence rule: primary index swap +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, ABSENT] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILL_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY - from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILL_ONLY] to: [IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 3}, PUBLIC] kind: Precedence @@ -1600,10 +1724,42 @@ ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; to: [IndexName:{DescID: 107, Name: foo_pkey, IndexID: 3}, PUBLIC] kind: Precedence rule: index existence precedes index dependents +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILL_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, DELETE_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, MERGE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, MERGED] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, MERGE_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, MERGED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, VALIDATED] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC +- from: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, WRITE_ONLY] + to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED - from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT] to: [Column:{DescID: 107, ColumnID: 3}, ABSENT] kind: Precedence rule: indexes containing column reach absent before column +- from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, PUBLIC] + to: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, VALIDATED] to: [Column:{DescID: 107, ColumnID: 3}, WRITE_ONLY] kind: Precedence @@ -1624,6 +1780,14 @@ ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; to: [IndexName:{DescID: 107, Name: foo_v2_key, IndexID: 2}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, VALIDATED] + to: [SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, ABSENT] + to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY - from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, DELETE_ONLY] to: [IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 4}, PUBLIC] kind: Precedence @@ -1632,10 +1796,22 @@ ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; to: [IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 4}, PUBLIC] kind: Precedence rule: temp index existence precedes index dependents +- from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, DELETE_ONLY] + to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY] to: [PrimaryIndex:{DescID: 107, IndexID: 3, ConstraintID: 3, TemporaryIndexID: 4, SourceIndexID: 1}, BACKFILLED] kind: Precedence rule: temp index is WRITE_ONLY before backfill +- from: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, WRITE_ONLY] + to: [TemporaryIndex:{DescID: 107, IndexID: 4, ConstraintID: 4, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY - from: [View:{DescID: 108}, ABSENT] to: [Column:{DescID: 108, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -1716,3 +1892,11 @@ ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; to: [UserPrivileges:{DescID: 108, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 108}, DROPPED] + to: [View:{DescID: 108}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 108}, TXN_DROPPED] + to: [View:{DescID: 108}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED diff --git a/pkg/sql/schemachanger/scplan/testdata/create_index b/pkg/sql/schemachanger/scplan/testdata/create_index index fccb19b04d9e..01b8be609027 100644 --- a/pkg/sql/schemachanger/scplan/testdata/create_index +++ b/pkg/sql/schemachanger/scplan/testdata/create_index @@ -211,6 +211,14 @@ CREATE INDEX id1 ON defaultdb.t1 (id, name) STORING (money) to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] kind: SameStagePrecedence rules: [index dependents exist before index becomes public; index named right before index becomes public] +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, ABSENT] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY - from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, PUBLIC] kind: Precedence @@ -227,6 +235,34 @@ CREATE INDEX id1 ON defaultdb.t1 (id, name) STORING (money) to: [IndexName:{DescID: 104, Name: id1, IndexID: 2}, PUBLIC] kind: Precedence rule: index existence precedes index dependents +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, MERGE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, MERGED] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, MERGE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, MERGED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, VALIDATED] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, WRITE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, ABSENT] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY - from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, DELETE_ONLY] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3}, PUBLIC] kind: Precedence @@ -239,10 +275,22 @@ CREATE INDEX id1 ON defaultdb.t1 (id, name) STORING (money) to: [IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3}, PUBLIC] kind: Precedence rule: temp index existence precedes index dependents +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, DELETE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, WRITE_ONLY] to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] kind: Precedence rule: temp index is WRITE_ONLY before backfill +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, WRITE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY ops CREATE INVERTED INDEX CONCURRENTLY id1 ON defaultdb.t1 (id, name) STORING (money) @@ -458,6 +506,14 @@ CREATE INDEX id1 ON defaultdb.t1 (id, name) STORING (money) to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] kind: SameStagePrecedence rules: [index dependents exist before index becomes public; index named right before index becomes public] +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, ABSENT] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY - from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, PUBLIC] kind: Precedence @@ -474,6 +530,34 @@ CREATE INDEX id1 ON defaultdb.t1 (id, name) STORING (money) to: [IndexName:{DescID: 104, Name: id1, IndexID: 2}, PUBLIC] kind: Precedence rule: index existence precedes index dependents +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILL_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, MERGE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, MERGED] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, MERGE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, MERGED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, VALIDATED] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, WRITE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, ABSENT] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY - from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, DELETE_ONLY] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3}, PUBLIC] kind: Precedence @@ -486,7 +570,19 @@ CREATE INDEX id1 ON defaultdb.t1 (id, name) STORING (money) to: [IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3}, PUBLIC] kind: Precedence rule: temp index existence precedes index dependents +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, DELETE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, TRANSIENT_ABSENT] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT - from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, WRITE_ONLY] to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, BACKFILLED] kind: Precedence rule: temp index is WRITE_ONLY before backfill +- from: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, WRITE_ONLY] + to: [TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 0, SourceIndexID: 1}, TRANSIENT_DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_database b/pkg/sql/schemachanger/scplan/testdata/drop_database index a385e3be5a78..ced84237e312 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_database +++ b/pkg/sql/schemachanger/scplan/testdata/drop_database @@ -96,110 +96,7 @@ StatementPhase stage 1 of 1 with 14 MutationType ops DescID: 116 *scop.MarkDescriptorAsSyntheticallyDropped DescID: 117 -PreCommitPhase stage 1 of 1 with 15 MutationType ops - transitions: - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[PrimaryIndex:{DescID: 110, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 112, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 112, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 112, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 112, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 114, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 117, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 117, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 117, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 117, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 117, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 106 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 107 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 108 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 109 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 110 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 111 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 112 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 113 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 114 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 115 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 116 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 117 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 104 - - 105 - - 106 - - 107 - - 108 - - 109 - - 110 - - 111 - - 112 - - 113 - - 114 - - 115 - - 116 - - 117 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 53 MutationType ops - pending - Statements: - - statement: DROP DATABASE db1 CASCADE - redactedstatement: DROP DATABASE ‹db1› CASCADE - statementtag: DROP DATABASE -PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops +PreCommitPhase stage 1 of 1 with 68 MutationType ops transitions: [[Namespace:{DescID: 104, Name: db1, ReferencedDescID: 0}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -236,20 +133,26 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[Table:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 110, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 110, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 110, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 110, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 110, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT + [[PrimaryIndex:{DescID: 110, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 110, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: sq1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 108}, ABSENT], PUBLIC] -> ABSENT @@ -265,20 +168,26 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[ObjectParent:{DescID: 109, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 109, Comment: t1 is good}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT + [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 109, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: v1, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 111}, ABSENT], PUBLIC] -> ABSENT @@ -286,10 +195,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 112, Name: v2, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -298,12 +210,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 112, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 112}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 112, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 112, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 112, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 112, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 112, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 112, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 112, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 113, Name: v3, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -312,12 +228,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 114, Name: v4, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -326,12 +246,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 114, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 114}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 114, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 115, Name: typ, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -355,14 +279,19 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops [[UserPrivileges:{DescID: 117, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 117}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 117, ReferencedDescID: 106}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 117, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 117, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 117, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 117, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 117, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 117, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 117, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: @@ -564,36 +493,73 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 68 MutationType ops SchemaID: 106 *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 106 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 107 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 108 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 109 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 110 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 111 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 112 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 113 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 114 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 115 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 116 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 117 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 104 + - 105 + - 106 + - 107 + - 108 + - 109 + - 110 + - 111 + - 112 + - 113 + - 114 + - 115 + - 116 + - 117 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 74 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 59 MutationType ops + pending + Statements: + - statement: DROP DATABASE db1 CASCADE + redactedstatement: DROP DATABASE ‹db1› CASCADE + statementtag: DROP DATABASE +PostCommitNonRevertiblePhase stage 1 of 1 with 74 MutationType ops transitions: [[Database:{DescID: 104}, ABSENT], DROPPED] -> ABSENT [[Schema:{DescID: 105}, ABSENT], DROPPED] -> ABSENT @@ -1297,6 +1263,10 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 74 MutationType ops deps DROP DATABASE db1 CASCADE ---- +- from: [AliasType:{DescID: 116}, DROPPED] + to: [AliasType:{DescID: 116}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [AliasType:{DescID: 116}, DROPPED] to: [Namespace:{DescID: 116, Name: _typ, ReferencedDescID: 104}, ABSENT] kind: SameStagePrecedence @@ -1321,6 +1291,10 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 116, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [AliasType:{DescID: 116}, TXN_DROPPED] + to: [AliasType:{DescID: 116}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Column:{DescID: 109, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT] kind: Precedence @@ -1849,6 +1823,10 @@ DROP DATABASE db1 CASCADE to: [Column:{DescID: 117, ColumnID: 4294967295}, ABSENT] kind: Precedence rule: dependents removed before column +- from: [Database:{DescID: 104}, DROPPED] + to: [Database:{DescID: 104}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Database:{DescID: 104}, DROPPED] to: [DatabaseComment:{DescID: 104, Comment: db1 is good}, ABSENT] kind: SameStagePrecedence @@ -1937,6 +1915,14 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 104, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Database:{DescID: 104}, TXN_DROPPED] + to: [Database:{DescID: 104}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED +- from: [EnumType:{DescID: 115}, DROPPED] + to: [EnumType:{DescID: 115}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [EnumType:{DescID: 115}, DROPPED] to: [EnumTypeValue:{DescID: 115, Name: a}, ABSENT] kind: SameStagePrecedence @@ -1965,6 +1951,10 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 115, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [EnumType:{DescID: 115}, TXN_DROPPED] + to: [EnumType:{DescID: 115}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT] to: [Column:{DescID: 109, ColumnID: 1}, ABSENT] kind: Precedence @@ -2069,6 +2059,10 @@ DROP DATABASE db1 CASCADE to: [Owner:{DescID: 105}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Schema:{DescID: 105}, DROPPED] + to: [Schema:{DescID: 105}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Schema:{DescID: 105}, DROPPED] to: [SchemaParent:{DescID: 105, ReferencedDescID: 104}, ABSENT] kind: SameStagePrecedence @@ -2085,6 +2079,10 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 105, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Schema:{DescID: 105}, TXN_DROPPED] + to: [Schema:{DescID: 105}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Schema:{DescID: 106}, DROPPED] to: [Namespace:{DescID: 106, Name: sc1, ReferencedDescID: 104}, ABSENT] kind: SameStagePrecedence @@ -2129,6 +2127,10 @@ DROP DATABASE db1 CASCADE to: [Owner:{DescID: 106}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Schema:{DescID: 106}, DROPPED] + to: [Schema:{DescID: 106}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Schema:{DescID: 106}, DROPPED] to: [SchemaComment:{DescID: 106, Comment: sc1 is good}, ABSENT] kind: SameStagePrecedence @@ -2145,6 +2147,10 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 106, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Schema:{DescID: 106}, TXN_DROPPED] + to: [Schema:{DescID: 106}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Sequence:{DescID: 107}, DROPPED] to: [ColumnDefaultExpression:{DescID: 110, ColumnID: 3}, ABSENT] kind: SameStagePrecedence @@ -2161,6 +2167,10 @@ DROP DATABASE db1 CASCADE to: [Owner:{DescID: 107}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 107}, DROPPED] + to: [Sequence:{DescID: 107}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Sequence:{DescID: 107}, DROPPED] to: [UserPrivileges:{DescID: 107, Name: admin}, ABSENT] kind: SameStagePrecedence @@ -2169,6 +2179,10 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 107, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 107}, TXN_DROPPED] + to: [Sequence:{DescID: 107}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Sequence:{DescID: 108}, DROPPED] to: [ColumnDefaultExpression:{DescID: 109, ColumnID: 3}, ABSENT] kind: SameStagePrecedence @@ -2185,6 +2199,10 @@ DROP DATABASE db1 CASCADE to: [Owner:{DescID: 108}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 108}, DROPPED] + to: [Sequence:{DescID: 108}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Sequence:{DescID: 108}, DROPPED] to: [UserPrivileges:{DescID: 108, Name: admin}, ABSENT] kind: SameStagePrecedence @@ -2193,6 +2211,10 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 108, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 108}, TXN_DROPPED] + to: [Sequence:{DescID: 108}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Table:{DescID: 109}, ABSENT] to: [Column:{DescID: 109, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -2293,6 +2315,10 @@ DROP DATABASE db1 CASCADE to: [Owner:{DescID: 109}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Table:{DescID: 109}, DROPPED] + to: [Table:{DescID: 109}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Table:{DescID: 109}, DROPPED] to: [TableComment:{DescID: 109, Comment: t1 is good}, ABSENT] kind: SameStagePrecedence @@ -2305,6 +2331,10 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 109, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Table:{DescID: 109}, TXN_DROPPED] + to: [Table:{DescID: 109}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Table:{DescID: 110}, ABSENT] to: [Column:{DescID: 110, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -2405,6 +2435,10 @@ DROP DATABASE db1 CASCADE to: [Owner:{DescID: 110}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Table:{DescID: 110}, DROPPED] + to: [Table:{DescID: 110}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Table:{DescID: 110}, DROPPED] to: [UserPrivileges:{DescID: 110, Name: admin}, ABSENT] kind: SameStagePrecedence @@ -2413,6 +2447,10 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 110, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Table:{DescID: 110}, TXN_DROPPED] + to: [Table:{DescID: 110}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 111}, ABSENT] to: [Column:{DescID: 111, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -2469,6 +2507,14 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 111, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 111}, DROPPED] + to: [View:{DescID: 111}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 111}, TXN_DROPPED] + to: [View:{DescID: 111}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 112}, ABSENT] to: [Column:{DescID: 112, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -2537,6 +2583,14 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 112, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 112}, DROPPED] + to: [View:{DescID: 112}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 112}, TXN_DROPPED] + to: [View:{DescID: 112}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 113}, ABSENT] to: [Column:{DescID: 113, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -2605,6 +2659,14 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 113, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 113}, DROPPED] + to: [View:{DescID: 113}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 113}, TXN_DROPPED] + to: [View:{DescID: 113}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 114}, ABSENT] to: [Column:{DescID: 114, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -2673,6 +2735,14 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 114, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 114}, DROPPED] + to: [View:{DescID: 114}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 114}, TXN_DROPPED] + to: [View:{DescID: 114}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 117}, ABSENT] to: [Column:{DescID: 117, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -2753,3 +2823,11 @@ DROP DATABASE db1 CASCADE to: [UserPrivileges:{DescID: 117, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 117}, DROPPED] + to: [View:{DescID: 117}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 117}, TXN_DROPPED] + to: [View:{DescID: 117}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_index b/pkg/sql/schemachanger/scplan/testdata/drop_index index 11c864115043..005aa241bf01 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_index +++ b/pkg/sql/schemachanger/scplan/testdata/drop_index @@ -31,7 +31,6 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT - [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> WRITE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -50,7 +49,7 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops statementtag: DROP INDEX PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops transitions: - [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY ops: *scop.MakeDroppedIndexDeleteOnly IndexID: 2 @@ -109,6 +108,14 @@ DROP INDEX idx1 CASCADE to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT] kind: Precedence rule: dependents removed before index +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, PUBLIC] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, VALIDATED] to: [IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2}, ABSENT] kind: Precedence @@ -121,6 +128,10 @@ DROP INDEX idx1 CASCADE to: [IndexName:{DescID: 104, Name: idx1, IndexID: 2}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, VALIDATED] + to: [SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY ops DROP INDEX idx2 CASCADE @@ -166,7 +177,6 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 4, IndexID: 4}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4}, ABSENT], PUBLIC] -> ABSENT - [[SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT], VALIDATED] -> WRITE_ONLY ops: *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -186,7 +196,7 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 4}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY ops: *scop.MakeDroppedColumnDeleteOnly ColumnID: 4 @@ -253,6 +263,18 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 7 MutationType ops deps DROP INDEX idx2 CASCADE ---- +- from: [Column:{DescID: 104, ColumnID: 4}, DELETE_ONLY] + to: [Column:{DescID: 104, ColumnID: 4}, ABSENT] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [Column:{DescID: 104, ColumnID: 4}, PUBLIC] + to: [Column:{DescID: 104, ColumnID: 4}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY +- from: [Column:{DescID: 104, ColumnID: 4}, WRITE_ONLY] + to: [Column:{DescID: 104, ColumnID: 4}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY - from: [Column:{DescID: 104, ColumnID: 4}, WRITE_ONLY] to: [ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 4}, ABSENT] kind: Precedence @@ -293,6 +315,14 @@ DROP INDEX idx2 CASCADE to: [Column:{DescID: 104, ColumnID: 4}, ABSENT] kind: Precedence rule: indexes containing column reach absent before column +- from: [SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, PUBLIC] + to: [SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, VALIDATED] to: [Column:{DescID: 104, ColumnID: 4}, WRITE_ONLY] kind: Precedence @@ -309,6 +339,10 @@ DROP INDEX idx2 CASCADE to: [IndexName:{DescID: 104, Name: idx2, IndexID: 4}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, VALIDATED] + to: [SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY - from: [SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, VALIDATED] to: [SecondaryIndexPartial:{DescID: 104, IndexID: 4}, ABSENT] kind: Precedence @@ -363,7 +397,6 @@ PreCommitPhase stage 1 of 1 with 4 MutationType ops [[IndexColumn:{DescID: 104, ColumnID: 5, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6}, ABSENT], PUBLIC] -> ABSENT - [[SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT], VALIDATED] -> WRITE_ONLY [[CheckConstraint:{DescID: 104, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 104, Name: check_crdb_internal_i_shard_16, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT ops: @@ -390,7 +423,7 @@ PreCommitPhase stage 1 of 1 with 4 MutationType ops PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 5}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT], WRITE_ONLY] -> DELETE_ONLY + [[SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY ops: *scop.MakeDroppedColumnDeleteOnly ColumnID: 5 @@ -459,6 +492,18 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 6 MutationType ops deps DROP INDEX idx3 CASCADE ---- +- from: [Column:{DescID: 104, ColumnID: 5}, DELETE_ONLY] + to: [Column:{DescID: 104, ColumnID: 5}, ABSENT] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [Column:{DescID: 104, ColumnID: 5}, PUBLIC] + to: [Column:{DescID: 104, ColumnID: 5}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY +- from: [Column:{DescID: 104, ColumnID: 5}, WRITE_ONLY] + to: [Column:{DescID: 104, ColumnID: 5}, DELETE_ONLY] + kind: PreviousTransactionPrecedence + rule: Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY - from: [Column:{DescID: 104, ColumnID: 5}, WRITE_ONLY] to: [ColumnName:{DescID: 104, Name: crdb_internal_i_shard_16, ColumnID: 5}, ABSENT] kind: Precedence @@ -507,6 +552,14 @@ DROP INDEX idx3 CASCADE to: [Column:{DescID: 104, ColumnID: 5}, ABSENT] kind: Precedence rule: indexes containing column reach absent before column +- from: [SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, PUBLIC] + to: [SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, VALIDATED] to: [Column:{DescID: 104, ColumnID: 5}, WRITE_ONLY] kind: Precedence @@ -527,6 +580,10 @@ DROP INDEX idx3 CASCADE to: [IndexName:{DescID: 104, Name: idx3, IndexID: 6}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, VALIDATED] + to: [SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY ops DROP INDEX idx4 CASCADE @@ -549,53 +606,26 @@ StatementPhase stage 1 of 1 with 3 MutationType ops TableID: 104 *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 -PreCommitPhase stage 1 of 1 with 3 MutationType ops +PreCommitPhase stage 1 of 1 with 7 MutationType ops transitions: [[IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT - [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], VALIDATED] -> WRITE_ONLY - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 104 - - 105 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops pending - Statements: - - statement: DROP INDEX idx4 CASCADE - redactedstatement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE - statementtag: DROP INDEX -PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops - transitions: - [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[Namespace:{DescID: 105, Name: v, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: count, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: - *scop.MakeDroppedIndexDeleteOnly - IndexID: 8 - TableID: 104 *scop.MarkDescriptorAsDropped DescID: 105 *scop.RemoveViewBackReferencesInRelations @@ -612,44 +642,31 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops SchemaID: 101 *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 104 + - 105 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 11 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops pending + Statements: + - statement: DROP INDEX idx4 CASCADE + redactedstatement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE + statementtag: DROP INDEX +PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops transitions: - [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], DELETE_ONLY] -> ABSENT + [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], VALIDATED] -> DELETE_ONLY [[View:{DescID: 105}, ABSENT], DROPPED] -> ABSENT [[Column:{DescID: 105, ColumnID: 1}, ABSENT], DELETE_ONLY] -> ABSENT [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], DELETE_ONLY] -> ABSENT [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], DELETE_ONLY] -> ABSENT ops: - *scop.LogEvent - Element: - SecondaryIndex: - constraintId: 3 - indexId: 8 - isCreatedExplicitly: true - isUnique: true - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 - *scop.CreateGcJobForIndex - IndexID: 8 - StatementForDropJob: - Statement: DROP INDEX defaultdb.public.t1@idx4 CASCADE - TableID: 104 - *scop.MakeIndexAbsent - IndexID: 8 - TableID: 104 *scop.LogEvent Element: View: @@ -705,11 +722,47 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 11 MutationType ops SourceElementID: 1 SubWorkID: 1 TableID: 105 - *scop.RemoveJobStateFromDescriptor + *scop.MakeDroppedIndexDeleteOnly + IndexID: 8 + TableID: 104 + *scop.SetJobStateOnDescriptor DescriptorID: 104 + *scop.UpdateSchemaChangerJob + DescriptorIDsToRemove: + - 105 + IsNonCancelable: true JobID: 1 +PostCommitNonRevertiblePhase stage 2 of 2 with 5 MutationType ops + transitions: + [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], DELETE_ONLY] -> ABSENT + ops: + *scop.LogEvent + Element: + SecondaryIndex: + constraintId: 3 + indexId: 8 + isCreatedExplicitly: true + isUnique: true + tableId: 104 + EventBase: + Authorization: + UserName: root + Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE + StatementTag: DROP INDEX + TargetMetadata: + SourceElementID: 1 + SubWorkID: 1 + TargetStatus: 1 + *scop.CreateGcJobForIndex + IndexID: 8 + StatementForDropJob: + Statement: DROP INDEX defaultdb.public.t1@idx4 CASCADE + TableID: 104 + *scop.MakeIndexAbsent + IndexID: 8 + TableID: 104 *scop.RemoveJobStateFromDescriptor - DescriptorID: 105 + DescriptorID: 104 JobID: 1 *scop.UpdateSchemaChangerJob IsNonCancelable: true @@ -778,6 +831,14 @@ DROP INDEX idx4 CASCADE to: [SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT] kind: Precedence rule: dependents removed before index +- from: [SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, DELETE_ONLY] + to: [SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT +- from: [SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, PUBLIC] + to: [SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, VALIDATED] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED - from: [SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, VALIDATED] to: [IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 8}, ABSENT] kind: Precedence @@ -790,6 +851,10 @@ DROP INDEX idx4 CASCADE to: [IndexName:{DescID: 104, Name: idx4, IndexID: 8}, ABSENT] kind: Precedence rule: index no longer public before dependents +- from: [SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, VALIDATED] + to: [SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, WRITE_ONLY] + kind: PreviousTransactionPrecedence + rule: SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY - from: [View:{DescID: 105}, ABSENT] to: [Column:{DescID: 105, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -846,3 +911,11 @@ DROP INDEX idx4 CASCADE to: [UserPrivileges:{DescID: 105, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 105}, DROPPED] + to: [View:{DescID: 105}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 105}, TXN_DROPPED] + to: [View:{DescID: 105}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by index a5dd383c4d00..cd051ef6eed2 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by +++ b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by @@ -66,100 +66,16 @@ StatementPhase stage 1 of 1 with 9 MutationType ops DescID: 112 *scop.MarkDescriptorAsSyntheticallyDropped DescID: 113 -PreCommitPhase stage 1 of 1 with 14 MutationType ops +PreCommitPhase stage 1 of 1 with 46 MutationType ops transitions: [[UserPrivileges:{DescID: 100, Name: r}, ABSENT], PUBLIC] -> ABSENT - [[UserPrivileges:{DescID: 104, Name: r}, ABSENT], PUBLIC] -> ABSENT - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - ops: - *scop.RemoveUserPrivileges - DescID: 100 - User: r - *scop.RemoveUserPrivileges - DescID: 104 - User: r - *scop.SetJobStateOnDescriptor - DescriptorID: 100 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 106 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 107 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 108 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 109 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 110 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 111 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 112 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 113 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 100 - - 104 - - 105 - - 106 - - 107 - - 108 - - 109 - - 110 - - 111 - - 112 - - 113 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops - pending - Statements: - - statement: DROP OWNED BY r - redactedstatement: DROP OWNED BY r - statementtag: DROP OWNED BY -PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops - transitions: [[Namespace:{DescID: 105, Name: s, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: admin}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[Schema:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[SchemaParent:{DescID: 105, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT + [[UserPrivileges:{DescID: 104, Name: r}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: sq, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 106}, ABSENT], PUBLIC] -> ABSENT [[UserPrivileges:{DescID: 106, Name: admin}, ABSENT], PUBLIC] -> ABSENT @@ -173,20 +89,26 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops [[Table:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT + [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 109, Name: t_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: sq, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT @@ -201,20 +123,26 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops [[Table:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 108, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 108, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 108, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT + [[PrimaryIndex:{DescID: 108, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 108, Name: t_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 110, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 110}, ABSENT], PUBLIC] -> ABSENT @@ -222,10 +150,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -249,21 +180,31 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 105}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: + *scop.RemoveUserPrivileges + DescID: 100 + User: r *scop.MarkDescriptorAsDropped DescID: 105 *scop.RemoveSchemaParent Parent: ParentDatabaseID: 100 SchemaID: 105 + *scop.RemoveUserPrivileges + DescID: 104 + User: r *scop.MarkDescriptorAsDropped DescID: 106 *scop.RemoveAllTableComments @@ -376,30 +317,61 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 44 MutationType ops SchemaID: 105 *scop.SetJobStateOnDescriptor DescriptorID: 100 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 106 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 107 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 108 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 109 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 110 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 111 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 112 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 113 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 100 + - 104 + - 105 + - 106 + - 107 + - 108 + - 109 + - 110 + - 111 + - 112 + - 113 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 47 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 35 MutationType ops + pending + Statements: + - statement: DROP OWNED BY r + redactedstatement: DROP OWNED BY r + statementtag: DROP OWNED BY +PostCommitNonRevertiblePhase stage 1 of 1 with 47 MutationType ops transitions: [[Schema:{DescID: 105}, ABSENT], DROPPED] -> ABSENT [[Sequence:{DescID: 106}, ABSENT], DROPPED] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_schema b/pkg/sql/schemachanger/scplan/testdata/drop_schema index 6be069c88e36..a481861745e4 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_schema +++ b/pkg/sql/schemachanger/scplan/testdata/drop_schema @@ -15,6 +15,10 @@ COMMENT ON TABLE sc1.t1 IS 't1 is good table'; deps DROP SCHEMA defaultdb.SC1 CASCADE ---- +- from: [AliasType:{DescID: 112}, DROPPED] + to: [AliasType:{DescID: 112}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [AliasType:{DescID: 112}, DROPPED] to: [Namespace:{DescID: 112, Name: _typ, ReferencedDescID: 100}, ABSENT] kind: SameStagePrecedence @@ -39,6 +43,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 112, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [AliasType:{DescID: 112}, TXN_DROPPED] + to: [AliasType:{DescID: 112}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Column:{DescID: 106, ColumnID: 1}, WRITE_ONLY] to: [ColumnName:{DescID: 106, Name: id, ColumnID: 1}, ABSENT] kind: Precedence @@ -463,6 +471,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [Column:{DescID: 113, ColumnID: 4294967295}, ABSENT] kind: Precedence rule: dependents removed before column +- from: [EnumType:{DescID: 111}, DROPPED] + to: [EnumType:{DescID: 111}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [EnumType:{DescID: 111}, DROPPED] to: [EnumTypeValue:{DescID: 111, Name: a}, ABSENT] kind: SameStagePrecedence @@ -491,6 +503,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 111, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [EnumType:{DescID: 111}, TXN_DROPPED] + to: [EnumType:{DescID: 111}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1}, ABSENT] to: [Column:{DescID: 106, ColumnID: 1}, ABSENT] kind: Precedence @@ -579,6 +595,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [Owner:{DescID: 104}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Schema:{DescID: 104}, DROPPED] + to: [Schema:{DescID: 104}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Schema:{DescID: 104}, DROPPED] to: [SchemaComment:{DescID: 104, Comment: sc1 is good schema}, ABSENT] kind: SameStagePrecedence @@ -595,6 +615,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 104, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Schema:{DescID: 104}, TXN_DROPPED] + to: [Schema:{DescID: 104}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Sequence:{DescID: 105}, DROPPED] to: [ColumnDefaultExpression:{DescID: 106, ColumnID: 3}, ABSENT] kind: SameStagePrecedence @@ -611,6 +635,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [Owner:{DescID: 105}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 105}, DROPPED] + to: [Sequence:{DescID: 105}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Sequence:{DescID: 105}, DROPPED] to: [UserPrivileges:{DescID: 105, Name: admin}, ABSENT] kind: SameStagePrecedence @@ -619,6 +647,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 105, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 105}, TXN_DROPPED] + to: [Sequence:{DescID: 105}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [Table:{DescID: 106}, ABSENT] to: [Column:{DescID: 106, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -719,6 +751,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [Owner:{DescID: 106}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Table:{DescID: 106}, DROPPED] + to: [Table:{DescID: 106}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Table:{DescID: 106}, DROPPED] to: [TableComment:{DescID: 106, Comment: t1 is good table}, ABSENT] kind: SameStagePrecedence @@ -731,6 +767,10 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 106, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Table:{DescID: 106}, TXN_DROPPED] + to: [Table:{DescID: 106}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 107}, ABSENT] to: [Column:{DescID: 107, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -787,6 +827,14 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 107, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 107}, DROPPED] + to: [View:{DescID: 107}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 107}, TXN_DROPPED] + to: [View:{DescID: 107}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 108}, ABSENT] to: [Column:{DescID: 108, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -855,6 +903,14 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 108, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 108}, DROPPED] + to: [View:{DescID: 108}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 108}, TXN_DROPPED] + to: [View:{DescID: 108}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 109}, ABSENT] to: [Column:{DescID: 109, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -923,6 +979,14 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 109, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 109}, DROPPED] + to: [View:{DescID: 109}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 109}, TXN_DROPPED] + to: [View:{DescID: 109}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 110}, ABSENT] to: [Column:{DescID: 110, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -991,6 +1055,14 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 110, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 110}, DROPPED] + to: [View:{DescID: 110}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 110}, TXN_DROPPED] + to: [View:{DescID: 110}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 113}, ABSENT] to: [Column:{DescID: 113, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -1071,6 +1143,14 @@ DROP SCHEMA defaultdb.SC1 CASCADE to: [UserPrivileges:{DescID: 113, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 113}, DROPPED] + to: [View:{DescID: 113}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 113}, TXN_DROPPED] + to: [View:{DescID: 113}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED ops DROP SCHEMA defaultdb.SC1 CASCADE @@ -1134,92 +1214,7 @@ StatementPhase stage 1 of 1 with 10 MutationType ops DescID: 112 *scop.MarkDescriptorAsSyntheticallyDropped DescID: 113 -PreCommitPhase stage 1 of 1 with 12 MutationType ops - transitions: - [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 106, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 106, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 100 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 106 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 107 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 108 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 109 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 110 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 111 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 112 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 113 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 100 - - 104 - - 105 - - 106 - - 107 - - 108 - - 109 - - 110 - - 111 - - 112 - - 113 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 37 MutationType ops - pending - Statements: - - statement: DROP SCHEMA defaultdb.sc1 CASCADE - redactedstatement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - statementtag: DROP SCHEMA -PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops +PreCommitPhase stage 1 of 1 with 49 MutationType ops transitions: [[Namespace:{DescID: 104, Name: sc1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -1242,20 +1237,26 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[ObjectParent:{DescID: 106, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 106, Comment: t1 is good table}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 106, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: name, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: val, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 106, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT + [[PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 106, Name: t1_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 107}, ABSENT], PUBLIC] -> ABSENT @@ -1263,10 +1264,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: v2, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1275,12 +1279,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 109, Name: v3, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1289,12 +1297,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 109, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 109}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 109, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 110, Name: v4, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1303,12 +1315,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 110, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 110}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 110, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 110, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 110, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 110, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -1332,14 +1348,19 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops [[UserPrivileges:{DescID: 113, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 113}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 113, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 113, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 113, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 113, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: @@ -1478,30 +1499,61 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 49 MutationType ops SchemaID: 104 *scop.SetJobStateOnDescriptor DescriptorID: 100 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 106 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 107 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 108 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 109 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 110 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 111 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 112 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 113 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 100 + - 104 + - 105 + - 106 + - 107 + - 108 + - 109 + - 110 + - 111 + - 112 + - 113 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 57 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 45 MutationType ops + pending + Statements: + - statement: DROP SCHEMA defaultdb.sc1 CASCADE + redactedstatement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE + statementtag: DROP SCHEMA +PostCommitNonRevertiblePhase stage 1 of 1 with 57 MutationType ops transitions: [[Schema:{DescID: 104}, ABSENT], DROPPED] -> ABSENT [[Sequence:{DescID: 105}, ABSENT], DROPPED] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_sequence b/pkg/sql/schemachanger/scplan/testdata/drop_sequence index 73258e57abb0..67efed46df21 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_sequence +++ b/pkg/sql/schemachanger/scplan/testdata/drop_sequence @@ -11,25 +11,7 @@ StatementPhase stage 1 of 1 with 1 MutationType op ops: *scop.MarkDescriptorAsSyntheticallyDropped DescID: 104 -PreCommitPhase stage 1 of 1 with 2 MutationType ops - transitions: - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 104 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops pending - Statements: - - statement: DROP SEQUENCE defaultdb.sq1 - redactedstatement: DROP SEQUENCE ‹defaultdb›.public.‹sq1› - statementtag: DROP SEQUENCE -PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops +PreCommitPhase stage 1 of 1 with 5 MutationType ops transitions: [[Namespace:{DescID: 104, Name: sq1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -50,10 +32,20 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops SchemaID: 101 *scop.SetJobStateOnDescriptor DescriptorID: 104 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 104 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 4 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending + Statements: + - statement: DROP SEQUENCE defaultdb.sq1 + redactedstatement: DROP SEQUENCE ‹defaultdb›.public.‹sq1› + statementtag: DROP SEQUENCE +PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops transitions: [[Sequence:{DescID: 104}, ABSENT], DROPPED] -> ABSENT ops: @@ -95,33 +87,7 @@ StatementPhase stage 1 of 1 with 1 MutationType op ops: *scop.MarkDescriptorAsSyntheticallyDropped DescID: 104 -PreCommitPhase stage 1 of 1 with 4 MutationType ops - transitions: - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 106 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 104 - - 105 - - 106 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops pending - Statements: - - statement: DROP SEQUENCE defaultdb.sq1 CASCADE - redactedstatement: DROP SEQUENCE ‹defaultdb›.public.‹sq1› CASCADE - statementtag: DROP SEQUENCE -PostCommitNonRevertiblePhase stage 1 of 2 with 11 MutationType ops +PreCommitPhase stage 1 of 1 with 11 MutationType ops transitions: [[Namespace:{DescID: 104, Name: sq1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -160,14 +126,28 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 11 MutationType ops SchemaID: 101 *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 106 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 104 + - 105 + - 106 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 6 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending + Statements: + - statement: DROP SEQUENCE defaultdb.sq1 CASCADE + redactedstatement: DROP SEQUENCE ‹defaultdb›.public.‹sq1› CASCADE + statementtag: DROP SEQUENCE +PostCommitNonRevertiblePhase stage 1 of 1 with 6 MutationType ops transitions: [[Sequence:{DescID: 104}, ABSENT], DROPPED] -> ABSENT ops: @@ -225,6 +205,10 @@ DROP SEQUENCE defaultdb.SQ1 CASCADE to: [Owner:{DescID: 104}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 104}, DROPPED] + to: [Sequence:{DescID: 104}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Sequence:{DescID: 104}, DROPPED] to: [UserPrivileges:{DescID: 104, Name: admin}, ABSENT] kind: SameStagePrecedence @@ -233,3 +217,7 @@ DROP SEQUENCE defaultdb.SQ1 CASCADE to: [UserPrivileges:{DescID: 104, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 104}, TXN_DROPPED] + to: [Sequence:{DescID: 104}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_table b/pkg/sql/schemachanger/scplan/testdata/drop_table index 63dbf97c38af..3c1dcaf11747 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_table +++ b/pkg/sql/schemachanger/scplan/testdata/drop_table @@ -54,67 +54,7 @@ StatementPhase stage 1 of 1 with 3 MutationType ops DescID: 110 *scop.MarkDescriptorAsSyntheticallyDropped DescID: 111 -PreCommitPhase stage 1 of 1 with 9 MutationType ops - transitions: - [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 5}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY - [[SecondaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 106 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 107 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 108 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 109 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 110 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 111 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 104 - - 105 - - 106 - - 107 - - 108 - - 109 - - 110 - - 111 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 23 MutationType ops - pending - Statements: - - statement: DROP TABLE defaultdb.shipments CASCADE - redactedstatement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - statementtag: DROP TABLE -PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops +PreCommitPhase stage 1 of 1 with 32 MutationType ops transitions: [[Namespace:{DescID: 109, Name: shipments, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT @@ -124,22 +64,29 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops [[ObjectParent:{DescID: 109, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[TableComment:{DescID: 109, Comment: shipment is important}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 109, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tracking_number, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnComment:{DescID: 109, ColumnID: 1, Comment: tracking_number is a must}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: carrier, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[SequenceOwner:{DescID: 109, ColumnID: 2, ReferencedDescID: 110}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: status, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: customer_id, ColumnID: 4}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 5}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: randcol, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 109, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 109, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 109, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -147,12 +94,14 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops [[IndexColumn:{DescID: 109, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 4, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 5, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT + [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 109, Name: shipments_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexComment:{DescID: 109, IndexID: 1, Comment: pkey is good}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 4, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndexPartial:{DescID: 109, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT + [[SecondaryIndex:{DescID: 109, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 109, Name: partialidx, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[ForeignKeyConstraint:{DescID: 109, ConstraintID: 2, ReferencedDescID: 104}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 109, Name: fk_customers, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT @@ -171,12 +120,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: customer_id, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: carrier, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: @@ -263,24 +216,49 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 32 MutationType ops SchemaID: 101 *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 106 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 107 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 108 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 109 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 110 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 111 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 104 + - 105 + - 106 + - 107 + - 108 + - 109 + - 110 + - 111 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 26 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 17 MutationType ops + pending + Statements: + - statement: DROP TABLE defaultdb.shipments CASCADE + redactedstatement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE + statementtag: DROP TABLE +PostCommitNonRevertiblePhase stage 1 of 1 with 26 MutationType ops transitions: [[Table:{DescID: 109}, ABSENT], DROPPED] -> ABSENT [[Column:{DescID: 109, ColumnID: 1}, ABSENT], DELETE_ONLY] -> ABSENT @@ -903,6 +881,10 @@ DROP TABLE defaultdb.shipments CASCADE; to: [Owner:{DescID: 110}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 110}, DROPPED] + to: [Sequence:{DescID: 110}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Sequence:{DescID: 110}, DROPPED] to: [SequenceOwner:{DescID: 109, ColumnID: 2, ReferencedDescID: 110}, ABSENT] kind: SameStagePrecedence @@ -915,6 +897,10 @@ DROP TABLE defaultdb.shipments CASCADE; to: [UserPrivileges:{DescID: 110, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Sequence:{DescID: 110}, TXN_DROPPED] + to: [Sequence:{DescID: 110}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [SequenceOwner:{DescID: 109, ColumnID: 2, ReferencedDescID: 110}, ABSENT] to: [Column:{DescID: 109, ColumnID: 2}, ABSENT] kind: Precedence @@ -1115,6 +1101,10 @@ DROP TABLE defaultdb.shipments CASCADE; to: [SequenceOwner:{DescID: 109, ColumnID: 2, ReferencedDescID: 110}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Table:{DescID: 109}, DROPPED] + to: [Table:{DescID: 109}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [Table:{DescID: 109}, DROPPED] to: [TableComment:{DescID: 109, Comment: shipment is important}, ABSENT] kind: SameStagePrecedence @@ -1127,6 +1117,10 @@ DROP TABLE defaultdb.shipments CASCADE; to: [UserPrivileges:{DescID: 109, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [Table:{DescID: 109}, TXN_DROPPED] + to: [Table:{DescID: 109}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 111}, ABSENT] to: [Column:{DescID: 111, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -1195,6 +1189,14 @@ DROP TABLE defaultdb.shipments CASCADE; to: [UserPrivileges:{DescID: 111, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 111}, DROPPED] + to: [View:{DescID: 111}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 111}, TXN_DROPPED] + to: [View:{DescID: 111}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED setup CREATE TYPE defaultdb.greeting AS ENUM ('hello'); @@ -1222,41 +1224,7 @@ StatementPhase stage 1 of 1 with 1 MutationType op ops: *scop.MarkDescriptorAsSyntheticallyDropped DescID: 114 -PreCommitPhase stage 1 of 1 with 4 MutationType ops - transitions: - [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 114, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 114, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[PrimaryIndex:{DescID: 114, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY - [[SecondaryIndex:{DescID: 114, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 112 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 113 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 114 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 112 - - 113 - - 114 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 12 MutationType ops - pending - Statements: - - statement: DROP TABLE defaultdb.greeter - redactedstatement: DROP TABLE ‹defaultdb›.public.‹greeter› - statementtag: DROP TABLE -PostCommitNonRevertiblePhase stage 1 of 2 with 16 MutationType ops +PreCommitPhase stage 1 of 1 with 16 MutationType ops transitions: [[Namespace:{DescID: 114, Name: greeter, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 114}, ABSENT], PUBLIC] -> ABSENT @@ -1265,25 +1233,32 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 16 MutationType ops [[Table:{DescID: 114}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 114, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT [[ColumnFamily:{DescID: 114, Name: primary, ColumnFamilyID: 0}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: x, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 114, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: y, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: rowid, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnDefaultExpression:{DescID: 114, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 114, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 114, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 114, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 3, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT + [[PrimaryIndex:{DescID: 114, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 114, Name: greeter_pkey, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 2, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 114, ColumnID: 3, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[SecondaryIndexPartial:{DescID: 114, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT + [[SecondaryIndex:{DescID: 114, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 114, Name: i, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[CheckConstraint:{DescID: 114, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT [[ConstraintName:{DescID: 114, Name: check, ConstraintID: 2}, ABSENT], PUBLIC] -> ABSENT @@ -1335,14 +1310,28 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 16 MutationType ops - 113 *scop.SetJobStateOnDescriptor DescriptorID: 112 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 113 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 114 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 112 + - 113 + - 114 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 11 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops pending + Statements: + - statement: DROP TABLE defaultdb.greeter + redactedstatement: DROP TABLE ‹defaultdb›.public.‹greeter› + statementtag: DROP TABLE +PostCommitNonRevertiblePhase stage 1 of 1 with 11 MutationType ops transitions: [[Table:{DescID: 114}, ABSENT], DROPPED] -> ABSENT [[Column:{DescID: 114, ColumnID: 1}, ABSENT], DELETE_ONLY] -> ABSENT diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_type b/pkg/sql/schemachanger/scplan/testdata/drop_type index 3f8b6628f60b..b6d2a81cc2f4 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_type +++ b/pkg/sql/schemachanger/scplan/testdata/drop_type @@ -14,29 +14,7 @@ StatementPhase stage 1 of 1 with 2 MutationType ops DescID: 104 *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 -PreCommitPhase stage 1 of 1 with 3 MutationType ops - transitions: - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 104 - - 105 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending - Statements: - - statement: DROP TYPE defaultdb.typ - redactedstatement: DROP TYPE ‹defaultdb›.‹public›.‹typ› - statementtag: DROP TYPE -PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops +PreCommitPhase stage 1 of 1 with 7 MutationType ops transitions: [[Namespace:{DescID: 104, Name: typ, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -72,12 +50,24 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops SchemaID: 101 *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 104 + - 105 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 7 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops pending + Statements: + - statement: DROP TYPE defaultdb.typ + redactedstatement: DROP TYPE ‹defaultdb›.‹public›.‹typ› + statementtag: DROP TYPE +PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops transitions: [[EnumType:{DescID: 104}, ABSENT], DROPPED] -> ABSENT [[AliasType:{DescID: 105}, ABSENT], DROPPED] -> ABSENT @@ -138,6 +128,10 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 7 MutationType ops deps DROP TYPE defaultdb.typ ---- +- from: [AliasType:{DescID: 105}, DROPPED] + to: [AliasType:{DescID: 105}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [AliasType:{DescID: 105}, DROPPED] to: [Namespace:{DescID: 105, Name: _typ, ReferencedDescID: 100}, ABSENT] kind: SameStagePrecedence @@ -162,6 +156,14 @@ DROP TYPE defaultdb.typ to: [UserPrivileges:{DescID: 105, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [AliasType:{DescID: 105}, TXN_DROPPED] + to: [AliasType:{DescID: 105}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED +- from: [EnumType:{DescID: 104}, DROPPED] + to: [EnumType:{DescID: 104}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal - from: [EnumType:{DescID: 104}, DROPPED] to: [EnumTypeValue:{DescID: 104, Name: a}, ABSENT] kind: SameStagePrecedence @@ -190,3 +192,7 @@ DROP TYPE defaultdb.typ to: [UserPrivileges:{DescID: 104, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [EnumType:{DescID: 104}, TXN_DROPPED] + to: [EnumType:{DescID: 104}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_view b/pkg/sql/schemachanger/scplan/testdata/drop_view index 82f7c80ca990..6e92db70c202 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_view +++ b/pkg/sql/schemachanger/scplan/testdata/drop_view @@ -15,32 +15,7 @@ StatementPhase stage 1 of 1 with 1 MutationType op ops: *scop.MarkDescriptorAsSyntheticallyDropped DescID: 105 -PreCommitPhase stage 1 of 1 with 3 MutationType ops - transitions: - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 104 - - 105 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending - Statements: - - statement: DROP VIEW defaultdb.v1 - redactedstatement: DROP VIEW ‹defaultdb›.public.‹v1› - statementtag: DROP VIEW -PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops +PreCommitPhase stage 1 of 1 with 7 MutationType ops transitions: [[Namespace:{DescID: 105, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT @@ -48,10 +23,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: @@ -71,12 +49,24 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops SchemaID: 101 *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 104 + - 105 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 8 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops pending + Statements: + - statement: DROP VIEW defaultdb.v1 + redactedstatement: DROP VIEW ‹defaultdb›.public.‹v1› + statementtag: DROP VIEW +PostCommitNonRevertiblePhase stage 1 of 1 with 8 MutationType ops transitions: [[View:{DescID: 105}, ABSENT], DROPPED] -> ABSENT [[Column:{DescID: 105, ColumnID: 1}, ABSENT], DELETE_ONLY] -> ABSENT @@ -254,6 +244,14 @@ DROP VIEW defaultdb.v1 to: [UserPrivileges:{DescID: 105, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 105}, DROPPED] + to: [View:{DescID: 105}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 105}, TXN_DROPPED] + to: [View:{DescID: 105}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED setup CREATE VIEW defaultdb.v2 AS (SELECT name AS n1, name AS n2 FROM v1); @@ -304,74 +302,7 @@ StatementPhase stage 1 of 1 with 5 MutationType ops DescID: 108 *scop.MarkDescriptorAsSyntheticallyDropped DescID: 111 -PreCommitPhase stage 1 of 1 with 9 MutationType ops - transitions: - [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 106, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 107, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY - ops: - *scop.SetJobStateOnDescriptor - DescriptorID: 104 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 105 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 106 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 107 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 108 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 109 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 110 - Initialize: true - *scop.SetJobStateOnDescriptor - DescriptorID: 111 - Initialize: true - *scop.CreateSchemaChangerJob - Authorization: - UserName: root - DescriptorIDs: - - 104 - - 105 - - 106 - - 107 - - 108 - - 109 - - 110 - - 111 - JobID: 1 - NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 21 MutationType ops - pending - Statements: - - statement: DROP VIEW defaultdb.v1 CASCADE - redactedstatement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - statementtag: DROP VIEW -PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops +PreCommitPhase stage 1 of 1 with 30 MutationType ops transitions: [[Namespace:{DescID: 105, Name: v1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 105}, ABSENT], PUBLIC] -> ABSENT @@ -379,10 +310,13 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 105, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 105, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 105, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 105, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 105, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 106, Name: v2, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -391,12 +325,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 106, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 106}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 106, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: n1, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 106, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 106, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 107, Name: v3, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -405,12 +343,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 107, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 107}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 107, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 107, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: name, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 107, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 107, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 107, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 108, Name: v4, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -419,12 +361,16 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 108, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 108}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 108, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n2, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: n1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 108, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 108, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 108, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[Namespace:{DescID: 111, Name: v5, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT @@ -433,14 +379,19 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops [[UserPrivileges:{DescID: 111, Name: root}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], TXN_DROPPED] -> DROPPED [[ObjectParent:{DescID: 111, ReferencedDescID: 101}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 1}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: k, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 1}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: n2, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: n1, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 4294967295}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967295}, ABSENT], PUBLIC] -> ABSENT + [[Column:{DescID: 111, ColumnID: 4294967294}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[ColumnName:{DescID: 111, Name: tableoid, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT [[ColumnType:{DescID: 111, ColumnFamilyID: 0, ColumnID: 4294967294}, ABSENT], PUBLIC] -> ABSENT ops: @@ -522,24 +473,49 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 30 MutationType ops SchemaID: 101 *scop.SetJobStateOnDescriptor DescriptorID: 104 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 105 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 106 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 107 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 108 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 109 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 110 + Initialize: true *scop.SetJobStateOnDescriptor DescriptorID: 111 - *scop.UpdateSchemaChangerJob - IsNonCancelable: true + Initialize: true + *scop.CreateSchemaChangerJob + Authorization: + UserName: root + DescriptorIDs: + - 104 + - 105 + - 106 + - 107 + - 108 + - 109 + - 110 + - 111 JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 2 with 39 MutationType ops + NonCancelable: true + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 30 MutationType ops + pending + Statements: + - statement: DROP VIEW defaultdb.v1 CASCADE + redactedstatement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE + statementtag: DROP VIEW +PostCommitNonRevertiblePhase stage 1 of 1 with 39 MutationType ops transitions: [[View:{DescID: 105}, ABSENT], DROPPED] -> ABSENT [[Column:{DescID: 105, ColumnID: 1}, ABSENT], DELETE_ONLY] -> ABSENT @@ -1309,6 +1285,14 @@ DROP VIEW defaultdb.v1 CASCADE to: [UserPrivileges:{DescID: 105, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 105}, DROPPED] + to: [View:{DescID: 105}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 105}, TXN_DROPPED] + to: [View:{DescID: 105}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 106}, ABSENT] to: [Column:{DescID: 106, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -1377,6 +1361,14 @@ DROP VIEW defaultdb.v1 CASCADE to: [UserPrivileges:{DescID: 106, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 106}, DROPPED] + to: [View:{DescID: 106}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 106}, TXN_DROPPED] + to: [View:{DescID: 106}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 107}, ABSENT] to: [Column:{DescID: 107, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -1445,6 +1437,14 @@ DROP VIEW defaultdb.v1 CASCADE to: [UserPrivileges:{DescID: 107, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 107}, DROPPED] + to: [View:{DescID: 107}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 107}, TXN_DROPPED] + to: [View:{DescID: 107}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 108}, ABSENT] to: [Column:{DescID: 108, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -1513,6 +1513,14 @@ DROP VIEW defaultdb.v1 CASCADE to: [UserPrivileges:{DescID: 108, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 108}, DROPPED] + to: [View:{DescID: 108}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 108}, TXN_DROPPED] + to: [View:{DescID: 108}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED - from: [View:{DescID: 111}, ABSENT] to: [Column:{DescID: 111, ColumnID: 1}, ABSENT] kind: SameStagePrecedence @@ -1593,3 +1601,11 @@ DROP VIEW defaultdb.v1 CASCADE to: [UserPrivileges:{DescID: 111, Name: root}, ABSENT] kind: SameStagePrecedence rule: descriptor drop right before dependent element removal +- from: [View:{DescID: 111}, DROPPED] + to: [View:{DescID: 111}, ABSENT] + kind: PreviousTransactionPrecedence + rule: descriptor DROPPED in transaction before removal +- from: [View:{DescID: 111}, TXN_DROPPED] + to: [View:{DescID: 111}, DROPPED] + kind: PreviousStagePrecedence + rule: descriptor TXN_DROPPED before DROPPED diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column b/pkg/sql/schemachanger/testdata/end_to_end/add_column index f7dc570ca712..ab20b62439f7 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column @@ -141,14 +141,6 @@ upsert descriptor #106 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 106 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... create job #1 (non-cancelable: false): "ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL DEFAULT 42" descriptor IDs: [106] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq index 319058f12987..d1bec674bd05 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq @@ -166,14 +166,6 @@ upsert descriptor #106 + targets: families: - columnIds: - ... - formatVersion: 3 - id: 106 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - mutations: - - column: ... upsert descriptor #107 ... @@ -186,14 +178,6 @@ upsert descriptor #107 + revertible: true dependedOnBy: - byId: true - ... - formatVersion: 3 - id: 107 - - modificationTime: {} - + modificationTime: - + wallTime: "1640995200000000001" - name: sq1 - parentId: 104 ... create job #1 (non-cancelable: false): "ALTER TABLE db.public.tbl ADD COLUMN l INT8 NOT NULL DEFAULT nextval('db.public.sq1')" descriptor IDs: [106 107] diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_schema b/pkg/sql/schemachanger/testdata/end_to_end/drop_schema index 98d3b59b56f0..cd2399c9beab 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_schema +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_schema @@ -24,7 +24,8 @@ add synthetic descriptor #106: version: "1" # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 3 MutationType ops +## PreCommitPhase stage 1 of 1 with 6 MutationType ops +delete schema namespace entry {104 0 sc} -> 106 upsert descriptor #104 database: + declarativeSchemaChangerState: @@ -38,8 +39,10 @@ upsert descriptor #104 name: db privileges: ... - sc: - id: 106 + public: + id: 105 + - sc: + - id: 106 - version: "2" + version: "3" upsert descriptor #106 @@ -66,6 +69,7 @@ upsert descriptor #106 withGrantOption: 2 version: 2 - version: "1" + + state: DROP + version: "2" create job #1 (non-cancelable: true): "DROP SCHEMA db.sc" descriptor IDs: [104 106] @@ -76,43 +80,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops -delete schema namespace entry {104 0 sc} -> 106 -upsert descriptor #104 - ... - jobId: "1" - id: 104 - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: db - privileges: - ... - public: - id: 105 - - sc: - - id: 106 - - version: "3" - + version: "4" -upsert descriptor #106 - ... - targets: - id: 106 - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: sc - parentId: 104 - ... - withGrantOption: 2 - version: 2 - - version: "2" - + state: DROP - + version: "3" -update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 2 MutationType ops pending" -commit transaction #3 -begin transaction #4 -## PostCommitNonRevertiblePhase stage 2 of 2 with 5 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops upsert descriptor #104 database: - declarativeSchemaChangerState: @@ -121,19 +89,19 @@ upsert descriptor #104 - jobId: "1" id: 104 - modificationTime: - - wallTime: "1640995200000000003" + - wallTime: "1640995200000000001" + modificationTime: {} name: db privileges: ... public: id: 105 - - version: "4" - + version: "5" + - version: "3" + + version: "4" delete descriptor #106 write *eventpb.DropSchema to event log: DROP SCHEMA ‹db›.‹sc› update progress of schema change job #1: "all stages completed" -commit transaction #4 +commit transaction #3 # end PostCommitPhase setup diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_table b/pkg/sql/schemachanger/testdata/end_to_end/drop_table index 93bec19cb381..77eaf8923e51 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_table +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_table @@ -29,7 +29,8 @@ add synthetic descriptor #107: version: "1" # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 2 MutationType ops +## PreCommitPhase stage 1 of 1 with 6 MutationType ops +delete object namespace entry {104 106 t} -> 107 upsert descriptor #107 ... createAsOfTime: @@ -46,6 +47,7 @@ upsert descriptor #107 + statementTag: DROP TABLE + targetRanks: + targets: + + dropTime: " families: - columnIds: ... @@ -57,10 +59,13 @@ upsert descriptor #107 name: t nextColumnId: 4 ... + replacementOf: time: {} + + state: DROP unexposedParentSchemaId: 106 - version: "1" + version: "2" +delete all comments for table descriptors [107] create job #1 (non-cancelable: true): "DROP TABLE db.sc.t" descriptor IDs: [107] # end PreCommitPhase @@ -70,35 +75,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops -delete object namespace entry {104 106 t} -> 107 -upsert descriptor #107 - ... - targetRanks: - targets: - + dropTime: " - families: - - columnIds: - ... - formatVersion: 3 - id: 107 - - modificationTime: - - wallTime: "1640995200000000001" - + modificationTime: {} - name: t - nextColumnId: 4 - ... - replacementOf: - time: {} - + state: DROP - unexposedParentSchemaId: 106 - - version: "2" - + version: "3" -delete all comments for table descriptors [107] -update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 7 MutationType ops pending" -commit transaction #3 -begin transaction #4 -## PostCommitNonRevertiblePhase stage 2 of 2 with 9 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 9 MutationType ops upsert descriptor #107 ... createAsOfTime: @@ -121,19 +98,19 @@ upsert descriptor #107 formatVersion: 3 id: 107 - modificationTime: - - wallTime: "1640995200000000003" + - wallTime: "1640995200000000001" + modificationTime: {} name: t nextColumnId: 4 ... state: DROP unexposedParentSchemaId: 106 - - version: "3" - + version: "4" + - version: "2" + + version: "3" write *eventpb.DropTable to event log: DROP TABLE ‹db›.‹sc›.‹t› create job #2 (non-cancelable: true): "GC for DROP TABLE db.sc.t" descriptor IDs: [107] update progress of schema change job #1: "all stages completed" -commit transaction #4 +commit transaction #3 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/explain/add_column b/pkg/sql/schemachanger/testdata/explain/add_column index 812fc97f3772..f1e6b5c6c41c 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column +++ b/pkg/sql/schemachanger/testdata/explain/add_column @@ -97,7 +97,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ └── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ ├── 3 elements transitioning toward ABSENT │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 1} │ └── 9 Mutation operations │ ├── MakeDroppedPrimaryIndexDeleteAndWriteOnly {"IndexID":1,"TableID":106} @@ -113,11 +113,11 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ ├── 1 element transitioning toward TRANSIENT_ABSENT │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ ├── 1 element transitioning toward ABSENT - │ │ └── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ └── 5 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":106} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":106} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":106} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_default_seq b/pkg/sql/schemachanger/testdata/explain/add_column_default_seq index badb937c82c4..0a65a6e55a61 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/explain/add_column_default_seq @@ -103,7 +103,7 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ └── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ ├── 3 elements transitioning toward ABSENT │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 1} │ └── 10 Mutation operations │ ├── MakeDroppedPrimaryIndexDeleteAndWriteOnly {"IndexID":1,"TableID":106} @@ -120,11 +120,11 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ ├── 1 element transitioning toward TRANSIENT_ABSENT │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ ├── 1 element transitioning toward ABSENT - │ │ └── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ └── 6 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":106} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":106} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":106} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":107} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid index e29f32904a6b..699fa4ad4906 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid @@ -164,17 +164,17 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIM │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 4 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward PUBLIC - │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} - │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} + │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ ├── 6 elements transitioning toward TRANSIENT_ABSENT - │ │ ├── PUBLIC → TRANSIENT_WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} - │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ ├── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ ├── PUBLIC → TRANSIENT_VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} + │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} + │ │ ├── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ ├── 1 element transitioning toward ABSENT - │ │ └── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ └── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ └── 12 Mutation operations │ ├── CreateGcJobForIndex {"IndexID":1,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":1,"TableID":104} @@ -190,7 +190,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIM │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 3 of 4 in PostCommitNonRevertiblePhase │ ├── 1 element transitioning toward TRANSIENT_ABSENT - │ │ └── TRANSIENT_WRITE_ONLY → TRANSIENT_DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ └── TRANSIENT_VALIDATED → TRANSIENT_DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ └── 3 Mutation operations │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 index fd643771f8ff..dcf6e419254f 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -41,15 +41,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 index 958c1bf0ac6b..7d488a0dc02e 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -41,15 +41,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 index eaf8ecf2ed40..724ca94809c9 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -41,15 +41,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 index ca9464597e3a..0800421b8fb1 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -40,18 +40,18 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 index 2a06a1d1df25..d411a2b51f96 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -40,18 +40,18 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 index 0f91679d7906..6fb93b6f078e 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -40,18 +40,18 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 index 3bea4b83f4b5..6f9c0458f7ef 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -42,12 +42,12 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ └── 5 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid index 64793318132c..2d5f406816a5 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid @@ -164,17 +164,17 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PR │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 4 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward PUBLIC - │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} - │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} + │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ ├── 6 elements transitioning toward TRANSIENT_ABSENT - │ │ ├── PUBLIC → TRANSIENT_WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} - │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ ├── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ ├── PUBLIC → TRANSIENT_VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} + │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} + │ │ ├── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ ├── 1 element transitioning toward ABSENT - │ │ └── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ └── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ └── 12 Mutation operations │ ├── CreateGcJobForIndex {"IndexID":1,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":1,"TableID":104} @@ -190,7 +190,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PR │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 3 of 4 in PostCommitNonRevertiblePhase │ ├── 1 element transitioning toward TRANSIENT_ABSENT - │ │ └── TRANSIENT_WRITE_ONLY → TRANSIENT_DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ └── TRANSIENT_VALIDATED → TRANSIENT_DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ └── 3 Mutation operations │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 index c50cd82e2034..f38ef0cecc0e 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -41,15 +41,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 index 9f3b00c112d1..a40dae5a7158 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -41,15 +41,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 index 56d371336c69..6a3a0e29375f 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -41,15 +41,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 index 3ad86ec0957c..cf5af53d3257 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -40,18 +40,18 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 index e1d31a0182a3..93c010e5002c 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -40,18 +40,18 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 index 87e851ad9f10..d6e8eb2166e7 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -40,18 +40,18 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 index e3e444d9d15f..7cf601bfead8 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 @@ -14,7 +14,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── VALIDATED → PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── ABSENT → PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ ├── 11 elements transitioning toward ABSENT - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} @@ -42,12 +42,12 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ └── 5 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla index 3aa9a50f8030..f31df76f632b 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla @@ -112,7 +112,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PR │ ├── 4 elements transitioning toward ABSENT │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ └── 10 Mutation operations │ ├── MakeDroppedPrimaryIndexDeleteAndWriteOnly {"IndexID":1,"TableID":104} @@ -130,13 +130,13 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PR │ │ ├── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ ├── 1 element transitioning toward ABSENT - │ │ └── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic b/pkg/sql/schemachanger/testdata/explain/drop_column_basic index 55f8d319519c..7fcfa3ebcd54 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic @@ -85,7 +85,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ └── 8 Mutation operations │ ├── MakeDroppedColumnDeleteOnly {"ColumnID":2,"TableID":104} @@ -100,11 +100,11 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── 1 element transitioning toward TRANSIENT_ABSENT │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ ├── 1 element transitioning toward ABSENT - │ │ └── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ └── 5 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":3,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index index 92aecc1f9ed5..466d17fe5db7 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index @@ -95,7 +95,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} @@ -117,15 +117,15 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── 4 elements transitioning toward ABSENT │ │ ├── DELETE_ONLY → ABSENT Column:{DescID: 104, ColumnID: 3} │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 3} - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── DELETE_ONLY → ABSENT SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── LogEvent {"TargetStatus":1} │ ├── CreateGcJobForIndex {"IndexID":2,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── MakeColumnAbsent {"ColumnID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_10_of_15 index 81c5a97133f6..5cbdad9c669c 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_10_of_15 @@ -23,7 +23,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} @@ -54,15 +54,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":6,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":6,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_11_of_15 index dc4aa0e21a95..fee9233e15b8 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_11_of_15 @@ -23,7 +23,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} @@ -54,15 +54,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":6,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":6,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_12_of_15 index b1a78782d20e..de6838d073cf 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_12_of_15 @@ -23,7 +23,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} @@ -54,15 +54,15 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 3 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ └── 7 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":6,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":6,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_13_of_15 index 80ae4dccacd1..db5c071e49b2 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_13_of_15 @@ -23,7 +23,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} @@ -52,12 +52,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ └── 10 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── LogEvent {"TargetStatus":1} @@ -65,6 +64,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":6,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":6,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_14_of_15 index 0478d2649978..ffc1eac14ccc 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_14_of_15 @@ -23,7 +23,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} @@ -52,12 +52,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ └── 10 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── LogEvent {"TargetStatus":1} @@ -65,6 +64,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":6,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":6,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_15_of_15 index b8134bf555dd..55c9c82ecccd 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_15_of_15 @@ -23,7 +23,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} @@ -52,12 +52,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 4 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── DELETE_ONLY → ABSENT SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ └── 10 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} │ ├── LogEvent {"TargetStatus":1} @@ -65,6 +64,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ ├── MakeIndexAbsent {"IndexID":5,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":6,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":6,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_9_of_15 index 71cfc4c03175..499f394de60f 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_9_of_15 @@ -23,7 +23,7 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} @@ -55,12 +55,12 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} ├── Stage 2 of 3 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ └── 5 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_1_of_2 index 9b5eaa493681..db9fbfbeb135 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_1_of_2 @@ -101,7 +101,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 4, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} @@ -124,15 +124,15 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── 4 elements transitioning toward ABSENT │ │ ├── DELETE_ONLY → ABSENT Column:{DescID: 104, ColumnID: 4} │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── DELETE_ONLY → ABSENT SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── LogEvent {"TargetStatus":1} │ ├── CreateGcJobForIndex {"IndexID":2,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── MakeColumnAbsent {"ColumnID":4,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_unique_index b/pkg/sql/schemachanger/testdata/explain/drop_column_unique_index index ea6ccb35eb5f..4b736f851e9b 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_unique_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_unique_index @@ -100,7 +100,7 @@ Schema change plan for ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 3, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 4, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 1} │ └── 8 Mutation operations │ ├── MakeDroppedColumnDeleteOnly {"ColumnID":3,"TableID":106} @@ -115,11 +115,11 @@ Schema change plan for ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN │ ├── 1 element transitioning toward TRANSIENT_ABSENT │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ ├── 1 element transitioning toward ABSENT - │ │ └── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ └── 5 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":106} │ ├── CreateGcJobForIndex {"IndexID":5,"TableID":106} │ ├── MakeIndexAbsent {"IndexID":5,"TableID":106} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index index 4511771cbf3c..50c18cdd480c 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index @@ -89,7 +89,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} @@ -108,15 +108,15 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── 1 element transitioning toward TRANSIENT_ABSENT │ │ └── TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ ├── 2 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── DELETE_ONLY → ABSENT SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 8 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── LogEvent {"TargetStatus":1} │ ├── CreateGcJobForIndex {"IndexID":2,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── Stage 3 of 3 in PostCommitNonRevertiblePhase diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index index f35aa859788b..587fdcddcab0 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index @@ -21,13 +21,12 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 6 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ ├── VALIDATED → WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ ├── PUBLIC → ABSENT CheckConstraint:{DescID: 104, ConstraintID: 2} - │ │ └── PUBLIC → ABSENT ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} + │ ├── 5 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} + │ │ ├── PUBLIC → ABSENT CheckConstraint:{DescID: 104, ConstraintID: 2} + │ │ └── PUBLIC → ABSENT ConstraintName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} │ └── 4 Mutation operations │ ├── NotImplemented {"ElementType":"scpb.ConstraintN..."} │ ├── RemoveCheckConstraint {"ConstraintID":2,"TableID":104} @@ -37,7 +36,7 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward ABSENT │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 3} - │ │ └── WRITE_ONLY → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 4 Mutation operations │ ├── MakeDroppedColumnDeleteOnly {"ColumnID":3,"TableID":104} │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index index d3863e8a0e6d..273fc76aa079 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index @@ -21,10 +21,9 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 3 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ └── VALIDATED → WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ ├── 2 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} + │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ └── 2 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} @@ -32,7 +31,7 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 2 elements transitioning toward ABSENT │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 3} - │ │ └── WRITE_ONLY → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 4 Mutation operations │ ├── MakeDroppedColumnDeleteOnly {"ColumnID":3,"TableID":104} │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index index fe18baaccadc..640f983ed79e 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index @@ -16,17 +16,16 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ └── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 3 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} - │ │ └── VALIDATED → WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ ├── 2 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} + │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ └── 2 Mutation operations │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase ├── Stage 1 of 2 in PostCommitNonRevertiblePhase │ ├── 1 element transitioning toward ABSENT - │ │ └── WRITE_ONLY → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ └── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 3 Mutation operations │ ├── MakeDroppedIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 index 9b5eaa493681..db9fbfbeb135 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 @@ -101,7 +101,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 4, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} @@ -124,15 +124,15 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── 4 elements transitioning toward ABSENT │ │ ├── DELETE_ONLY → ABSENT Column:{DescID: 104, ColumnID: 4} │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── DELETE_ONLY → ABSENT SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── LogEvent {"TargetStatus":1} │ ├── CreateGcJobForIndex {"IndexID":2,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── MakeColumnAbsent {"ColumnID":4,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 index b604773cc105..2ac94d6c9824 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 @@ -79,7 +79,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} - │ │ ├── PUBLIC → WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 4, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} @@ -106,15 +106,15 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── 4 elements transitioning toward ABSENT │ │ ├── DELETE_ONLY → ABSENT Column:{DescID: 104, ColumnID: 4} │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} - │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── DELETE_ONLY → ABSENT SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ └── 9 Mutation operations - │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── LogEvent {"TargetStatus":1} │ ├── CreateGcJobForIndex {"IndexID":2,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":2,"TableID":104} │ ├── CreateGcJobForIndex {"IndexID":4,"TableID":104} │ ├── MakeIndexAbsent {"IndexID":4,"TableID":104} + │ ├── MakeDroppedIndexDeleteOnly {"IndexID":1,"TableID":104} │ ├── MakeColumnAbsent {"ColumnID":4,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_schema b/pkg/sql/schemachanger/testdata/explain/drop_schema index 404caa5c17de..2ff8cc36e862 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_schema +++ b/pkg/sql/schemachanger/testdata/explain/drop_schema @@ -14,27 +14,22 @@ Schema change plan for DROP SCHEMA ‹db›.‹sc›; │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":106} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ └── 3 Mutation operations + │ ├── 6 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: sc, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Schema:{DescID: 106} + │ │ └── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} + │ └── 6 Mutation operations + │ ├── MarkDescriptorAsDropped {"DescID":106} + │ ├── RemoveSchemaParent {"Parent":{"ParentDatabaseID":104,"SchemaID":106}} + │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":106,"Name":"sc"}} │ ├── SetJobStateOnDescriptor {"DescriptorID":104,"Initialize":true} │ ├── SetJobStateOnDescriptor {"DescriptorID":106,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase - ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 6 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 106, Name: sc, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 106} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 106, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Schema:{DescID: 106} - │ │ └── PUBLIC → ABSENT SchemaParent:{DescID: 106, ReferencedDescID: 104} - │ └── 6 Mutation operations - │ ├── MarkDescriptorAsDropped {"DescID":106} - │ ├── RemoveSchemaParent {"Parent":{"ParentDatabaseID":104,"SchemaID":106}} - │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":106,"Name":"sc"}} - │ ├── SetJobStateOnDescriptor {"DescriptorID":104} - │ ├── SetJobStateOnDescriptor {"DescriptorID":106} - │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} - └── Stage 2 of 2 in PostCommitNonRevertiblePhase + └── Stage 1 of 1 in PostCommitNonRevertiblePhase ├── 1 element transitioning toward ABSENT │ └── DROPPED → ABSENT Schema:{DescID: 106} └── 5 Mutation operations diff --git a/pkg/sql/schemachanger/testdata/explain/drop_table b/pkg/sql/schemachanger/testdata/explain/drop_table index 18003513fb3a..53e3189b2cb5 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_table +++ b/pkg/sql/schemachanger/testdata/explain/drop_table @@ -22,49 +22,44 @@ Schema change plan for DROP TABLE ‹db›.‹sc›.‹t›; │ └── MarkDescriptorAsSyntheticallyDropped {"DescID":107} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase - │ ├── 6 elements transitioning toward ABSENT - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 1} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 2} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 3} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967295} - │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967294} - │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} - │ └── 2 Mutation operations + │ ├── 28 elements transitioning toward ABSENT + │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} + │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} + │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} + │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 107} + │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} + │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: k, ColumnID: 1} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: v, ColumnID: 2} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3} + │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 107, ColumnID: 3} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295} + │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 107, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1} + │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} + │ │ ├── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} + │ │ └── PUBLIC → ABSENT IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} + │ └── 6 Mutation operations + │ ├── MarkDescriptorAsDropped {"DescID":107} + │ ├── RemoveAllTableComments {"TableID":107} + │ ├── RemoveColumnDefaultExpression {"ColumnID":3,"TableID":107} + │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":107,"Name":"t","SchemaID":106}} │ ├── SetJobStateOnDescriptor {"DescriptorID":107,"Initialize":true} │ └── CreateSchemaChangerJob {"NonCancelable":true,"RunningStatus":"PostCommitNonRev..."} └── PostCommitNonRevertiblePhase - ├── Stage 1 of 2 in PostCommitNonRevertiblePhase - │ ├── 22 elements transitioning toward ABSENT - │ │ ├── PUBLIC → ABSENT Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} - │ │ ├── PUBLIC → ABSENT Owner:{DescID: 107} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: admin} - │ │ ├── PUBLIC → ABSENT UserPrivileges:{DescID: 107, Name: root} - │ │ ├── TXN_DROPPED → DROPPED Table:{DescID: 107} - │ │ ├── PUBLIC → ABSENT ObjectParent:{DescID: 107, ReferencedDescID: 106} - │ │ ├── PUBLIC → ABSENT ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: k, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: v, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnDefaultExpression:{DescID: 107, ColumnID: 3} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1} - │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} - │ │ └── PUBLIC → ABSENT IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} - │ └── 6 Mutation operations - │ ├── MarkDescriptorAsDropped {"DescID":107} - │ ├── RemoveAllTableComments {"TableID":107} - │ ├── RemoveColumnDefaultExpression {"ColumnID":3,"TableID":107} - │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":107,"Name":"t","SchemaID":106}} - │ ├── SetJobStateOnDescriptor {"DescriptorID":107} - │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} - └── Stage 2 of 2 in PostCommitNonRevertiblePhase + └── Stage 1 of 1 in PostCommitNonRevertiblePhase ├── 7 elements transitioning toward ABSENT │ ├── DROPPED → ABSENT Table:{DescID: 107} │ ├── DELETE_ONLY → ABSENT Column:{DescID: 107, ColumnID: 1} diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column b/pkg/sql/schemachanger/testdata/explain_verbose/add_column index 6fd0514da4dc..3a85e5875d78 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column @@ -15,7 +15,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ ├── • 7 elements transitioning toward PUBLIC │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT Column:{DescID: 106, ColumnID: 2} +│ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ ABSENT → PUBLIC @@ -40,8 +43,11 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ ABSENT → BACKFILL_ONLY │ │ │ │ -│ │ │ └── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} -│ │ │ rule: "column existence precedes index existence" +│ │ │ ├── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} +│ │ │ │ rule: "column existence precedes index existence" +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ ABSENT → PUBLIC @@ -63,8 +69,11 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ ABSENT → DELETE_ONLY │ │ │ │ -│ │ │ └── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} -│ │ │ rule: "column existence precedes temp index existence" +│ │ │ ├── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} +│ │ │ │ rule: "column existence precedes temp index existence" +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ ABSENT → PUBLIC @@ -199,6 +208,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ │ └── • Column:{DescID: 106, ColumnID: 2} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} +│ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from PUBLIC ColumnDefaultExpression:{DescID: 106, ColumnID: 2} │ │ │ rule: "DEFAULT or ON UPDATE existence precedes writes to column" │ │ │ @@ -210,6 +222,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} │ │ │ │ rule: "column is WRITE_ONLY before temporary index is WRITE_ONLY" │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ @@ -240,6 +255,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -261,7 +279,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -281,7 +302,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -301,7 +325,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -315,7 +342,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -335,7 +365,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -352,6 +385,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -376,6 +412,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -395,7 +434,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ ├── • 3 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -421,7 +463,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 1} │ │ │ PUBLIC → ABSENT @@ -493,6 +538,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -502,14 +550,13 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 5 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 106 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 106 @@ -518,6 +565,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ IndexID: 3 │ │ TableID: 106 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 106 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 106 │ │ @@ -536,6 +587,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 index ee3b877fbdf9..d471509f6791 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 @@ -18,6 +18,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -52,6 +55,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -76,6 +82,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 index 35f9308c6b43..0d8f2857644f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -27,6 +30,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -52,7 +58,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -118,6 +127,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -155,6 +167,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 index bec277862d5d..10df569caf42 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -27,6 +30,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -52,7 +58,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -118,6 +127,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -155,6 +167,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 index 40f94e5ec9fa..38cb2cd02914 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -27,6 +30,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -52,7 +58,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -118,6 +127,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -155,6 +167,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 index 12ce00a4c7e8..ee0bac737fa6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -25,7 +28,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -43,7 +49,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -94,6 +103,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -131,6 +143,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -143,6 +158,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 index 67afd60894a1..1889dd9c22c5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -25,7 +28,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -43,7 +49,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -94,6 +103,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -131,6 +143,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -143,6 +158,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 index 1fd8c4d71cf1..2e155b9f756c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -25,7 +28,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -43,7 +49,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -94,6 +103,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -131,6 +143,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -143,6 +158,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq index af8573661385..de1c40f58df3 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq @@ -15,7 +15,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ ├── • 7 elements transitioning toward PUBLIC │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT Column:{DescID: 106, ColumnID: 2} +│ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ │ ABSENT → PUBLIC @@ -40,8 +43,11 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ ABSENT → BACKFILL_ONLY │ │ │ │ -│ │ │ └── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} -│ │ │ rule: "column existence precedes index existence" +│ │ │ ├── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} +│ │ │ │ rule: "column existence precedes index existence" +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ ABSENT → PUBLIC @@ -63,8 +69,11 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ ABSENT → DELETE_ONLY │ │ │ │ -│ │ │ └── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} -│ │ │ rule: "column existence precedes temp index existence" +│ │ │ ├── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} +│ │ │ │ rule: "column existence precedes temp index existence" +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ ABSENT → PUBLIC @@ -212,6 +221,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ │ └── • Column:{DescID: 106, ColumnID: 2} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} +│ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from PUBLIC ColumnDefaultExpression:{DescID: 106, ColumnID: 2} │ │ │ rule: "DEFAULT or ON UPDATE existence precedes writes to column" │ │ │ @@ -223,6 +235,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} │ │ │ │ rule: "column is WRITE_ONLY before temporary index is WRITE_ONLY" │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ @@ -256,6 +271,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -277,7 +295,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 4 Mutation operations │ │ │ @@ -300,7 +321,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 4 Mutation operations │ │ │ @@ -323,7 +347,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -337,7 +364,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 4 Mutation operations │ │ │ @@ -360,7 +390,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -377,6 +410,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -401,6 +437,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -420,7 +459,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ ├── • 3 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -446,7 +488,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 1} │ │ │ PUBLIC → ABSENT @@ -521,6 +566,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -530,14 +578,13 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 6 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 106 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 106 @@ -546,6 +593,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ IndexID: 3 │ │ TableID: 106 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 106 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 106 │ │ @@ -567,6 +618,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_1_of_7 index 31daede302cf..fa70796f04a0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_1_of_7 @@ -18,6 +18,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -52,6 +55,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -76,6 +82,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_2_of_7 index 67fb00c90418..5d1f640daaa6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_2_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -27,6 +30,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -52,7 +58,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -121,6 +130,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -158,6 +170,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_3_of_7 index 3a5bb384f22d..0fcd0ebce4d9 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_3_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -27,6 +30,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -52,7 +58,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -121,6 +130,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -158,6 +170,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_4_of_7 index 3e88d9d61e59..552f63dcec88 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_4_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -27,6 +30,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -52,7 +58,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -121,6 +130,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -158,6 +170,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_5_of_7 index 24cd5ffd6919..9868cc518ac6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_5_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -25,7 +28,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -43,7 +49,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +106,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -134,6 +146,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -146,6 +161,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_6_of_7 index 5d54fe2e19b2..dacabad26293 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_6_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -25,7 +28,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -43,7 +49,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +106,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -134,6 +146,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -146,6 +161,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_7_of_7 index 50bc4c0a2e3b..a96eb7bccbf5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_7_of_7 @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -25,7 +28,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -43,7 +49,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +106,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: l, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -134,6 +146,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: tbl_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -146,6 +161,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default index 6bbcb661f867..04d1f462c372 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default @@ -14,7 +14,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT; │ ├── • 4 elements transitioning toward PUBLIC │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT Column:{DescID: 106, ColumnID: 2} +│ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ ABSENT → PUBLIC @@ -111,7 +114,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT; │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • Column:{DescID: 106, ColumnID: 2} - │ │ DELETE_ONLY → WRITE_ONLY + │ │ │ DELETE_ONLY → WRITE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" │ │ │ └── • 3 Mutation operations │ │ @@ -133,6 +139,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT; │ └── • Column:{DescID: 106, ColumnID: 2} │ │ WRITE_ONLY → PUBLIC │ │ + │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ rule: "column dependents exist before column becomes public" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_1_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_1_of_2 index 4675d32c6441..48734fcf066b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_1_of_2 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 2; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_2_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_2_of_2 index d30edd7f7b93..8617bcc32698 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_2_of_2 @@ -15,7 +15,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 2; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -61,6 +64,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 2; │ ├── • Column:{DescID: 106, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid index 5efc6fc6eee7..28d8bc8e2b4c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid @@ -13,7 +13,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ ABSENT → PUBLIC @@ -24,7 +27,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • 6 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ ABSENT → PUBLIC @@ -39,7 +45,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ rule: "index existence precedes index dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ ABSENT → PUBLIC @@ -56,7 +65,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} -│ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} +│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" │ │ │ │ │ └── • ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ PUBLIC → ABSENT @@ -176,6 +188,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ @@ -202,6 +217,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -223,7 +241,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -243,7 +264,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -263,7 +287,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -277,7 +304,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -297,7 +327,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ WRITE_ONLY → VALIDATED +│ │ │ │ WRITE_ONLY → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ │ │ └── • 1 Validation operation │ │ │ @@ -315,6 +348,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ │ │ │ rule: "primary index swap" │ │ │ │ │ +│ │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC" +│ │ │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ │ rule: "index named right before index becomes public" @@ -334,8 +370,11 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ │ │ ABSENT → DELETE_ONLY │ │ │ │ │ -│ │ │ │ └── • Precedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ │ rule: "primary index with new columns should exist before temp indexes" +│ │ │ │ ├── • Precedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ │ rule: "primary index with new columns should exist before temp indexes" +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ │ ABSENT → PUBLIC @@ -346,7 +385,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} -│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ │ PUBLIC → VALIDATED +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -409,6 +451,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ @@ -432,6 +477,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -450,7 +498,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -470,7 +521,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -490,7 +544,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -504,7 +561,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -524,7 +584,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -539,7 +602,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • 5 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -557,7 +623,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -568,7 +637,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -592,7 +664,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ VALIDATED → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 6 Mutation operations │ │ @@ -634,6 +709,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ ├── • SameStagePrecedence dependency from TRANSIENT_VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -650,7 +728,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • 6 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → TRANSIENT_WRITE_ONLY + │ │ │ │ PUBLIC → TRANSIENT_VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -682,6 +763,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -691,6 +775,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ └── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ @@ -705,6 +792,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ rule: "dependents removed before index" │ │ @@ -783,7 +873,10 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ TRANSIENT_WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ TRANSIENT_VALIDATED → TRANSIENT_DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from TRANSIENT_VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_WRITE_ONLY" │ │ │ └── • 3 Mutation operations │ │ @@ -806,6 +899,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ @@ -820,6 +916,9 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 index 70d3efd7ab0c..2c27a33bfdbd 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +109,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -110,7 +125,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -206,11 +224,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -220,15 +244,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -245,6 +268,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -260,6 +287,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 index b94dfda93991..b5a34abe621f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +109,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -110,7 +125,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -206,11 +224,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -220,15 +244,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -245,6 +268,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -260,6 +287,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 index 9ae70b4b805d..0e0b3d32c73e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +109,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -110,7 +125,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -206,11 +224,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -220,15 +244,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -245,6 +268,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -260,6 +287,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 index 1faec8dbe273..89484ea58d22 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -95,7 +107,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -104,7 +119,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -185,11 +203,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -199,6 +223,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -208,15 +235,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -252,6 +278,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -267,6 +297,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 index f7bd63391384..c764e5a182cf 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -95,7 +107,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -104,7 +119,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -185,11 +203,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -199,6 +223,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -208,15 +235,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -252,6 +278,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -267,6 +297,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 index bf6d40168120..a9830babcde0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -95,7 +107,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -104,7 +119,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -185,11 +203,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -199,6 +223,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -208,15 +235,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -252,6 +278,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -267,6 +297,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_1_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_1_of_15 index 8743e1a38665..afff2a894d0d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_1_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_1_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -36,6 +39,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -60,6 +66,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -81,6 +90,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_2_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_2_of_15 index 8b03f3f772b9..27a515ab5182 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_2_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_2_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -36,6 +39,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -166,6 +178,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_3_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_3_of_15 index 318373d1697a..a7f69251246d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_3_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_3_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -36,6 +39,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -166,6 +178,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_4_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_4_of_15 index 402225ead8eb..176b0ec31441 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_4_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_4_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -36,6 +39,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -166,6 +178,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_5_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_5_of_15 index 02a0588a6cc5..a4f3e0800855 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_5_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_5_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,7 +37,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -49,7 +55,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -66,6 +75,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -154,6 +169,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_6_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_6_of_15 index b45a32931c8d..49a464389976 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_6_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_6_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,7 +37,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -49,7 +55,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -66,6 +75,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -154,6 +169,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_7_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_7_of_15 index 4c4ecd558e2c..d4ba9cdd3f08 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_7_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_7_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,7 +37,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -49,7 +55,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -66,6 +75,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -154,6 +169,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_8_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_8_of_15 index 3114ba6ea984..2629a0905d25 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_8_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_8_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,7 +37,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -49,7 +55,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -66,6 +75,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -154,6 +169,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 index c0f5328ffc7e..7243c4471f52 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +109,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -112,6 +127,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ @@ -213,11 +231,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -226,10 +250,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ └── • 5 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -238,6 +258,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ IndexID: 3 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -253,6 +277,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid index b263d11a028e..d069dacc29ee 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid @@ -13,7 +13,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ ABSENT → PUBLIC @@ -24,7 +27,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • 6 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ ABSENT → PUBLIC @@ -39,7 +45,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ rule: "index existence precedes index dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ ABSENT → PUBLIC @@ -56,7 +65,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} -│ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} +│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" │ │ │ │ │ └── • ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ PUBLIC → ABSENT @@ -178,6 +190,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ @@ -204,6 +219,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -225,7 +243,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -245,7 +266,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -265,7 +289,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -279,7 +306,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -299,7 +329,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ WRITE_ONLY → VALIDATED +│ │ │ │ WRITE_ONLY → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ │ │ └── • 1 Validation operation │ │ │ @@ -317,6 +350,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ │ │ │ rule: "primary index swap" │ │ │ │ │ +│ │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC" +│ │ │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ │ rule: "index named right before index becomes public" @@ -336,8 +372,11 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ │ │ ABSENT → DELETE_ONLY │ │ │ │ │ -│ │ │ │ └── • Precedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ │ rule: "primary index with new columns should exist before temp indexes" +│ │ │ │ ├── • Precedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ │ rule: "primary index with new columns should exist before temp indexes" +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ │ ABSENT → PUBLIC @@ -348,7 +387,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} -│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ │ PUBLIC → VALIDATED +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -412,6 +454,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ @@ -435,6 +480,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -453,7 +501,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -473,7 +524,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -493,7 +547,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -507,7 +564,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -527,7 +587,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -542,7 +605,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • 5 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -560,7 +626,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -571,7 +640,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -595,7 +667,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ VALIDATED → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 6 Mutation operations │ │ @@ -637,6 +712,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ ├── • SameStagePrecedence dependency from TRANSIENT_VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -653,7 +731,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • 6 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → TRANSIENT_WRITE_ONLY + │ │ │ │ PUBLIC → TRANSIENT_VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -685,6 +766,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -694,6 +778,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ └── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ @@ -708,6 +795,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ rule: "dependents removed before index" │ │ @@ -788,7 +878,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ TRANSIENT_WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ TRANSIENT_VALIDATED → TRANSIENT_DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from TRANSIENT_VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_WRITE_ONLY" │ │ │ └── • 3 Mutation operations │ │ @@ -811,6 +904,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ @@ -825,6 +921,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 index 5cfe89f5a628..1321f47b93d8 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +109,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -110,7 +125,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -206,11 +224,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -220,15 +244,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -245,6 +268,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -260,6 +287,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 index ad1d2e1b4d96..e638b6a9b271 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +109,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -110,7 +125,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -206,11 +224,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -220,15 +244,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -245,6 +268,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -260,6 +287,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 index 60787b6e6048..a23a3f0dfd9e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +109,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -110,7 +125,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -206,11 +224,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -220,15 +244,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -245,6 +268,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -260,6 +287,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 index 6cfdad474ba9..196f178b8c89 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -95,7 +107,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -104,7 +119,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -185,11 +203,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -199,6 +223,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -208,15 +235,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -252,6 +278,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -267,6 +297,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 index 760e1b3d1471..ec6229cf45c8 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -95,7 +107,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -104,7 +119,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -185,11 +203,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -199,6 +223,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -208,15 +235,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -252,6 +278,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -267,6 +297,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 index 6a167bf95feb..ecef90dcc806 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -95,7 +107,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -104,7 +119,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ PUBLIC → ABSENT @@ -185,11 +203,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -199,6 +223,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -208,15 +235,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -252,6 +278,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -267,6 +297,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_1_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_1_of_15 index d51a1e040625..3fcbe999094a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_1_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_1_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -36,6 +39,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -60,6 +66,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -81,6 +90,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_2_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_2_of_15 index aa23a022eeef..e17436b4a41f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_2_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_2_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -36,6 +39,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -166,6 +178,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_3_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_3_of_15 index f3cfddf39da9..4c2ebdc7985a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_3_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_3_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -36,6 +39,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -166,6 +178,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_4_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_4_of_15 index c436ca65271b..7d1b3370de05 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_4_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_4_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -36,6 +39,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -166,6 +178,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_5_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_5_of_15 index b1767530c446..5a92201888d0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_5_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_5_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,7 +37,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -49,7 +55,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -66,6 +75,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -154,6 +169,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_6_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_6_of_15 index f15875995c99..6a68ae27bb22 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_6_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_6_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,7 +37,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -49,7 +55,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -66,6 +75,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -154,6 +169,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_7_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_7_of_15 index 63b584cc6eb1..789ccfb473bc 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_7_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_7_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,7 +37,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -49,7 +55,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -66,6 +75,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -154,6 +169,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_8_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_8_of_15 index 2523c05e2d9d..7b11b2adbea8 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_8_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_8_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,7 +37,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -49,7 +55,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -66,6 +75,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -154,6 +169,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 index befa3a831016..a32cd14a4a79 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -53,7 +59,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -80,7 +89,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -97,6 +109,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 2} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -112,6 +127,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ @@ -213,11 +231,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -226,10 +250,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ └── • 5 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 2 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -238,6 +258,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ IndexID: 3 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 2 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -253,6 +277,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla index 821d19903f2f..658bf6eb5c10 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla @@ -13,7 +13,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ ├── • 8 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} │ │ │ │ ABSENT → PUBLIC @@ -28,7 +31,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ rule: "index existence precedes index dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ ABSENT → PUBLIC @@ -57,7 +63,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ ├── • 4 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ ABSENT → PUBLIC @@ -72,7 +81,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ rule: "temp index existence precedes index dependents" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} -│ │ ABSENT → DELETE_ONLY +│ │ │ ABSENT → DELETE_ONLY +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} +│ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ └── • 12 Mutation operations │ │ @@ -188,6 +200,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ │ +│ │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ │ @@ -195,7 +210,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} -│ │ │ DELETE_ONLY → WRITE_ONLY +│ │ │ │ DELETE_ONLY → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • 4 Mutation operations │ │ │ @@ -221,6 +239,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ │ +│ │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} │ │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ │ @@ -233,6 +254,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ │ │ │ rule: "temp index is WRITE_ONLY before backfill" │ │ │ │ @@ -259,10 +283,16 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 4 Mutation operations │ │ │ @@ -286,10 +316,16 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 4 Mutation operations │ │ │ @@ -313,10 +349,16 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 2 Backfill operations │ │ │ @@ -335,10 +377,16 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 4 Mutation operations │ │ │ @@ -362,10 +410,16 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ WRITE_ONLY → VALIDATED +│ │ │ │ WRITE_ONLY → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 2 Validation operations │ │ @@ -389,6 +443,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -408,6 +465,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ VALIDATED → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ @@ -427,7 +487,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ ├── • 4 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -442,7 +505,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} - │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ ├── • 4 elements transitioning toward ABSENT │ │ │ @@ -465,7 +531,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ PUBLIC → ABSENT @@ -534,6 +603,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -541,19 +613,21 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} - │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT + │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" │ │ │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -570,6 +644,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -591,6 +669,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_1_of_7 index cd38e997f066..b8015780a6cf 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_1_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -61,6 +67,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -73,6 +82,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_2_of_7 index eba28bee82bc..a05a87d112cb 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_2_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -38,7 +41,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -165,6 +177,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -174,6 +189,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_3_of_7 index fa5135e6c99a..390e1c7313ad 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_3_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -38,7 +41,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -165,6 +177,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -174,6 +189,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_4_of_7 index 31d7d3a1921a..a9ea1e2d6e7e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_4_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -38,7 +41,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -165,6 +177,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -174,6 +189,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_5_of_7 index eaa5307cf2ae..d2bcaf787fe6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_5_of_7 @@ -14,7 +14,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • 12 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -29,7 +32,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -44,10 +50,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -106,6 +118,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -118,6 +133,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -127,6 +145,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -139,6 +160,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_6_of_7 index 1a39e4f44031..0741274d8906 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_6_of_7 @@ -14,7 +14,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • 12 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -29,7 +32,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -44,10 +50,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -106,6 +118,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -118,6 +133,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -127,6 +145,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -139,6 +160,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_7_of_7 index 950386ac0f40..4a4867890106 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_7_of_7 @@ -14,7 +14,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • 12 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -29,7 +32,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -44,10 +50,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -106,6 +118,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -118,6 +133,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -127,6 +145,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -139,6 +160,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index b/pkg/sql/schemachanger/testdata/explain_verbose/create_index index 42d2f5c5e10c..d6fce0cc017b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index @@ -26,7 +26,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ │ rule: "index existence precedes index dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ │ │ ABSENT → PUBLIC @@ -43,7 +46,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} -│ │ ABSENT → DELETE_ONLY +│ │ │ ABSENT → DELETE_ONLY +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} +│ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ └── • 6 Mutation operations │ │ @@ -114,7 +120,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} -│ │ │ DELETE_ONLY → WRITE_ONLY +│ │ │ │ DELETE_ONLY → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -142,6 +151,9 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ └── • Precedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ │ rule: "temp index is WRITE_ONLY before backfill" │ │ │ @@ -157,7 +169,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -177,7 +192,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -197,7 +215,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -211,7 +232,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -231,7 +255,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -254,6 +281,9 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 106, Name: idx1, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -267,7 +297,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ └── • 5 Mutation operations │ │ @@ -297,7 +330,10 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT + │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT + │ │ + │ └── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" │ └── • 4 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_1_of_7 index 00c008d0f250..092daf5b6130 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_1_of_7 @@ -29,6 +29,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -41,6 +44,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_2_of_7 index 629600c4cfbc..998a11cf73d9 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_2_of_7 @@ -29,6 +29,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -39,7 +42,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -102,6 +108,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_3_of_7 index 9679554c49df..fd913f8c9cea 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_3_of_7 @@ -29,6 +29,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -39,7 +42,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -102,6 +108,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_4_of_7 index 88268e6dbbc4..6ed9767c61c2 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_4_of_7 @@ -35,11 +35,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: idx1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -102,6 +108,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_5_of_7 index a3f9fe3e18bb..f029d63c919f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_5_of_7 @@ -27,10 +27,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,12 +81,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: idx1, IndexID: 2} │ │ rule: "dependents removed before index" │ │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_6_of_7 index 2f8917697486..be9fe54f07ed 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_6_of_7 @@ -27,10 +27,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,12 +81,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: idx1, IndexID: 2} │ │ rule: "dependents removed before index" │ │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_7_of_7 index 694b577d5c54..822cb4b5d2e8 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_7_of_7 @@ -27,10 +27,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -75,12 +81,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: idx1, IndexID: 2} │ │ rule: "dependents removed before index" │ │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 0, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic index 700b8e466494..8e662f1c1ce8 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic @@ -13,7 +13,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ ABSENT → PUBLIC @@ -24,7 +27,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 2 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ ABSENT → PUBLIC @@ -35,7 +41,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} -│ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} +│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" │ │ │ │ │ └── • ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ PUBLIC → ABSENT @@ -128,6 +137,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ @@ -151,6 +163,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -169,7 +184,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -189,7 +207,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -209,7 +230,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -223,7 +247,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -243,7 +270,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -263,6 +293,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -279,7 +312,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 2 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -290,7 +326,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 5 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -314,7 +353,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ PUBLIC → ABSENT @@ -373,20 +415,22 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ └── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 5 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 3 │ │ TableID: 104 @@ -395,6 +439,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ IndexID: 3 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -410,6 +458,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -438,6 +489,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 index 53c03b826ac2..0c1611b56d99 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -33,6 +36,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -48,6 +54,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 index d1eaa2e6a8ec..11d5b1a9a58c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -33,6 +36,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -46,7 +52,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ PUBLIC → ABSENT @@ -114,6 +123,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 index 872386c6bff4..8c44bc957751 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -33,6 +36,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -46,7 +52,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ PUBLIC → ABSENT @@ -114,6 +123,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 index 877404d74cab..f501a4f9549e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -33,6 +36,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -46,7 +52,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ PUBLIC → ABSENT @@ -114,6 +123,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 index 8b77cfc8abd8..85ece8dfaea3 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -31,7 +34,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -40,7 +46,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ PUBLIC → ABSENT @@ -93,6 +102,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -102,6 +114,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 index 16f125654282..3a4de63ffb1f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -31,7 +34,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -40,7 +46,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ PUBLIC → ABSENT @@ -93,6 +102,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -102,6 +114,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 index 376a03a0a5d7..284906ab4d9a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -31,7 +34,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -40,7 +46,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ PUBLIC → ABSENT @@ -93,6 +102,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 2, TemporaryIndexID: 3, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ @@ -102,6 +114,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index index 35c731e28db8..8a06150c291f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index @@ -13,7 +13,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ ABSENT → PUBLIC @@ -24,7 +27,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 2 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ ABSENT → PUBLIC @@ -35,7 +41,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 6 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} -│ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} +│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -46,6 +55,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ PUBLIC → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 3} +│ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ rule: "secondary indexes containing column as key reach write-only before column" │ │ │ @@ -56,7 +68,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ PUBLIC → VALIDATED +│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ │ PUBLIC → ABSENT @@ -184,6 +199,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ @@ -207,6 +225,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -225,7 +246,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -245,7 +269,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -265,7 +292,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -279,7 +309,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -299,7 +332,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -319,6 +355,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -335,7 +374,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 2 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -346,10 +388,16 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 9 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -373,7 +421,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -403,7 +454,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ VALIDATED → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 10 Mutation operations │ │ @@ -464,6 +518,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ └── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ @@ -472,6 +529,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ │ rule: "dependents removed before column" │ │ │ │ @@ -492,7 +552,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ DELETE_ONLY → ABSENT @@ -503,15 +566,14 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 104 - │ │ │ ├── • LogEvent │ │ Element: │ │ SecondaryIndex: @@ -545,6 +607,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ IndexID: 4 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 104 + │ │ │ ├── • MakeColumnAbsent │ │ ColumnID: 3 │ │ EventBase: @@ -572,6 +638,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -600,6 +669,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_1_of_7 index ecc312a9f615..5f31ae5291de 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_1_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -34,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ rule: "ensure columns are in increasing order" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ rule: "index dependents exist before index becomes public" │ │ rule: "index named right before index becomes public" @@ -67,6 +76,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -82,6 +94,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_2_of_7 index 6a95fd897cc1..652f61dcd90e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_2_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -67,6 +76,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -80,7 +92,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -177,6 +192,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_3_of_7 index 83b3b5aa26a2..b3133b1ccfbd 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_3_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -67,6 +76,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -80,7 +92,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -177,6 +192,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_4_of_7 index ca95ff2ce34e..27352672ec44 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_4_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -67,6 +76,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -80,7 +92,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -177,6 +192,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_5_of_7 index 354a2465c819..15124bf5baa9 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_5_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -74,7 +86,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -156,6 +171,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -165,6 +183,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_6_of_7 index 0b44f8d865f8..175cb18b7105 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_6_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -74,7 +86,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -156,6 +171,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -165,6 +183,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_7_of_7 index 8ac4a5aa514c..b93963fecf2d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_7_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -34,6 +37,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -55,6 +61,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -74,7 +86,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -156,6 +171,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -165,6 +183,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_10_of_15 index 2bf366388dd8..5b2b6ab091bc 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_10_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -121,7 +133,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,7 +145,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ rule: "index no longer public before dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -147,6 +165,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -157,7 +178,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ │ PUBLIC → ABSENT @@ -301,7 +325,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT @@ -309,12 +336,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ - │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ │ rule: "dependents removed before index" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ │ rule: "dependents removed before index" + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ rule: "dependents removed before index" │ │ │ @@ -323,10 +356,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 3 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 4 │ │ TableID: 104 @@ -343,6 +372,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ IndexID: 6 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 3 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -364,6 +397,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_11_of_15 index 4704b7a78459..9186c2f61c6f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_11_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -121,7 +133,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,7 +145,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ rule: "index no longer public before dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -147,6 +165,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -157,7 +178,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ │ PUBLIC → ABSENT @@ -301,7 +325,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT @@ -309,12 +336,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ - │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ │ rule: "dependents removed before index" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ │ rule: "dependents removed before index" + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ rule: "dependents removed before index" │ │ │ @@ -323,10 +356,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 3 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 4 │ │ TableID: 104 @@ -343,6 +372,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ IndexID: 6 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 3 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -364,6 +397,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_12_of_15 index 596d1e07a5d3..f01dd3e1afa0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_12_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -121,7 +133,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,7 +145,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ rule: "index no longer public before dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -153,11 +171,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ │ rule: "dependents removed before index" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ │ PUBLIC → ABSENT @@ -301,7 +325,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ ├── • 3 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT @@ -309,12 +336,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ - │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ │ rule: "dependents removed before index" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ │ rule: "dependents removed before index" + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ rule: "dependents removed before index" │ │ │ @@ -323,10 +356,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ └── • 7 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 3 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 4 │ │ TableID: 104 @@ -343,6 +372,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ IndexID: 6 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 3 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -364,6 +397,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_13_of_15 index 3b1418718bc2..ba9bb2692ae3 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_13_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -121,7 +133,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,7 +145,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "index no longer public before dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -145,10 +163,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ │ PUBLIC → ABSENT @@ -264,7 +288,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT @@ -272,8 +299,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ - │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ │ rule: "dependents removed before index" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ │ rule: "dependents removed before index" + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ │ │ DELETE_ONLY → ABSENT @@ -284,12 +314,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ │ rule: "dependents removed before index" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ rule: "dependents removed before index" │ │ │ @@ -298,10 +334,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ └── • 10 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 3 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 4 │ │ TableID: 104 @@ -350,6 +382,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ IndexID: 6 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 3 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -371,6 +407,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_14_of_15 index a69bdaacd53a..387275cbcdda 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_14_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -121,7 +133,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,7 +145,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "index no longer public before dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -145,10 +163,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ │ PUBLIC → ABSENT @@ -264,7 +288,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT @@ -272,8 +299,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ - │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ │ rule: "dependents removed before index" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ │ rule: "dependents removed before index" + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ │ │ DELETE_ONLY → ABSENT @@ -284,12 +314,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ │ rule: "dependents removed before index" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ rule: "dependents removed before index" │ │ │ @@ -298,10 +334,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ └── • 10 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 3 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 4 │ │ TableID: 104 @@ -350,6 +382,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ IndexID: 6 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 3 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -371,6 +407,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_15_of_15 index 69cce34e2ea7..5b5c96c5330d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_15_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -121,7 +133,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,7 +145,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "index no longer public before dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -145,10 +163,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ │ PUBLIC → ABSENT @@ -264,7 +288,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT @@ -272,8 +299,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ - │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ │ rule: "dependents removed before index" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ │ rule: "dependents removed before index" + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ │ │ DELETE_ONLY → ABSENT @@ -284,12 +314,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ │ rule: "dependents removed before index" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ rule: "dependents removed before index" │ │ │ @@ -298,10 +334,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ └── • 10 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 3 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 4 │ │ TableID: 104 @@ -350,6 +382,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ IndexID: 6 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 3 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -371,6 +407,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_1_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_1_of_15 index 4718c0215723..53a839f64532 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_1_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_1_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ rule: "ensure columns are in increasing order" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ rule: "index dependents exist before index becomes public" │ │ rule: "index named right before index becomes public" @@ -95,6 +104,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -110,8 +122,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 14 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_2_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_2_of_15 index 574bff0d5326..6ee0613afe60 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_2_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_2_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -95,6 +104,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -105,7 +117,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 13 Mutation operations │ │ @@ -199,8 +214,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 4 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_3_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_3_of_15 index 32b37c2c8908..b8ed987eebca 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_3_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_3_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -95,6 +104,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -105,7 +117,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 13 Mutation operations │ │ @@ -199,8 +214,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 4 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_4_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_4_of_15 index 0b7e271f6a84..4e96bf19135b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_4_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_4_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -101,11 +110,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 13 Mutation operations │ │ @@ -199,8 +214,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 4 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_5_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_5_of_15 index 9cc38bdf8e41..f598f063b814 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_5_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_5_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -93,10 +102,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 12 Mutation operations │ │ @@ -178,6 +193,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ rule: "dependents removed before index" │ │ @@ -187,8 +205,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 6 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_6_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_6_of_15 index 345ac0651925..7c490e64c6e7 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_6_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_6_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -93,10 +102,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 12 Mutation operations │ │ @@ -178,6 +193,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ rule: "dependents removed before index" │ │ @@ -187,8 +205,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 6 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_7_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_7_of_15 index 22abb30c48d0..66485e5a98ee 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_7_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_7_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -93,10 +102,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 12 Mutation operations │ │ @@ -178,6 +193,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ rule: "dependents removed before index" │ │ @@ -187,8 +205,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 6 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_8_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_8_of_15 index 8a2b76adbf42..6945884481ad 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_8_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_8_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -93,10 +102,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 12 Mutation operations │ │ @@ -178,6 +193,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ rule: "dependents removed before index" │ │ @@ -187,8 +205,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 6 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_9_of_15 index 0835f894c952..b3ef595e4989 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_9_of_15 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -32,6 +35,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -53,6 +59,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -75,6 +84,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -121,7 +133,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -130,7 +145,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ rule: "index no longer public before dependents" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -147,6 +165,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 5} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -159,6 +180,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -311,7 +335,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT @@ -319,15 +346,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ - │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ rule: "dependents removed before index" + │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ rule: "dependents removed before index" + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ │ │ └── • 5 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 3 - │ │ TableID: 104 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 4 │ │ TableID: 104 @@ -336,6 +362,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ IndexID: 4 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 3 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -357,6 +387,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_1_of_2 index 2b666c0c5ffa..e9d348da5af5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_1_of_2 @@ -13,7 +13,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 3 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ ABSENT → PUBLIC @@ -30,7 +33,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 3 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ ABSENT → PUBLIC @@ -47,7 +53,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 6 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} -│ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} +│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -58,6 +67,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 4} │ │ │ │ PUBLIC → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 4} +│ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ rule: "secondary indexes containing column as key reach write-only before column" │ │ │ @@ -68,7 +80,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ PUBLIC → VALIDATED +│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ PUBLIC → ABSENT @@ -208,6 +223,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ @@ -234,6 +252,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -255,7 +276,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -275,7 +299,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -295,7 +322,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -309,7 +339,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -329,7 +362,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -349,6 +385,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -368,7 +407,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 3 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -385,10 +427,16 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 4} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -421,7 +469,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -460,7 +511,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ VALIDATED → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 10 Mutation operations │ │ @@ -521,6 +575,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -532,6 +589,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 4} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 4} │ │ │ │ rule: "dependents removed before column" │ │ │ │ @@ -552,7 +612,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ DELETE_ONLY → ABSENT @@ -566,15 +629,14 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 104 - │ │ │ ├── • LogEvent │ │ Element: │ │ SecondaryIndex: @@ -608,6 +670,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ IndexID: 4 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 104 + │ │ │ ├── • MakeColumnAbsent │ │ ColumnID: 4 │ │ EventBase: @@ -635,6 +701,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -666,6 +735,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_2_of_2 index 6ba3d0e67732..98355ab0bfb7 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_2_of_2 @@ -44,8 +44,11 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ -│ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} -│ │ │ rule: "index-column added to index before temp index receives writes" +│ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} +│ │ │ │ rule: "index-column added to index before temp index receives writes" +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -73,6 +76,9 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ └── • Precedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ rule: "temp index is WRITE_ONLY before backfill" │ │ │ @@ -88,7 +94,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -108,7 +117,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -128,7 +140,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -142,7 +157,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -162,7 +180,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ WRITE_ONLY → VALIDATED +│ │ │ │ WRITE_ONLY → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ │ │ └── • 1 Validation operation │ │ │ @@ -186,6 +207,9 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ │ +│ │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" +│ │ │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -211,8 +235,11 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} │ │ │ │ │ ABSENT → BACKFILL_ONLY │ │ │ │ │ -│ │ │ │ └── • Precedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ │ rule: "primary index with new columns should exist before secondary indexes" +│ │ │ │ ├── • Precedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ │ rule: "primary index with new columns should exist before secondary indexes" +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} +│ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ │ │ │ ABSENT → PUBLIC @@ -231,13 +258,19 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ │ ABSENT → DELETE_ONLY │ │ │ │ -│ │ │ └── • Precedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ rule: "primary index with new columns should exist before temp indexes" +│ │ │ ├── • Precedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ rule: "primary index with new columns should exist before temp indexes" +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} -│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ │ PUBLIC → VALIDATED +│ │ │ │ │ +│ │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -326,7 +359,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward TRANSIENT_ABSENT │ │ │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} -│ │ │ DELETE_ONLY → WRITE_ONLY +│ │ │ │ DELETE_ONLY → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -354,6 +390,9 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} +│ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ └── • Precedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} │ │ │ rule: "temp index is WRITE_ONLY before backfill" │ │ │ @@ -369,7 +408,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -389,7 +431,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -409,7 +454,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -423,7 +471,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} +│ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -443,7 +494,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} +│ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -466,6 +520,9 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 5} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 4, TemporaryIndexID: 6, SourceIndexID: 3} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: idx, IndexID: 5} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -491,18 +548,30 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} - │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ ├── • 10 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 4} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -535,7 +604,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 4, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -568,7 +640,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ VALIDATED → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 10 Mutation operations │ │ @@ -624,17 +699,26 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ - │ │ └── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ rule: "dependents removed before index" + │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ rule: "dependents removed before index" + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} - │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT + │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT + │ │ + │ └── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 4, SourceIndexID: 3} + │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" │ ├── • 6 elements transitioning toward ABSENT │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • SameStagePrecedence dependency from ABSENT ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ rule: "column type removed right before column when not dropping relation" @@ -657,6 +741,9 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ ├── • Column:{DescID: 104, ColumnID: 4} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • SameStagePrecedence dependency from ABSENT ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ rule: "dependents removed before column" │ │ │ rule: "column type removed right before column when not dropping relation" @@ -688,6 +775,9 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ rule: "dependents removed before index" │ │ @@ -703,6 +793,9 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index index 8cc693129b2a..5810bda195ca 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index @@ -16,7 +16,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • 4 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 4} │ │ │ │ ABSENT → PUBLIC @@ -39,7 +42,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • 4 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ ABSENT → PUBLIC @@ -62,7 +68,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 3} -│ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 106, ColumnID: 3} +│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" │ │ │ │ │ └── • ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ PUBLIC → ABSENT @@ -181,6 +190,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ @@ -210,6 +222,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -234,7 +249,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -254,7 +272,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -274,7 +295,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -288,7 +312,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -308,7 +335,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -328,6 +358,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 106, Name: test_pkey, IndexID: 4} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -350,7 +383,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • 4 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -373,7 +409,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • 7 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 106, ColumnID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -415,7 +454,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 106, Name: test_pkey, IndexID: 1} │ │ │ PUBLIC → ABSENT @@ -474,6 +516,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ └── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ @@ -486,14 +531,13 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 5 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 106 - │ │ │ ├── • CreateGcJobForIndex │ │ IndexID: 5 │ │ TableID: 106 @@ -502,6 +546,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ IndexID: 5 │ │ TableID: 106 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 106 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 106 │ │ @@ -517,6 +565,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • Column:{DescID: 106, ColumnID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ rule: "dependents removed before column" │ │ │ @@ -563,6 +614,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 4, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_1_of_7 index d772a10165ed..5391e33b684f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_1_of_7 @@ -19,6 +19,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • Column:{DescID: 106, ColumnID: 3} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -39,6 +42,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -72,6 +78,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ rule: "dependents removed before index" │ │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_2_of_7 index 853124d947e3..df55845e823b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_2_of_7 @@ -19,6 +19,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • Column:{DescID: 106, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -39,6 +42,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -70,7 +76,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -150,6 +159,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_3_of_7 index ddca208de1ed..f26bc911df0e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_3_of_7 @@ -19,6 +19,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • Column:{DescID: 106, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -39,6 +42,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -70,7 +76,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -150,6 +159,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_4_of_7 index 3fbb9ff1946b..171f547fdc30 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_4_of_7 @@ -19,6 +19,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • Column:{DescID: 106, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -39,6 +42,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 4} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -70,7 +76,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -150,6 +159,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_5_of_7 index 5f14c41d52a4..b2cb52476125 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_5_of_7 @@ -19,6 +19,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Column:{DescID: 106, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -37,7 +40,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -123,6 +132,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -138,6 +150,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_6_of_7 index c28e13ac0914..1562e5a63836 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_6_of_7 @@ -19,6 +19,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Column:{DescID: 106, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -37,7 +40,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -123,6 +132,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -138,6 +150,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_7_of_7 index 54d780f503ce..380806d10abc 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_7_of_7 @@ -19,6 +19,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Column:{DescID: 106, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 106, Name: pi, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -37,7 +40,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → ABSENT @@ -58,7 +64,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ │ │ PUBLIC → ABSENT @@ -123,6 +132,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 4, ConstraintID: 5, TemporaryIndexID: 5, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 106, Name: test_pkey, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -138,6 +150,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ └── • TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 6, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index index 04f7ba90824b..c8c9f37a11c4 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index @@ -13,7 +13,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 2 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ ABSENT → PUBLIC @@ -24,7 +27,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 2 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ ABSENT → PUBLIC @@ -37,6 +43,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ PUBLIC → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} +│ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ rule: "secondary indexes containing column as key reach write-only before column" │ │ │ @@ -47,7 +56,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ PUBLIC → VALIDATED +│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ │ PUBLIC → ABSENT @@ -149,6 +161,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ @@ -172,6 +187,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -190,7 +208,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -210,7 +231,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -230,7 +254,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -244,7 +271,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -264,7 +294,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -284,6 +317,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -300,7 +336,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 2 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -311,7 +350,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • 8 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -335,7 +377,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -365,7 +410,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ VALIDATED → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 9 Mutation operations │ │ @@ -422,13 +470,19 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ └── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ DELETE_ONLY → ABSENT @@ -439,15 +493,14 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ rule: "dependents removed before index" │ │ │ └── • 8 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 104 - │ │ │ ├── • LogEvent │ │ Element: │ │ SecondaryIndex: @@ -481,6 +534,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ IndexID: 4 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 104 + │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 │ │ @@ -496,6 +553,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -530,6 +590,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_1_of_7 index 9b1401870269..980fe2806d24 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_1_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ rule: "index dependents exist before index becomes public" │ │ rule: "index named right before index becomes public" @@ -52,6 +58,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -67,6 +76,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ rule: "dependents removed before index" │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_2_of_7 index 4deb830f13a3..5faeff013fe5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_2_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -52,6 +58,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_3_of_7 index 6b6b69e52916..07de05e2f41f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_3_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -52,6 +58,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_4_of_7 index 0888536fa528..63635aaa4d0e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_4_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -52,6 +58,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -65,7 +74,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -142,6 +154,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_5_of_7 index e006d5b5a1e0..91fa031e34ba 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_5_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -50,7 +56,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -59,7 +68,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -121,6 +133,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -130,6 +145,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_6_of_7 index 96bda0fc1209..531eeed2f096 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_6_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -50,7 +56,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -59,7 +68,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -121,6 +133,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -130,6 +145,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_7_of_7 index b8f616d4a377..b08fc74cfabf 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_7_of_7 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -40,6 +43,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -50,7 +56,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -59,7 +68,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ PUBLIC → ABSENT @@ -121,6 +133,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -130,6 +145,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index index bf0fc06cfada..c038dab96c5a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ PUBLIC → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 3} +│ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ rule: "secondary indexes containing column as key reach write-only before column" │ │ │ @@ -26,7 +29,10 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ PUBLIC → VALIDATED +│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: idx, IndexID: 2} │ │ │ PUBLIC → ABSENT @@ -75,7 +81,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 6 elements transitioning toward ABSENT +│ ├── • 5 elements transitioning toward ABSENT │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -107,9 +113,6 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ -│ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ VALIDATED → WRITE_ONLY -│ │ │ │ │ ├── • CheckConstraint:{DescID: 104, ConstraintID: 2} │ │ │ │ PUBLIC → ABSENT │ │ │ │ @@ -152,10 +155,16 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 4 Mutation operations │ │ @@ -182,6 +191,9 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: crdb_internal_j_shard_16, ColumnID: 3} │ │ │ rule: "dependents removed before column" │ │ │ @@ -213,6 +225,9 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 2} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index index 31b70c26506e..786eecf6eec0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ PUBLIC → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 3} +│ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ rule: "secondary indexes containing column as key reach write-only before column" │ │ │ @@ -26,7 +29,10 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ PUBLIC → VALIDATED +│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: idx, IndexID: 2} │ │ │ PUBLIC → ABSENT @@ -75,7 +81,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 3 elements transitioning toward ABSENT +│ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -89,17 +95,14 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ -│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} -│ │ │ │ PUBLIC → ABSENT -│ │ │ │ -│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ │ rule: "index no longer public before dependents" -│ │ │ │ -│ │ │ └── • skip PUBLIC → ABSENT operations -│ │ │ rule: "skip index-column removal ops on index removal" -│ │ │ -│ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ VALIDATED → WRITE_ONLY +│ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} +│ │ │ PUBLIC → ABSENT +│ │ │ +│ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "index no longer public before dependents" +│ │ │ +│ │ └── • skip PUBLIC → ABSENT operations +│ │ rule: "skip index-column removal ops on index removal" │ │ │ └── • 2 Mutation operations │ │ @@ -127,10 +130,16 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 4 Mutation operations │ │ @@ -157,6 +166,9 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ │ rule: "dependents removed before column" │ │ │ @@ -195,6 +207,9 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ rule: "dependents removed before index" │ │ rule: "partial predicate removed right before secondary index when not dropping relation" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 2} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index index 7299c57eda4b..115b5238b578 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index @@ -14,7 +14,10 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ PUBLIC → VALIDATED +│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: idx, IndexID: 2} │ │ │ PUBLIC → ABSENT @@ -37,7 +40,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 3 elements transitioning toward ABSENT +│ ├── • 2 elements transitioning toward ABSENT │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 2} │ │ │ │ PUBLIC → ABSENT @@ -48,17 +51,14 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ └── • skip PUBLIC → ABSENT operations │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ -│ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} -│ │ │ │ PUBLIC → ABSENT -│ │ │ │ -│ │ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ │ rule: "index no longer public before dependents" -│ │ │ │ -│ │ │ └── • skip PUBLIC → ABSENT operations -│ │ │ rule: "skip index-column removal ops on index removal" -│ │ │ -│ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ VALIDATED → WRITE_ONLY +│ │ └── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} +│ │ │ PUBLIC → ABSENT +│ │ │ +│ │ ├── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "index no longer public before dependents" +│ │ │ +│ │ └── • skip PUBLIC → ABSENT operations +│ │ rule: "skip index-column removal ops on index removal" │ │ │ └── • 2 Mutation operations │ │ @@ -86,7 +86,10 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • 1 element transitioning toward ABSENT │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 3 Mutation operations │ │ @@ -115,6 +118,9 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 2} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 index 800f2b32570c..4a4fc7d46250 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: k, ColumnID: 3} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -50,6 +53,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ WRITE_ONLY → PUBLIC │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -68,6 +74,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ rule: "ensure columns are in increasing order" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ rule: "column dependents exist before column becomes public" │ │ │ @@ -89,6 +98,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ rule: "index dependents exist before index becomes public" │ │ rule: "index named right before index becomes public" @@ -119,6 +131,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ BACKFILL_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ @@ -128,8 +143,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 17 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 index edbfc1db5d4b..25c8b0d4fa72 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: k, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -50,6 +53,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -68,6 +74,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -89,6 +98,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -119,6 +131,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -126,7 +141,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 16 Mutation operations │ │ @@ -238,8 +256,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 4 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 index 346b3959bf6c..190e513440f0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: k, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -50,6 +53,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -68,6 +74,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -89,6 +98,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -119,6 +131,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ @@ -126,7 +141,10 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 16 Mutation operations │ │ @@ -238,8 +256,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 4 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 index 1de7929d523d..c7795d8dda12 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: k, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -50,6 +53,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -68,6 +74,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -89,6 +98,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -122,11 +134,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "dependents removed before index" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 16 Mutation operations │ │ @@ -238,8 +256,11 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 4 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 index e7880cba75e0..8e6c0750b9ec 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: k, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -50,6 +53,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -68,6 +74,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -89,6 +98,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -117,10 +129,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 15 Mutation operations │ │ @@ -220,14 +238,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ rule: "dependents removed before index" │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 6 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 index fe79e3805c63..5c5c537c3e9e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: k, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -50,6 +53,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -68,6 +74,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -89,6 +98,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -117,10 +129,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ MERGE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 15 Mutation operations │ │ @@ -220,14 +238,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ rule: "dependents removed before index" │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 6 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 index a0933fcf6761..4f5bf853dd85 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 @@ -17,6 +17,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnName:{DescID: 104, Name: k, ColumnID: 3} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -50,6 +53,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ │ WRITE_ONLY → PUBLIC │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -68,6 +74,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • SameStagePrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} │ │ │ │ rule: "ensure columns are in increasing order" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC" + │ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "column dependents exist before column becomes public" │ │ │ │ @@ -89,6 +98,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ │ rule: "SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -117,10 +129,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ └── • 15 Mutation operations │ │ @@ -220,14 +238,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ rule: "dependents removed before index" │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ DELETE_ONLY → ABSENT │ │ - │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ rule: "dependents removed before index" + │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} + │ │ rule: "dependents removed before index" + │ │ + │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ └── • 6 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 index 2b666c0c5ffa..e9d348da5af5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 @@ -13,7 +13,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 3 elements transitioning toward PUBLIC │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ ABSENT → BACKFILL_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ ABSENT → PUBLIC @@ -30,7 +33,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 3 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} -│ │ │ ABSENT → DELETE_ONLY +│ │ │ │ ABSENT → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ ABSENT → PUBLIC @@ -47,7 +53,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 6 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} -│ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ PUBLIC → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 2} +│ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" │ │ │ │ │ ├── • ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ │ PUBLIC → ABSENT @@ -58,6 +67,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 4} │ │ │ │ PUBLIC → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 4} +│ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ rule: "secondary indexes containing column as key reach write-only before column" │ │ │ @@ -68,7 +80,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} -│ │ │ PUBLIC → VALIDATED +│ │ │ │ PUBLIC → VALIDATED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} +│ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ └── • IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ │ PUBLIC → ABSENT @@ -208,6 +223,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ rule: "index-column added to index before temp index receives writes" │ │ │ │ @@ -234,6 +252,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ │ │ BACKFILL_ONLY → BACKFILLED │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ @@ -255,7 +276,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -275,7 +299,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -295,7 +322,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -309,7 +339,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -329,7 +362,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -349,6 +385,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ ├── • SameStagePrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ │ │ rule: "primary index swap" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ rule: "index named right before index becomes public" @@ -368,7 +407,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 3 elements transitioning toward TRANSIENT_ABSENT │ │ │ │ │ ├── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ │ PUBLIC → TRANSIENT_ABSENT @@ -385,10 +427,16 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • 11 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 4} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -421,7 +469,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -460,7 +511,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ VALIDATED → DELETE_ONLY + │ │ │ VALIDATED → DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ └── • 10 Mutation operations │ │ @@ -521,6 +575,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ TRANSIENT_DELETE_ONLY → TRANSIENT_ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" + │ │ │ │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ @@ -532,6 +589,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 4} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 4} │ │ │ │ rule: "dependents removed before column" │ │ │ │ @@ -552,7 +612,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ DELETE_ONLY → ABSENT @@ -566,15 +629,14 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 104 - │ │ │ ├── • LogEvent │ │ Element: │ │ SecondaryIndex: @@ -608,6 +670,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ IndexID: 4 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 104 + │ │ │ ├── • MakeColumnAbsent │ │ ColumnID: 4 │ │ EventBase: @@ -635,6 +701,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ @@ -666,6 +735,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 index 965b66031999..95d5a1e10703 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 @@ -16,6 +16,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ │ PUBLIC → WRITE_ONLY │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from PUBLIC Column:{DescID: 104, ColumnID: 3} +│ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY" +│ │ │ │ │ │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ rule: "secondary indexes containing column as key reach write-only before column" │ │ │ @@ -87,8 +90,11 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ │ DELETE_ONLY → WRITE_ONLY │ │ │ │ -│ │ │ └── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} -│ │ │ rule: "index-column added to index before temp index receives writes" +│ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} +│ │ │ │ rule: "index-column added to index before temp index receives writes" +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} +│ │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -113,6 +119,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index-column added to index before index is backfilled" │ │ │ │ +│ │ │ ├── • PreviousTransactionPrecedence dependency from BACKFILL_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED" +│ │ │ │ │ │ │ └── • Precedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ │ rule: "temp index is WRITE_ONLY before backfill" │ │ │ @@ -128,7 +137,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ BACKFILLED → DELETE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from BACKFILLED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -148,7 +160,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ DELETE_ONLY → MERGE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -168,7 +183,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGE_ONLY → MERGED +│ │ │ │ MERGE_ONLY → MERGED +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED" │ │ │ │ │ └── • 1 Backfill operation │ │ │ @@ -182,7 +200,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ │ MERGED → WRITE_ONLY +│ │ │ │ MERGED → WRITE_ONLY +│ │ │ │ +│ │ │ └── • PreviousTransactionPrecedence dependency from MERGED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY" │ │ │ │ │ └── • 3 Mutation operations │ │ │ @@ -202,7 +223,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ ├── • 1 element transitioning toward PUBLIC │ │ │ │ │ └── • PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} -│ │ WRITE_ONLY → VALIDATED +│ │ │ WRITE_ONLY → VALIDATED +│ │ │ +│ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} +│ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED" │ │ │ └── • 1 Validation operation │ │ @@ -225,6 +249,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ │ ├── • Precedence dependency from PUBLIC IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ │ │ rule: "index dependents exist before index becomes public" │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} + │ │ │ │ rule: "PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC" + │ │ │ │ │ │ │ └── • SameStagePrecedence dependency from PUBLIC IndexName:{DescID: 104, Name: t_pkey, IndexID: 3} │ │ │ rule: "index dependents exist before index becomes public" │ │ │ rule: "index named right before index becomes public" @@ -244,18 +271,30 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ └── • TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ WRITE_ONLY → TRANSIENT_DELETE_ONLY + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY" │ │ │ ├── • 14 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 3} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 2} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 4} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -291,7 +330,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ PUBLIC → WRITE_ONLY + │ │ │ │ PUBLIC → VALIDATED + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ │ │ │ ├── • IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ │ │ │ PUBLIC → ABSENT @@ -333,7 +375,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ │ rule: "skip index-column removal ops on index removal" │ │ │ │ │ ├── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ ├── • IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ │ │ PUBLIC → ABSENT @@ -422,14 +467,20 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ ├── • Precedence dependency from TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ │ rule: "dependents removed before index" │ │ │ - │ │ └── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ │ rule: "dependents removed before index" + │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} + │ │ │ rule: "dependents removed before index" + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from TRANSIENT_DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} + │ │ rule: "TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT" │ │ │ ├── • 4 elements transitioning toward ABSENT │ │ │ │ │ ├── • Column:{DescID: 104, ColumnID: 4} │ │ │ │ DELETE_ONLY → ABSENT │ │ │ │ + │ │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 4} + │ │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ │ │ ├── • SameStagePrecedence dependency from ABSENT ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 4} │ │ │ │ rule: "dependents removed before column" │ │ │ │ rule: "column type removed right before column when not dropping relation" @@ -450,7 +501,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ │ rule: "column no longer public before dependents" │ │ │ │ │ ├── • PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} - │ │ │ WRITE_ONLY → DELETE_ONLY + │ │ │ │ VALIDATED → DELETE_ONLY + │ │ │ │ + │ │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ │ │ │ └── • SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ │ DELETE_ONLY → ABSENT @@ -464,15 +518,14 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ │ rule: "dependents removed before index" │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} + │ │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ rule: "dependents removed before index" │ │ │ └── • 9 Mutation operations │ │ - │ ├── • MakeDroppedIndexDeleteOnly - │ │ IndexID: 1 - │ │ TableID: 104 - │ │ │ ├── • LogEvent │ │ Element: │ │ SecondaryIndex: @@ -506,6 +559,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ IndexID: 4 │ │ TableID: 104 │ │ + │ ├── • MakeDroppedIndexDeleteOnly + │ │ IndexID: 1 + │ │ TableID: 104 + │ │ │ ├── • MakeColumnAbsent │ │ ColumnID: 4 │ │ EventBase: @@ -533,6 +590,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ ├── • Column:{DescID: 104, ColumnID: 3} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 3} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • Precedence dependency from ABSENT ColumnName:{DescID: 104, Name: k, ColumnID: 3} │ │ │ rule: "dependents removed before column" │ │ │ @@ -591,6 +651,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ ├── • Column:{DescID: 104, ColumnID: 2} │ │ │ DELETE_ONLY → ABSENT │ │ │ + │ │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY Column:{DescID: 104, ColumnID: 2} + │ │ │ rule: "Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ │ │ ├── • SameStagePrecedence dependency from ABSENT ColumnType:{DescID: 104, ColumnFamilyID: 0, ColumnID: 2} │ │ │ rule: "dependents removed before column" │ │ │ rule: "column type removed right before column when not dropping relation" @@ -622,6 +685,9 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ ├── • Precedence dependency from ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 1} │ │ rule: "dependents removed before index" │ │ + │ ├── • PreviousTransactionPrecedence dependency from DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} + │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" + │ │ │ └── • Precedence dependency from ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} │ rule: "dependents removed before index" │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema b/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema index 57b7ddf922c7..9f7f7a8f84c5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema @@ -25,7 +25,68 @@ EXPLAIN (ddl, verbose) DROP SCHEMA db.sc; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ └── • 3 Mutation operations +│ ├── • 6 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Namespace:{DescID: 106, Name: sc, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 106} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 106, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 106, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • Schema:{DescID: 106} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED Schema:{DescID: 106} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ └── • SchemaParent:{DescID: 106, ReferencedDescID: 104} +│ │ │ PUBLIC → ABSENT +│ │ │ +│ │ └── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} +│ │ rule: "descriptor drop right before dependent element removal" +│ │ +│ └── • 6 Mutation operations +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 106 +│ │ +│ ├── • RemoveSchemaParent +│ │ Parent: +│ │ ParentDatabaseID: 104 +│ │ SchemaID: 106 +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DatabaseID: 104 +│ │ DescriptorID: 106 +│ │ Name: sc │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 104 @@ -43,7 +104,7 @@ EXPLAIN (ddl, verbose) DROP SCHEMA db.sc; │ - 106 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending │ Statements: │ - statement: DROP SCHEMA db.sc │ redactedstatement: DROP SCHEMA ‹db›.‹sc› @@ -51,85 +112,15 @@ EXPLAIN (ddl, verbose) DROP SCHEMA db.sc; │ └── • PostCommitNonRevertiblePhase │ - ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase - │ │ - │ ├── • 6 elements transitioning toward ABSENT - │ │ │ - │ │ ├── • Namespace:{DescID: 106, Name: sc, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 106} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 106, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 106, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • Schema:{DescID: 106} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ └── • SchemaParent:{DescID: 106, ReferencedDescID: 104} - │ │ │ PUBLIC → ABSENT - │ │ │ - │ │ └── • SameStagePrecedence dependency from DROPPED Schema:{DescID: 106} - │ │ rule: "descriptor drop right before dependent element removal" - │ │ - │ └── • 6 Mutation operations - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 106 - │ │ - │ ├── • RemoveSchemaParent - │ │ Parent: - │ │ ParentDatabaseID: 104 - │ │ SchemaID: 106 - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DatabaseID: 104 - │ │ DescriptorID: 106 - │ │ Name: sc - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 104 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 106 - │ │ - │ └── • UpdateSchemaChangerJob - │ IsNonCancelable: true - │ JobID: 1 - │ RunningStatus: PostCommitNonRevertiblePhase stage 2 of 2 with 2 MutationType ops pending - │ - └── • Stage 2 of 2 in PostCommitNonRevertiblePhase + └── • Stage 1 of 1 in PostCommitNonRevertiblePhase │ ├── • 1 element transitioning toward ABSENT │ │ │ └── • Schema:{DescID: 106} - │ DROPPED → ABSENT + │ │ DROPPED → ABSENT + │ │ + │ └── • PreviousTransactionPrecedence dependency from DROPPED Schema:{DescID: 106} + │ rule: "descriptor DROPPED in transaction before removal" │ └── • 5 Mutation operations │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_table b/pkg/sql/schemachanger/testdata/explain_verbose/drop_table index 21850811081b..df6b8b729c5c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_table +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_table @@ -63,7 +63,61 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • Stage 1 of 1 in PreCommitPhase │ │ -│ ├── • 6 elements transitioning toward ABSENT +│ ├── • 28 elements transitioning toward ABSENT +│ │ │ +│ │ ├── • Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • Owner:{DescID: 107} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 107, Name: admin} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • UserPrivileges:{DescID: 107, Name: root} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" +│ │ │ +│ │ ├── • Table:{DescID: 107} +│ │ │ │ TXN_DROPPED → DROPPED +│ │ │ │ +│ │ │ └── • PreviousStagePrecedence dependency from TXN_DROPPED Table:{DescID: 107} +│ │ │ rule: "descriptor TXN_DROPPED before DROPPED" +│ │ │ +│ │ ├── • ObjectParent:{DescID: 107, ReferencedDescID: 106} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ +│ │ ├── • ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip element removal ops on descriptor drop" │ │ │ │ │ ├── • Column:{DescID: 107, ColumnID: 1} │ │ │ │ WRITE_ONLY → DELETE_ONLY @@ -71,40 +125,234 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 107, Name: k, ColumnID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 1} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 1} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 107, ColumnID: 2} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 107, Name: v, ColumnID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 2} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 2} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 107, ColumnID: 3} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • SameStagePrecedence dependency from ABSENT ColumnDefaultExpression:{DescID: 107, ColumnID: 3} +│ │ │ rule: "column type dependents removed right before column type" +│ │ │ +│ │ ├── • ColumnDefaultExpression:{DescID: 107, ColumnID: 3} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 107, ColumnID: 4294967295} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ +│ │ ├── • ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967295} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967295} +│ │ │ rule: "column no longer public before dependents" +│ │ │ │ │ ├── • Column:{DescID: 107, ColumnID: 4294967294} │ │ │ │ WRITE_ONLY → DELETE_ONLY │ │ │ │ │ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations │ │ │ rule: "skip column removal ops on relation drop" │ │ │ -│ │ └── • PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} -│ │ │ VALIDATED → DELETE_ONLY +│ │ ├── • ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967294} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip column dependents removal ops on relation drop" +│ │ │ +│ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967294} +│ │ │ rule: "column no longer public before dependents" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index dependents removal ops on relation drop" +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 1} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index dependents removal ops on relation drop" +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} +│ │ │ │ PUBLIC → ABSENT +│ │ │ │ +│ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ │ rule: "descriptor drop right before dependent element removal" +│ │ │ │ +│ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 2} +│ │ │ │ rule: "column no longer public before dependents" +│ │ │ │ +│ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} +│ │ │ │ rule: "index no longer public before dependents" +│ │ │ │ +│ │ │ └── • skip PUBLIC → ABSENT operations +│ │ │ rule: "skip index dependents removal ops on relation drop" +│ │ │ rule: "skip index-column removal ops on index removal" +│ │ │ +│ │ ├── • PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} +│ │ │ │ VALIDATED → DELETE_ONLY +│ │ │ │ +│ │ │ ├── • skip VALIDATED → WRITE_ONLY operations +│ │ │ │ rule: "skip index removal ops on relation drop" +│ │ │ │ +│ │ │ └── • skip WRITE_ONLY → DELETE_ONLY operations +│ │ │ rule: "skip index removal ops on relation drop" +│ │ │ +│ │ └── • IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} +│ │ │ PUBLIC → ABSENT │ │ │ -│ │ ├── • skip VALIDATED → WRITE_ONLY operations -│ │ │ rule: "skip index removal ops on relation drop" +│ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} +│ │ │ rule: "descriptor drop right before dependent element removal" │ │ │ -│ │ └── • skip WRITE_ONLY → DELETE_ONLY operations -│ │ rule: "skip index removal ops on relation drop" +│ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} +│ │ │ rule: "index no longer public before dependents" +│ │ │ +│ │ └── • skip PUBLIC → ABSENT operations +│ │ rule: "skip index dependents removal ops on relation drop" │ │ -│ └── • 2 Mutation operations +│ └── • 6 Mutation operations +│ │ +│ ├── • MarkDescriptorAsDropped +│ │ DescID: 107 +│ │ +│ ├── • RemoveAllTableComments +│ │ TableID: 107 +│ │ +│ ├── • RemoveColumnDefaultExpression +│ │ ColumnID: 3 +│ │ TableID: 107 +│ │ +│ ├── • DrainDescriptorName +│ │ Namespace: +│ │ DatabaseID: 104 +│ │ DescriptorID: 107 +│ │ Name: t +│ │ SchemaID: 106 │ │ │ ├── • SetJobStateOnDescriptor │ │ DescriptorID: 107 @@ -117,7 +365,7 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ - 107 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops pending │ Statements: │ - statement: DROP TABLE db.sc.t │ redactedstatement: DROP TABLE ‹db›.‹sc›.‹t› @@ -125,271 +373,15 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ └── • PostCommitNonRevertiblePhase │ - ├── • Stage 1 of 2 in PostCommitNonRevertiblePhase - │ │ - │ ├── • 22 elements transitioning toward ABSENT - │ │ │ - │ │ ├── • Namespace:{DescID: 107, Name: t, ReferencedDescID: 104} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Owner:{DescID: 107} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 107, Name: admin} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • UserPrivileges:{DescID: 107, Name: root} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • Table:{DescID: 107} - │ │ │ TXN_DROPPED → DROPPED - │ │ │ - │ │ ├── • ObjectParent:{DescID: 107, ReferencedDescID: 106} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • ColumnFamily:{DescID: 107, Name: primary, ColumnFamilyID: 0} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip element removal ops on descriptor drop" - │ │ │ - │ │ ├── • ColumnName:{DescID: 107, Name: k, ColumnID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 1} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 1} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 107, Name: v, ColumnID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 2} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 2} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 2} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 107, Name: rowid, ColumnID: 3} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 3} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • SameStagePrecedence dependency from ABSENT ColumnDefaultExpression:{DescID: 107, ColumnID: 3} - │ │ │ rule: "column type dependents removed right before column type" - │ │ │ - │ │ ├── • ColumnDefaultExpression:{DescID: 107, ColumnID: 3} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 107, Name: crdb_internal_mvcc_timestamp, ColumnID: 4294967295} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967295} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967295} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967295} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • ColumnName:{DescID: 107, Name: tableoid, ColumnID: 4294967294} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967294} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip column dependents removal ops on relation drop" - │ │ │ - │ │ ├── • ColumnType:{DescID: 107, ColumnFamilyID: 0, ColumnID: 4294967294} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 4294967294} - │ │ │ rule: "column no longer public before dependents" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 107, ColumnID: 3, IndexID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 3} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index dependents removal ops on relation drop" - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 1} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index dependents removal ops on relation drop" - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ ├── • IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} - │ │ │ │ PUBLIC → ABSENT - │ │ │ │ - │ │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ │ - │ │ │ ├── • Precedence dependency from WRITE_ONLY Column:{DescID: 107, ColumnID: 2} - │ │ │ │ rule: "column no longer public before dependents" - │ │ │ │ - │ │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} - │ │ │ │ rule: "index no longer public before dependents" - │ │ │ │ - │ │ │ └── • skip PUBLIC → ABSENT operations - │ │ │ rule: "skip index dependents removal ops on relation drop" - │ │ │ rule: "skip index-column removal ops on index removal" - │ │ │ - │ │ └── • IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} - │ │ │ PUBLIC → ABSENT - │ │ │ - │ │ ├── • SameStagePrecedence dependency from DROPPED Table:{DescID: 107} - │ │ │ rule: "descriptor drop right before dependent element removal" - │ │ │ - │ │ ├── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} - │ │ │ rule: "index no longer public before dependents" - │ │ │ - │ │ └── • skip PUBLIC → ABSENT operations - │ │ rule: "skip index dependents removal ops on relation drop" - │ │ - │ └── • 6 Mutation operations - │ │ - │ ├── • MarkDescriptorAsDropped - │ │ DescID: 107 - │ │ - │ ├── • RemoveAllTableComments - │ │ TableID: 107 - │ │ - │ ├── • RemoveColumnDefaultExpression - │ │ ColumnID: 3 - │ │ TableID: 107 - │ │ - │ ├── • DrainDescriptorName - │ │ Namespace: - │ │ DatabaseID: 104 - │ │ DescriptorID: 107 - │ │ Name: t - │ │ SchemaID: 106 - │ │ - │ ├── • SetJobStateOnDescriptor - │ │ DescriptorID: 107 - │ │ - │ └── • UpdateSchemaChangerJob - │ IsNonCancelable: true - │ JobID: 1 - │ RunningStatus: PostCommitNonRevertiblePhase stage 2 of 2 with 7 MutationType ops pending - │ - └── • Stage 2 of 2 in PostCommitNonRevertiblePhase + └── • Stage 1 of 1 in PostCommitNonRevertiblePhase │ ├── • 7 elements transitioning toward ABSENT │ │ │ ├── • Table:{DescID: 107} - │ │ DROPPED → ABSENT + │ │ │ DROPPED → ABSENT + │ │ │ + │ │ └── • PreviousTransactionPrecedence dependency from DROPPED Table:{DescID: 107} + │ │ rule: "descriptor DROPPED in transaction before removal" │ │ │ ├── • Column:{DescID: 107, ColumnID: 1} │ │ │ DELETE_ONLY → ABSENT