-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
76719: sql: extend resolverQueue to support waiter transactions r=Azhng a=Azhng Reviewer note: only last two commits are relevant --- # First commit sql: add waiter txn id to extended contention event Previously, contention event only include the txnID of the transaction that held the lock (a.k.a. blocking transaction). The txnID of the waiter transaction is missing from the contention event. This commit includes the txnID of the waiter transaction into contention events. Release note: None --- # Second commit sql: extend resolverQueue to resolve waiter txn id Previously, the resovlerQueue used in the contention event store only resolved the txnID of the blocking transaction. This commit, the resolverQueue would also resolve the txnID of the waiting transaction. Release note: None Co-authored-by: Azhng <[email protected]>
- Loading branch information
Showing
18 changed files
with
1,865 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package contention | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/settings" | ||
) | ||
|
||
// TxnIDResolutionInterval is the cluster setting that controls how often the | ||
// Transaction ID Resolution is performed. | ||
var TxnIDResolutionInterval = settings.RegisterDurationSetting( | ||
settings.TenantWritable, | ||
"sql.contention.event_store.resolution_interval", | ||
"the interval at which transaction fingerprint ID resolution is "+ | ||
"performed (set to 0 to disable)", | ||
time.Second*30, | ||
) | ||
|
||
// StoreCapacity is the cluster setting that controls the | ||
// maximum size of the contention event store. | ||
var StoreCapacity = settings.RegisterByteSizeSetting( | ||
settings.TenantWritable, | ||
"sql.contention.event_store.capacity", | ||
"the in-memory storage capacity per-node of contention event store", | ||
64*1024*1024, // 64 MB per node. | ||
).WithPublic() |
Oops, something went wrong.