Skip to content

kv: include conflicting request information in latch manager traces/logs#115511

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
lyang24:log_conflicting_latch2
Jan 8, 2024
Merged

kv: include conflicting request information in latch manager traces/logs#115511
craig[bot] merged 1 commit intocockroachdb:masterfrom
lyang24:log_conflicting_latch2

Conversation

@lyang24
Copy link
Copy Markdown
Contributor

@lyang24 lyang24 commented Dec 3, 2023

This commit logs latch waiter and latch holder's request information when latch
conflicts. This is achieved by adding batch request derived redact.SafeFormatter
into concurrency.Request and pass it down to latch Guard. Since the Guard struct
embedded the signal struct, we will store store a pointer to the latch guard
in latch struct instead.

Fixes: #114601

Relase note: None

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 3, 2023

Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

I have added a few people who may be able to assist in reviewing:

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-triaged blathers was able to find an owner labels Dec 3, 2023
@blathers-crl blathers-crl bot requested a review from nvb December 3, 2023 06:21
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 338ebdf to 3bdb2d1 Compare December 3, 2023 06:28
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 3, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link
Copy Markdown
Contributor Author

@lyang24 lyang24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/kv/kvserver/concurrency/concurrency_control.go line 438 at r1 (raw file):

	// We store a reference to kvpb.BatchRequest. This is used to enrich logging
	// when latches conflict.
	BatchRequest *kvpb.BatchRequest

probably not good to have duplicates (i.e. two mutable reference of transaction from req.Txn or req.BatchRequest.Txn). However, I think this is a safer change just in case BatchRequest changed downstream.


pkg/kv/kvserver/spanlatch/manager.go line 208 at r1 (raw file):

				latch := &latches[i]
				latch.span = ss[i].Span
				latch.guard = guard

want to careful about potential npe here.
The old model is both latch and guard helds the same location to the signal in memory. In the new model this process become latch -> guard -> signal which requires guards lifetime >= latch's lifetime to avoid nil pointers - I think this statement is true because when latchGuard is releasing the latch also get deleted from the btree first?

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 3bdb2d1 to 638cac7 Compare December 4, 2023 04:09
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 4, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 638cac7 to b13ec82 Compare December 4, 2023 04:10
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 4, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from b13ec82 to f65ed24 Compare December 4, 2023 05:28
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 4, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@lyang24 lyang24 marked this pull request as ready for review December 4, 2023 07:26
@lyang24 lyang24 requested a review from a team as a code owner December 4, 2023 07:26
@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from f65ed24 to bca4dd0 Compare December 12, 2023 08:07
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 12, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link
Copy Markdown
Contributor Author

@lyang24 lyang24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/kv/kvserver/concurrency/testdata/concurrency_manager/shared_locks_latches line 172 at r2 (raw file):

# exclusive_lock(ts) < shared_lock(ts)
new-request name=req10 txn=txn3 ts=9,1
  get key=a str=exclusive

get request with exclusive strength is interesting

@lyang24
Copy link
Copy Markdown
Contributor Author

lyang24 commented Dec 12, 2023

Hi @nvanbenschoten , I rebased this pr to the recent master that reflects the refactor of request safeformat. Do you mind take a look at this pr when you have time?

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 19 files at r1, 18 of 18 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @lyang24)


pkg/kv/kvserver/concurrency/concurrency_control.go line 438 at r1 (raw file):

Previously, lyang24 (Lanqing Yang) wrote…

probably not good to have duplicates (i.e. two mutable reference of transaction from req.Txn or req.BatchRequest.Txn). However, I think this is a safer change just in case BatchRequest changed downstream.

I think this is ok as long as we change this to not be a direct reference to BatchRequest. Instead, we could make this a more narrow interface. For instance, it could just be RequestFormatter redact.SafeFormatter.

#116696 will be helpful for this.


pkg/kv/kvserver/spanlatch/manager.go line 208 at r1 (raw file):

Previously, lyang24 (Lanqing Yang) wrote…

want to careful about potential npe here.
The old model is both latch and guard helds the same location to the signal in memory. In the new model this process become latch -> guard -> signal which requires guards lifetime >= latch's lifetime to avoid nil pointers - I think this statement is true because when latchGuard is releasing the latch also get deleted from the btree first?

signals is embedded in Guard, so the models are actually equivalent in that latch is pointing into memory in the Guard. The primary difference is that now it's pointing at the entire Guard struct instead of just field in it.


pkg/kv/kvserver/spanlatch/manager.go line 88 at r2 (raw file):

