Skip to content

Commit

Permalink
Merge #99735 #100111
Browse files Browse the repository at this point in the history
99735: sql: remove node_id column from system activity tables r=j82w a=j82w

The ui does not use the node id. Removing the node id aligns with the 
data necessary for the ui and reduces the amount of data being stored.

Epic: none
Part of: #98882

Release note: none

100111: kvserver: deflake `TestRejectedLeaseDoesntDictateClosedTimestamp` r=erikgrinaker a=erikgrinaker

And friends.

In 40cb075 we decoupled the lease duration from the Raft election timeout. Some tests still relied on the election timeout to control lease durations.

Resolves #98938.
Resolves #99639.

Epic: none
Release note: None

Co-authored-by: j82w <[email protected]>
Co-authored-by: Erik Grinaker <[email protected]>
  • Loading branch information
3 people committed Mar 30, 2023
3 parents 4d62f8e + 92719ed + 96de0fc commit 2cdf0da
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 182 deletions.
16 changes: 3 additions & 13 deletions pkg/ccl/logictestccl/testdata/logic_test/cluster_locks_tenant
Original file line number Diff line number Diff line change
Expand Up @@ -179,27 +179,17 @@ testuser DELETE FROM t WHERE (k >= 'b') AND (k < 'x') executing
query TTTTTTBB colnames,retry
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, granted, contended FROM crdb_internal.cluster_locks WHERE table_name='t' AND txn_id='$txn3'
----
database_name schema_name table_name lock_key_pretty lock_strength durability granted contended
test public t /Table/106/1/"a"/0 Exclusive Unreplicated true false
test public t /Table/106/1/"b"/0 Exclusive Unreplicated true true
test public t /Table/106/1/"c"/0 Exclusive Unreplicated true false
test public t /Table/106/1/"l"/0 Exclusive Unreplicated true false
test public t /Table/106/1/"m"/0 Exclusive Unreplicated true false
test public t /Table/106/1/"p"/0 Exclusive Unreplicated true false
test public t /Table/106/1/"s"/0 Exclusive Unreplicated true false
test public t /Table/106/1/"t"/0 Exclusive Unreplicated true false
test public t /Table/106/1/"z"/0 Exclusive Unreplicated true false
database_name schema_name table_name lock_key_pretty lock_strength durability granted contended

query TTTTTTBB colnames
SELECT database_name, schema_name, table_name, lock_key_pretty, lock_strength, durability, granted, contended FROM crdb_internal.cluster_locks WHERE table_name='t' AND txn_id='$txn4'
----
database_name schema_name table_name lock_key_pretty lock_strength durability granted contended
test public t /Table/106/1/"b"/0 Exclusive Unreplicated false true
database_name schema_name table_name lock_key_pretty lock_strength durability granted contended

query I
SELECT count(*) FROM crdb_internal.cluster_locks WHERE table_name = 't'
----
10
0

statement ok
ROLLBACK
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/testdata/doctor/test_examine_cluster
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ debug doctor examine cluster
debug doctor examine cluster
Examining 57 descriptors and 56 namespace entries...
ParentID 100, ParentSchemaID 101: relation "foo" (105): expected matching namespace entry, found none
Examining 16 jobs...
Examining 17 jobs...
ERROR: validation failed
4 changes: 2 additions & 2 deletions pkg/kv/kvserver/client_raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2093,10 +2093,10 @@ func runReplicateRestartAfterTruncation(t *testing.T, removeBeforeTruncateAndReA
},
},
RaftConfig: base.RaftConfig{
// Don't timeout raft leaders or range leases (see the relation between
// RaftElectionTimeoutTicks and RangeLeaseActiveDuration). This test expects
// Don't timeout raft leaders or range leases. This test expects
// tc.Servers[0] to hold the range lease for the range under test.
RaftElectionTimeoutTicks: 1000000,
RangeLeaseDuration: time.Minute,
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kv/kvserver/closed_timestamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,12 @@ func TestClosedTimestampFrozenAfterSubsumption(t *testing.T) {
ServerArgs: base.TestServerArgs{
Settings: cs,
RaftConfig: base.RaftConfig{
// We set the raft election timeout to a small duration. This should
// result in the node liveness duration being ~3.6 seconds. Note that
// We set the raft election timeout to a small duration. Note that
// if we set this too low, the test may flake due to the test
// cluster's nodes frequently missing their liveness heartbeats.
RaftHeartbeatIntervalTicks: 5,
RaftElectionTimeoutTicks: 6,
RangeLeaseDuration: 3 * time.Second,
},
Knobs: base.TestingKnobs{
Server: &server.TestingKnobs{
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/replica_closedts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ func TestRejectedLeaseDoesntDictateClosedTimestamp(t *testing.T) {
RangeLeaseRenewalFraction: -1,
// Also make expiration-based leases last for a long time, as the test
// wants a valid lease after cluster start.
RaftElectionTimeoutTicks: 1000,
RangeLeaseDuration: time.Minute,
},
Knobs: base.TestingKnobs{
Server: &server.TestingKnobs{
Expand Down
12 changes: 6 additions & 6 deletions pkg/sql/catalog/bootstrap/testdata/testdata

Large diffs are not rendered by default.

Loading

0 comments on commit 2cdf0da

Please sign in to comment.