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