Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keys: remove leftover from V23_1DescIDSequenceForSystemTenant gate #116464

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/config/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ func TestGetZoneConfigForKey(t *testing.T) {
{roachpb.RKey(keys.SystemPrefix), keys.SystemRangesID},
{roachpb.RKey(keys.SystemPrefix.Next()), keys.SystemRangesID},
{roachpb.RKey(keys.NodeLivenessPrefix), keys.LivenessRangesID},
{roachpb.RKey(keys.LegacyDescIDGenerator), keys.SystemRangesID},
{roachpb.RKey(keys.NodeIDGenerator), keys.SystemRangesID},
{roachpb.RKey(keys.RangeIDGenerator), keys.SystemRangesID},
{roachpb.RKey(keys.StoreIDGenerator), keys.SystemRangesID},
Expand Down
6 changes: 0 additions & 6 deletions pkg/keys/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,6 @@ var (
// > 1.0 persist the version at which they were bootstrapped.
BootstrapVersionKey = roachpb.Key(makeKey(SystemPrefix, roachpb.RKey("bootstrap-version")))
//
// LegacyDescIDGenerator is the legacy global descriptor ID generator sequence
// used for table and namespace IDs for the system tenant in clusters <23.1.
// Otherwise, a SQL sequence is used for this purpose.
//
// TODO(postamar): remove along with clusterversion.V23_1DescIDSequenceForSystemTenant
LegacyDescIDGenerator = roachpb.Key(makeKey(SystemPrefix, roachpb.RKey("desc-idgen")))
// NodeIDGenerator is the global node ID generator sequence.
NodeIDGenerator = roachpb.Key(makeKey(SystemPrefix, roachpb.RKey("node-idgen")))
// RangeIDGenerator is the global range ID generator sequence.
Expand Down
1 change: 0 additions & 1 deletion pkg/keys/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ var _ = [...]interface{}{
SystemPrefix,
NodeLivenessPrefix, // "\x00liveness-"
BootstrapVersionKey, // "bootstrap-version"
LegacyDescIDGenerator, // "desc-idgen"
NodeIDGenerator, // "node-idgen"
RangeIDGenerator, // "range-idgen"
StatusPrefix, // "status-"
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/catalog/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestSystemDatabaseSchemaBootstrapVersionBumped(t *testing.T) {

// If you need to update this value (i.e. failed this test), check whether
// you need to bump systemschema.SystemDatabaseSchemaBootstrapVersion too.
const prevSystemHash = "e7498d521cbdf8568fc8e672f99b8e8014a843b5ac73dfc5775890e37f44d0a2"
const prevSystemHash = "a91452d35e2d34a35a5822ac5d35589f19d80a7926d617a4fca1347b438c5999"
_, curSystemHash := GetAndHashInitialValuesToString(0 /* tenantID */)

if prevSystemHash != curSystemHash {
Expand Down
7 changes: 0 additions & 7 deletions pkg/sql/catalog/bootstrap/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,6 @@ func (ms MetadataSchema) GetInitialValues() ([]roachpb.KeyValue, []roachpb.RKey)
value := roachpb.Value{}
value.SetInt(int64(ms.FirstNonSystemDescriptorID()))
add(ms.codec.SequenceKey(keys.DescIDSequenceID), value)
if ms.codec.ForSystemTenant() {
// We need to also set the value of the legacy descriptor ID generator
// until clusterversion.V23_1DescIDSequenceForSystemTenant is removed.
legacyValue := roachpb.Value{}
legacyValue.SetInt(int64(ms.FirstNonSystemDescriptorID()))
add(keys.LegacyDescIDGenerator, legacyValue)
}
}
// Generate initial values for the system database's public schema, which
// doesn't have a descriptor.
Expand Down
5 changes: 2 additions & 3 deletions pkg/sql/catalog/bootstrap/testdata/testdata
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
system hash=e7498d521cbdf8568fc8e672f99b8e8014a843b5ac73dfc5775890e37f44d0a2
system hash=a91452d35e2d34a35a5822ac5d35589f19d80a7926d617a4fca1347b438c5999
----
[{"key":"04646573632d696467656e","value":"01c801"}
,{"key":"8b"}
[{"key":"8b"}
,{"key":"8b89898a89","value":"0312450a0673797374656d10011a250a0d0a0561646d696e1080101880100a0c0a04726f6f7410801018801012046e6f646518032200280140004a006a0a08d7843d100218002004"}
,{"key":"8b898b8a89","value":"030a88030a0a64657363726970746f721803200128013a0042270a02696410011a0c08011040180030005014600020003000680070007800800100880100980100422f0a0a64657363726970746f7210021a0c08081000180030005011600020013000680070007800800100880100980100480352710a077072696d61727910011801220269642a0a64657363726970746f72300140004a10080010001a00200028003000380040005a0070027a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e901000000000000000060026a210a0b0a0561646d696e102018200a0a0a04726f6f741020182012046e6f64651803800101880103980100b201130a077072696d61727910001a02696420012800b201240a1066616d5f325f64657363726970746f7210021a0a64657363726970746f7220022802b80103c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880302a80300b00300d00300"}
,{"key":"8b898c8a89","value":"030ac1050a0575736572731804200128013a00422d0a08757365726e616d6510011a0c0807100018003000501960002000300068007000780080010088010098010042330a0e68617368656450617373776f726410021a0c0808100018003000501160002001300068007000780080010088010098010042320a066973526f6c6510031a0c08001000180030005010600020002a0566616c73653000680070007800800100880100980100422c0a07757365725f696410041a0c080c100018003000501a60002000300068007000780080010088010098010048055290010a077072696d617279100118012208757365726e616d652a0e68617368656450617373776f72642a066973526f6c652a07757365725f6964300140004a10080010001a00200028003000380040005a007002700370047a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c80100d00102e00100e90100000000000000005a740a1175736572735f757365725f69645f696478100218012207757365725f69643004380140004a10080010001a00200028003000380040005a007a0408002000800100880100900103980100a20106080012001800a80100b20100ba0100c00100c80100d00101e00100e901000000000000000060036a250a0d0a0561646d696e10e00318e0030a0c0a04726f6f7410e00318e00312046e6f64651803800101880103980100b201240a077072696d61727910001a08757365726e616d651a07757365725f6964200120042804b2012c0a1466616d5f325f68617368656450617373776f726410021a0e68617368656450617373776f726420022802b2011c0a0c66616d5f335f6973526f6c6510031a066973526f6c6520032803b80104c20100e80100f2010408001200f801008002009202009a0200b20200b80200c0021dc80200e00200800300880303a80300b00300d00300"}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/tests/system_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestInitialKeys(t *testing.T) {
var nonDescKeys int
if systemTenant {
codec = keys.SystemSQLCodec
nonDescKeys = 16
nonDescKeys = 15
} else {
codec = keys.MakeSQLCodec(roachpb.MustMakeTenantID(5))
nonDescKeys = 4
Expand Down
3 changes: 1 addition & 2 deletions pkg/sql/tests/testdata/initial_keys
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
initial-keys tenant=system
----
128 keys:
/System/"desc-idgen"
127 keys:
/Table/3/1/1/2/1
/Table/3/1/3/2/1
/Table/3/1/4/2/1
Expand Down