Skip to content

Commit e9e92b1

Browse files
craig[bot]bghal
andcommitted
Merge #156875
156875: sql: remove deprecated element status r=bghal a=bghal Any uses of this status are long gone (22.2) Epic: none Release note: None Co-authored-by: Brendan Gerrity <[email protected]>
2 parents 1befb1f + e61ee95 commit e9e92b1

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

pkg/sql/schemachanger/scpb/migration.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,6 @@ func migrateTargetElement(targets []Target, idx int) {
109109
}
110110
}
111111

112-
// migrateStatuses used to migrate individual statuses and generate
113-
// new current and target statuses.
114-
func migrateStatuses(
115-
currentStatus Status, targetStatus Status,
116-
) (newCurrentStatus Status, newTargetStatus Status, updated bool) {
117-
// Target state of TXN_DROPPED has been removed, so push plans further along.
118-
// Note: No version is required for this transition, since it will be valid
119-
// for all releases.
120-
if targetStatus == Status_ABSENT && currentStatus == Status_TXN_DROPPED {
121-
return Status_PUBLIC, targetStatus, true
122-
} else if targetStatus == Status_PUBLIC && currentStatus == Status_TXN_DROPPED {
123-
return Status_ABSENT, targetStatus, true
124-
}
125-
return currentStatus, targetStatus, false
126-
}
127-
128112
// MigrateCurrentState migrates a current state by upgrading elements based
129113
// on the current version number.
130114
func MigrateCurrentState(version clusterversion.ClusterVersion, state *CurrentState) bool {
@@ -140,12 +124,6 @@ func MigrateCurrentState(version clusterversion.ClusterVersion, state *CurrentSt
140124
migrateTargetElement(state.Targets, idx)
141125
targetsToRemove[idx] = struct{}{}
142126
}
143-
current, targetStatus, update := migrateStatuses(state.Current[idx], target.TargetStatus)
144-
if update {
145-
state.Current[idx] = current
146-
target.TargetStatus = targetStatus
147-
updated = true
148-
}
149127
}
150128
if !updated {
151129
return updated
@@ -213,12 +191,6 @@ func MigrateDescriptorState(
213191
newIndexes[descID] = nil
214192
}
215193
}
216-
current, targetStatus, update := migrateStatuses(state.CurrentStatuses[idx], target.TargetStatus)
217-
if update {
218-
state.CurrentStatuses[idx] = current
219-
target.TargetStatus = targetStatus
220-
updated = true
221-
}
222194
if migrated, newTargets := migrateDeprecatedFields(version, target); migrated {
223195
updated = true
224196
for i := range newTargets {

pkg/sql/schemachanger/scpb/scpb.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ enum Status {
3535

3636
// Intermediate states on the descriptor dropping path.
3737
DROPPED = 5;
38-
// TXN_DROPPED only exists to service the 22.2 rule set.
39-
// Deprecated.
40-
TXN_DROPPED = 4 [deprecated = true];
38+
reserved 4;
4139

4240
// Intermediate states on the column and index dropping and adding paths.
4341
// WRITE_ONLY is also used on constraint adding and dropping paths.

0 commit comments

Comments
 (0)