// of a single key span.
type latch struct {
	guard      *Guard

nit: let's just call this g.


pkg/kv/kvserver/spanlatch/manager.go line 108 at r2 (raw file):

	w.Printf("%s@%s", la.span, la.ts)
	if la.guard != nil && la.guard.batchRequest != nil {
		w.Printf("[")

Instead of bracketing this, how about:

w.Printf(" for request ")
la.guard.requestFormatter.SafeFormat(w, verb)

pkg/kv/kvserver/concurrency/testdata/concurrency_manager/shared_locks_latches line 172 at r2 (raw file):

Previously, lyang24 (Lanqing Yang) wrote…

get request with exclusive strength is interesting

It is! This is the request type that powers SELECT FOR UPDATE.


pkg/kv/kvserver/spanlatch/manager_test.go line 755 at r2 (raw file):

}

// Unit test the output of latch SafeFormat

Nice test!

nit: // TestLatchStringAndSafeformat tests the output of latch.SafeFormat.

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from bca4dd0 to 1121ff3 Compare December 21, 2023 06:38
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 21, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link
Copy Markdown
Contributor Author

@lyang24 lyang24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for reviewing

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/kv/kvserver/concurrency/concurrency_control.go line 438 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

I think this is ok as long as we change this to not be a direct reference to BatchRequest. Instead, we could make this a more narrow interface. For instance, it could just be RequestFormatter redact.SafeFormatter.

#116696 will be helpful for this.

Yes redact.SafeFormatter is a much better fit will wait for #116696 to merge and update


pkg/kv/kvserver/spanlatch/manager.go line 208 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

signals is embedded in Guard, so the models are actually equivalent in that latch is pointing into memory in the Guard. The primary difference is that now it's pointing at the entire Guard struct instead of just field in it.

Great I learned about Struct Embedding in golang, very cool!

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 1121ff3 to 41c1f29 Compare December 21, 2023 06:44
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 21, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 41c1f29 to 2eb7a7b Compare December 21, 2023 08:38
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 21, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 2eb7a7b to 0264b7f Compare December 21, 2023 17:49
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 21, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jan 3, 2024

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@lyang24
Copy link
Copy Markdown
Contributor Author

lyang24 commented Jan 3, 2024

seems like this pr had a small regression on benchmarks :(.

./benchstat ~/Desktop/master.txt ~/Desktop/mybrach.txt 
goos: darwin
goarch: arm64
                                              │ /Users/lanqing/Desktop/master.txt │ /Users/lanqing/Desktop/mybrach.txt  │
                                              │              sec/op               │   sec/op     vs base                │
LatchManagerReadOnlyMix/size=1-12                                     130.5n ± 4%   144.9n ± 1%  +11.03% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=4-12                                     131.5n ± 2%   145.5n ± 1%  +10.68% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=16-12                                    133.3n ± 3%   143.9n ± 1%   +7.95% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=64-12                                    135.0n ± 2%   145.7n ± 2%   +7.97% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=128-12                                   136.4n ± 1%   144.4n ± 2%   +5.83% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=256-12                                   137.9n ± 1%   146.9n ± 1%   +6.53% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=0-12                           203.5n ± 0%   214.9n ± 3%   +5.63% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=1-12                           186.4n ± 2%   198.2n ± 2%   +6.30% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=4-12                           186.4n ± 2%   197.1n ± 1%   +5.74% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=16-12                          179.0n ± 4%   188.7n ± 1%   +5.39% (p=0.001 n=10)
LatchManagerReadWriteMix/readsPerWrite=64-12                          120.7n ± 4%   130.6n ± 1%   +8.21% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=128-12                         110.6n ± 4%   120.1n ± 2%   +8.50% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=256-12                         104.0n ± 5%   115.2n ± 2%  +10.77% (p=0.000 n=10)
geomean                                                               142.7n        153.7n        +7.71%

                                              │ /Users/lanqing/Desktop/master.txt │ /Users/lanqing/Desktop/mybrach.txt │
                                              │               B/op                │    B/op      vs base               │
LatchManagerReadOnlyMix/size=1-12                                      192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=4-12                                      192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=16-12                                     192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=64-12                                     192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=128-12                                    192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadOnlyMix/size=256-12                                    192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=0-12                            192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=1-12                            192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=4-12                            192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=16-12                           192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=64-12                           192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=128-12                          192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
LatchManagerReadWriteMix/readsPerWrite=256-12                          192.0 ± 0%    208.0 ± 0%  +8.33% (p=0.000 n=10)
geomean                                                                192.0         208.0       +8.33%

                                              │ /Users/lanqing/Desktop/master.txt │ /Users/lanqing/Desktop/mybrach.txt  │
                                              │             allocs/op             │ allocs/op   vs base                 │
LatchManagerReadOnlyMix/size=1-12                                      1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadOnlyMix/size=4-12                                      1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadOnlyMix/size=16-12                                     1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadOnlyMix/size=64-12                                     1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadOnlyMix/size=128-12                                    1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadOnlyMix/size=256-12                                    1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadWriteMix/readsPerWrite=0-12                            1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadWriteMix/readsPerWrite=1-12                            1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadWriteMix/readsPerWrite=4-12                            1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadWriteMix/readsPerWrite=16-12                           1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadWriteMix/readsPerWrite=64-12                           1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadWriteMix/readsPerWrite=128-12                          1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
LatchManagerReadWriteMix/readsPerWrite=256-12                          1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                                1.000        1.000       +0.00%

@lyang24 lyang24 requested a review from nvb January 3, 2024 21:43
@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 8bf4b84 to 510bbad Compare January 4, 2024 20:54
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jan 4, 2024

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for running these benchmarks! A regression of that magnitude is expected and acceptable, given the improvement this has on observability. We're adding 16 bytes (an interface header) to the Guard struct's size.

Reviewed 1 of 13 files at r3, 8 of 9 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @lyang24)


pkg/kv/kvserver/concurrency/concurrency_control.go line 438 at r1 (raw file):

Previously, lyang24 (Lanqing Yang) wrote…

Yes redact.SafeFormatter is a much better fit will wait for #116696 to merge and update

This turned out nicely.


pkg/kv/kvserver/concurrency/concurrency_control.go line 437 at r6 (raw file):

	LockSpans *lockspanset.LockSpanSet

	// The SafeFormatter from batchRequest pointer. This is used to enrich logging

"The SafeFormatter capable of formatting the request."


pkg/kv/kvserver/concurrency/concurrency_control.go line 439 at r6 (raw file):

	// The SafeFormatter from batchRequest pointer. This is used to enrich logging
	// with request level information when latches conflict.
	BaFormatter redact.SafeFormatter

nit: consider switching the name of this field from BaFormatter to BaFmt. And then do the same in the functions where this is passed.


pkg/kv/kvserver/spanlatch/manager.go line 140 at r6 (raw file):

	// checking of conflicts, and waiting.
	snap        *snapshot
	baFormatter redact.SafeFormatter

nit: move this up to right below pp.


pkg/kv/kvserver/concurrency/concurrency_manager_test.go line 223 at r6 (raw file):

					LockSpans:              lockSpans,
					PoisonPolicy:           pp,
					BaFormatter:            &ba,

small nit: let's just make ba := &kvpb.BatchRequest{} above.

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 510bbad to a9aa79c Compare January 5, 2024 21:08
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jan 5, 2024

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from a9aa79c to 34fa348 Compare January 5, 2024 21:10
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jan 5, 2024

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link
Copy Markdown
Contributor Author

@lyang24 lyang24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reviewing!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nvanbenschoten)


