Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
131369: roachtest: set timeout in MR costfuzz, unoptimized-query-oracle r=rytaft a=michae2

We weren't setting a couple of session variables on the second connection opened for multi-region costfuzz and
unoptimized-query-oracle, including statement_timeout.

Fixes: #131147
Fixes: #131153
Fixes: #131166
Fixes: #131344

Release note: None

131431: license: change Cockroach Labs, Inc to The Cockroach Authors r=celiala a=jlinder

In pkg/raft, for the files we have changed, adjust the license headers from "Cockroach Labs, Inc." to "The Cockroach Authors".

Part of RE-658

Release note: none

Co-authored-by: Michael Erickson <[email protected]>
Co-authored-by: James H. Linder <[email protected]>
  • Loading branch information
3 people committed Sep 26, 2024
3 parents a9a171f + 0bf75ff + 2f8f0d3 commit b5e8f81
Show file tree
Hide file tree
Showing 69 changed files with 158 additions and 153 deletions.
39 changes: 22 additions & 17 deletions pkg/cmd/roachtest/tests/query_comparison_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,34 @@ func runOneRoundQueryComparison(
fmt.Fprint(failureLog, "\n")
}

connSetup := func(conn *gosql.DB) {
setStmtTimeout := fmt.Sprintf("SET statement_timeout='%s';", statementTimeout.String())
t.Status("setting statement_timeout")
t.L().Printf("statement timeout:\n%s", setStmtTimeout)
if _, err := conn.Exec(setStmtTimeout); err != nil {
t.Fatal(err)
}
logStmt(setStmtTimeout)

setUnconstrainedStmt := "SET unconstrained_non_covering_index_scan_enabled = true;"
t.Status("setting unconstrained_non_covering_index_scan_enabled")
t.L().Printf("\n%s", setUnconstrainedStmt)
if _, err := conn.Exec(setUnconstrainedStmt); err != nil {
logStmt(setUnconstrainedStmt)
t.Fatal(err)
}
logStmt(setUnconstrainedStmt)
}

node := 1
conn := c.Conn(ctx, t.L(), node)

rnd, seed := randutil.NewTestRand()
t.L().Printf("seed: %d", seed)
t.L().Printf("setupName: %s", qct.setupName)

connSetup(conn)

if qct.setupName == "workload-replay" {

logTest := func(logStr string, logType string) {
Expand Down Expand Up @@ -309,23 +330,6 @@ func runOneRoundQueryComparison(
}
}

setStmtTimeout := fmt.Sprintf("SET statement_timeout='%s';", statementTimeout.String())
t.Status("setting statement_timeout")
t.L().Printf("statement timeout:\n%s", setStmtTimeout)
if _, err := conn.Exec(setStmtTimeout); err != nil {
t.Fatal(err)
}
logStmt(setStmtTimeout)

setUnconstrainedStmt := "SET unconstrained_non_covering_index_scan_enabled = true;"
t.Status("setting unconstrained_non_covering_index_scan_enabled")
t.L().Printf("\n%s", setUnconstrainedStmt)
if _, err := conn.Exec(setUnconstrainedStmt); err != nil {
logStmt(setUnconstrainedStmt)
t.Fatal(err)
}
logStmt(setUnconstrainedStmt)

conn2 := conn
node2 := 1
if qct.isMultiRegion {
Expand All @@ -336,6 +340,7 @@ func runOneRoundQueryComparison(
node2 = rnd.Intn(qct.nodeCount-1) + 2
t.Status(fmt.Sprintf("running some queries from node %d with conn1 and some queries from node %d with conn2", node, node2))
conn2 = c.Conn(ctx, t.L(), node2)
connSetup(conn2)
}

// Initialize a smither that generates only INSERT and UPDATE statements with
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/bootstrap.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/confchange/confchange.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/confchange/datadriven_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/confchange/quick_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/confchange/restore.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/confchange/restore_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/example_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/interaction_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/log.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/log_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/log_unstable.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/log_unstable_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/node.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/node_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/node_util_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2022 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/quorum/bench_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/quorum/datadriven_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/quorum/joint.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/quorum/majority.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/quorum/quick_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/quorum/quorum.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raft.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raft_flow_control_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raft_paper_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raft_snap_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raft_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raftpb/confchange.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raftpb/confstate.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raftpb/confstate_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/raftpb/raft_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2021 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/rafttest/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/rafttest/interaction_env.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/rafttest/interaction_env_handler.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/rafttest/interaction_env_handler_add_nodes.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/rafttest/interaction_env_handler_deliver_msgs.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/rafttest/interaction_env_handler_forget_leader.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2023 The etcd Authors
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2022 The etcd Authors
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2022 The etcd Authors
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/raft/rafttest/interaction_env_handler_process_ready.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This code has been modified from its original form by Cockroach Labs, Inc.
// All modifications are Copyright 2024 Cockroach Labs, Inc.
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
Expand Down
Loading

0 comments on commit b5e8f81

Please sign in to comment.