Skip to content

Commit 51460c5

Browse files
authored
Merge pull request cockroachdb#155811 from fqazi/blathers/backport-release-25.3-154879
release-25.3: changefeedccl: deflake TestChangefeedSchemaTTL
2 parents 647fefb + 08ffd5d commit 51460c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/ccl/changefeedccl/changefeed_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6545,6 +6545,7 @@ func TestChangefeedSchemaTTL(t *testing.T) {
65456545
// Create the data table; it will only contain a single row with multiple
65466546
// versions.
65476547
sqlDB.Exec(t, `CREATE TABLE foo (a INT PRIMARY KEY, b STRING)`)
6548+
sqlDB.Exec(t, `CREATE USER joe`)
65486549

65496550
counter := 0
65506551
upsertRow := func() {
@@ -6575,6 +6576,15 @@ func TestChangefeedSchemaTTL(t *testing.T) {
65756576
// table to be deleted, with the middle version being lost to the changefeed.
65766577
forceTableGC(t, s.SystemServer, sqlDB, "system", "descriptor")
65776578

6579+
// Do an unnecessary version bump on the descriptor, which will purge old
6580+
// versions of the descriptor that the lease manager may have cached for
6581+
// historical queries. When schema_locked support is active, the act of
6582+
// detecting polling inside pauseOrResumePolling can cause old versions
6583+
// to be cached. The historical descriptors are cleared everytime a
6584+
// version bump occurs, otherwise this test can flake if the prior versions
6585+
// need to decode a row is already cached.
6586+
waitForSchemaChange(t, sqlDB, "ALTER TABLE foo OWNER TO joe")
6587+
65786588
// Resume our changefeed normally.
65796589
atomic.StoreInt32(&shouldWait, 0)
65806590
resume <- struct{}{}

0 commit comments

Comments
 (0)