forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: add replicated locks to MVCCStats
Fixes cockroachdb#109645. Informs cockroachdb#100193. This commit adds `MVCCStats` for replicated locks. To do so, it first adds a new field to the stats struct, `LockBytes`. `LockBytes` is the encoded size of replicated locks with shared or exclusive strengths, which are stored in the lock table keyspace. The field includes the size of the locks' keys and their values. For historical reasons, the field excludes the size of intent metadata key-values, even though they are also stored in the lock table keyspace. Intent metadata keys are tracked under KeyBytes and their values are tracked under ValBytes. This is not to be confused with the provisional versioned values protected by the intents, which are tracked by the IntentBytes field (and also by KeyBytes and ValBytes). Hence the vague "without their meta keys" comment above. The patch then begins accounting for the contributions of replicated locks to `LockBytes`, `LockCount`, and `LockAge`, of which the second two fields already exist. This accounting is straightforward. The less straightforward part of the patch is MVCC stats computation. Scanning the lock table requires the use of an EngineIterator. To this point, all stats computation has taken place on an MVCCIterator. The patch addresses this by directly scanning the lock table with an EngineIterator (wrapped in a LockTableIterator) during stats computation. Release note: None
- Loading branch information
1 parent
3e30216
commit c44ee5b
Showing
19 changed files
with
525 additions
and
109 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
2 changes: 1 addition & 1 deletion
2
pkg/kv/kvserver/testdata/TestBelowRaftProtosDontChange/RangeAppliedState
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo | ||
---- | ||
14062697193383087404 | ||
2796048770313977431 |
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
Oops, something went wrong.