pkg/kv/kvserver/concurrency/concurrency_manager_test.go line 223 at r6 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

small nit: let's just make ba := &kvpb.BatchRequest{} above.

wow thanks for finding this, I applied to all the related test touched by this commit

@lyang24 lyang24 requested a review from nvb January 5, 2024 21:15
Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 9 files at r7, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @lyang24)


pkg/kv/kvserver/concurrency/concurrency_control.go line 439 at r6 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

nit: consider switching the name of this field from BaFormatter to BaFmt. And then do the same in the functions where this is passed.

Sorry, for parameters and unexported fields (in Guard), we'd want baFmt.


pkg/kv/kvserver/spanlatch/manager_test.go line 749 at r8 (raw file):

// TestSizeOfLatch tests the size of the latch struct.
func TestSizeOfLatch(t *testing.T) {

While we're here, mind adding one of these tests for Guard as well?

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 34fa348 to db13a02 Compare January 5, 2024 22:22
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jan 5, 2024

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link
Copy Markdown
Contributor Author

@lyang24 lyang24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for speedy review i addressed the comments.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nvanbenschoten)

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 9 files at r7, 2 of 2 files at r9, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @lyang24)


pkg/kv/kvserver/concurrency/concurrency_control.go line 439 at r6 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Sorry, for parameters and unexported fields (in Guard), we'd want baFmt.

For function parameters as well (e.g. in newGuard). Variable names are rarely capitalized in Go.

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from db13a02 to d11f713 Compare January 5, 2024 23:15
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jan 5, 2024

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link
Copy Markdown
Contributor Author

@lyang24 lyang24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nvanbenschoten)


pkg/kv/kvserver/concurrency/concurrency_control.go line 439 at r6 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

For function parameters as well (e.g. in newGuard). Variable names are rarely capitalized in Go.

my bad

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Thanks @lyang24! I'll merge this once CI goes green.

Reviewed 3 of 3 files at r10, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @lyang24)

@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from d11f713 to 0bee58b Compare January 6, 2024 08:42
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jan 6, 2024

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

This commit logs latch waiter and latch holder's request information when latch
conflicts. This is achieved by adding redact.SafeFormatter from batch request
into concurrency.Request and pass it down to latch Guard. Since the Guard struct
embedded the signal struct, we will store store a pointer to the latch guard
in latch struct instead.

Fixes: cockroachdb#114601

Relase note: None
@lyang24 lyang24 force-pushed the log_conflicting_latch2 branch from 0bee58b to ba13697 Compare January 6, 2024 19:45
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jan 6, 2024

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@nvb
Copy link
Copy Markdown
Contributor

nvb commented Jan 8, 2024

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 8, 2024

Build succeeded:

@craig craig bot merged commit ba8631a into cockroachdb:master Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-community Originated from the community X-blathers-triaged blathers was able to find an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kv: include conflicting request information in latch manager traces/logs

3 participants