Skip to content

Commit

Permalink
Merge #128579
Browse files Browse the repository at this point in the history
128579: crosscluster/logical: deflake TestRandomTable r=rafiss a=stevendanna

Some rows can only be inserted because of the particular optimization decisions that were made. For example, we've observed multiple cases in which the lack of constant folding while using generic query plans resulted in a replicated insert failure because the query plan without constant folding resulted in an error.

Fixes #127239
Release note: None

Co-authored-by: Steven Danna <[email protected]>
  • Loading branch information
craig[bot] and stevendanna committed Aug 15, 2024
2 parents 67b2617 + 20dd32f commit 4cab40a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
11 changes: 11 additions & 0 deletions pkg/ccl/crosscluster/logical/logical_replication_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,17 @@ func TestRandomTables(t *testing.T) {
runnerA.Exec(t, stmt)
runnerB.Exec(t, stmt)

// TODO(ssd): We have to turn off randomized_anchor_key
// because this, in combination of optimizer difference that
// might prevent CommitInBatch, could result in the replicated
// transaction being too large to commit.
runnerA.Exec(t, "SET CLUSTER SETTING kv.transaction.randomized_anchor_key.enabled=false")

// Workaround for the behaviour described in #127321. This
// ensures that we are generating rows using similar
// optimization decisions to our replication process.
runnerA.Exec(t, "SET plan_cache_mode=force_generic_plan")

numInserts := 20
_, err := randgen.PopulateTableWithRandData(rng,
sqlA, tableName, numInserts, nil)
Expand Down
13 changes: 12 additions & 1 deletion pkg/ccl/crosscluster/logical/udf_row_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestUDFWithRandomTables(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

skip.WithIssue(t, 127321)
skip.WithIssue(t, 127315, "composite types generated by randgen currently unsupported by LDR")
ctx := context.Background()

s, sqlA, sqlB, cleanup := setupTwoDBUDFTestCluster(t)
Expand All @@ -70,6 +70,17 @@ func TestUDFWithRandomTables(t *testing.T) {
runnerB.Exec(t, stmt)
runnerB.Exec(t, fmt.Sprintf(testingUDFAcceptProposedBase, tableName))

// TODO(ssd): We have to turn off randomized_anchor_key
// because this, in combination of optimizer difference that
// might prevent CommitInBatch, could result in the replicated
// transaction being too large to commit.
runnerA.Exec(t, "SET CLUSTER SETTING kv.transaction.randomized_anchor_key.enabled=false")

// Workaround for the behaviour described in #127321. This
// ensures that we are generating rows using similar
// optimization decisions to our replication process.
runnerA.Exec(t, "SET plan_cache_mode=force_generic_plan")

numInserts := 20
_, err := randgen.PopulateTableWithRandData(rng,
sqlA, tableName, numInserts, nil)
Expand Down

0 comments on commit 4cab40a

Please sign in to comment.