Skip to content

Commit

Permalink
sql: disable strict gc ttl enforcement in schema changer test
Browse files Browse the repository at this point in the history
Before this change, the TestRaceWithBackfill test would add a zone
config to force garbage collection to happen frequently, however this
could cause a race between batch timestamps and garbage collection
thresholds. This change adds a call to `DisableGCTTLStrictEnforcement`,
which is supposed to be called before updating the zone config with
`AddImmediateGCZoneConfig` for testing purposes.

Epic: None
Fixes: #104655

Release note: None
  • Loading branch information
rharding6373 committed Jun 16, 2023
1 parent 6d845fc commit c602190
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/sql/schema_changer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ CREATE UNIQUE INDEX vidx ON t.test (v);
t.Fatal(err)
}
tableDesc := desctestutils.TestingGetPublicTableDescriptor(kvDB, keys.SystemSQLCodec, "t", "test")
// Disable strict GC TTL enforcement so that we can use AddImmediateGCZoneConfig.
defer sqltestutils.DisableGCTTLStrictEnforcement(t, sqlDB)()
// Add a zone config for the table so that garbage collection happens rapidly.
if _, err := sqltestutils.AddImmediateGCZoneConfig(sqlDB, tableDesc.GetID()); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit c602190

Please sign in to comment.