roachpb: add lock table metadata structures#76611
roachpb: add lock table metadata structures#76611craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
591d362 to
a6e8aa4
Compare
5e6fc00 to
87790bc
Compare
686f785 to
a85db7b
Compare
nvb
left a comment
There was a problem hiding this comment.
Reviewed 12 of 12 files at r1, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @AlexTalks)
pkg/kv/kvserver/concurrency/lock/lock_waiter.proto, line 22 at r1 (raw file):
// KeyAccessType represents the type of operation that a transaction holding or // waiting on a lock intends to carry out, once necessary locks are acquired. enum KeyAccessType {
I think this can be replaced by the Strength enum. Currently, we only support two strengths, None (which maps to read-only here) and Exclusive (which maps to read-write here).
pkg/kv/kvserver/concurrency/lock/lock_waiter.proto, line 31 at r1 (raw file):
// LockWaiter represents a transaction (or non-transactional operation) that is // waiting in the wait queue of readers or writers on an individual lock. message LockWaiter {
nit: this package is called lock, so we can call this message Waiter {. There's a part of the style guide we use that talks about package name "stuttering", though I'm having trouble finding it.
pkg/kv/kvserver/concurrency/lock/locking.go, line 29 at r1 (raw file):
// SafeValue implements redact.SafeValue. func (Durability) SafeValue() {}
Want to do the same for Strength sine you're here?
pkg/roachpb/data.proto, line 558 at r1 (raw file):
bytes key = 2 [(gogoproto.casttype) = "Key"]; // The metadata on the current lock holder, or nil if the lock is not held. LockAcquisition lock_holder = 3;
I think we decided that we should inline the txn and durability fields, since we don't need the LockAcquisition's Span and that message is used in a slightly different context. Or am I misremembering?
pkg/roachpb/data.proto, line 562 at r1 (raw file):
google.protobuf.Duration hold_duration = 4 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // The queue of readers and writers currently waiting on the lock.
Let's note the order of this list, or mention that the order is arbitrary.
pkg/roachpb/method.go, line 100 at r1 (raw file):
// aborting it. RecoverTxn // QueryLocks requests the current state of concurrency control's lock table.
I don't think we meant to include this in this PR.
nvb
left a comment
There was a problem hiding this comment.
Sorry, didn't mean to mark this as approved quite yet 😃
a85db7b to
305c68c
Compare
AlexTalks
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten)
pkg/roachpb/method.go, line 100 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
I don't think we meant to include this in this PR.
I did, though it was an artifact of an earlier version of the PR in which I included all API/proto updates in the same change (and running a generate build is very slow)
305c68c to
7d6fdb7
Compare
nvb
left a comment
There was a problem hiding this comment.
Reviewed 8 of 9 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @AlexTalks)
|
bors r+ |
|
Build failed (retrying...): |
76611: roachpb: add lock table metadata structures r=AlexTalks a=AlexTalks This change adds the protobuf structures, as well as the method, needed to capture the state of a replica's lock table. This is part of the work coming out of #75541, and is needed to be able to implement the `QueryLocks` RPC. Release note: None 77159: roachtest/tests: move prometheus client interface to separate package r=irfansharif a=ajwerner This way mockgen does not depend on the `roachtest/tests` package. Touches #76851. Release justification: non-production code change Release note: None 77301: loqrecovery: fix json field name in replica info file r=erikgrinaker a=aliher1911 Previously protobuf used camelcase name for repeated field for descriptor change. This was wrong as it was not parsed correctly by marshaller. This fix adds explicit name to proto specification to avoid default name generation. Release justification: This change is low risk as it fixes a bug in new functionality. Release note: None Fixes #77282 Co-authored-by: Alex Sarkesian <sarkesian@cockroachlabs.com> Co-authored-by: Andrew Werner <awerner32@gmail.com> Co-authored-by: Oleg Afanasyev <oleg@cockroachlabs.com>
|
Build failed (retrying...): |
|
bors r- this doesn't pass CI, needs more generation |
|
Canceled. |
7d6fdb7 to
80a514e
Compare
f88539c to
f4f3095
Compare
|
bors r+ |
|
👎 Rejected by PR status |
This change adds the protobuf structures, as well as the method, needed to capture the state of a replica's lock table. This is part of the work coming out of cockroachdb#75541, and is needed to be able to implement the `QueryLocks` RPC. Release justification: (Category 2) The structures created here are entirely new, for the purposes of observability, and do not represent a risk to any existing code or functionality. Release note: None
f4f3095 to
f4784bd
Compare
|
bors r+ |
|
Build failed (retrying...): |
|
Build succeeded: |
This change adds the protobuf structures, as well as the method, needed
to capture the state of a replica's lock table. This is part of the
work coming out of #75541, and is needed to be able to implement the
QueryLocksRPC.Release justification: (Category 2) The structures created here are
entirely new, for the purposes of observability, and do not represent a
risk to any existing code or functionality.
Release note: None