Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txnwait: do not require vmodule to log deadlocks in a workload #99315

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

arulajmani
Copy link
Collaborator

Deadlocks in a workload are rare (and bad) enough that they should be logged at the level of Info, instead of under vmodule.

Epic: none

Release note: None

@arulajmani arulajmani requested a review from a team as a code owner March 22, 2023 22:58
@blathers-crl
Copy link

blathers-crl bot commented Mar 22, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

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

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@arulajmani arulajmani added backport-22.1.x backport-23.1.x Flags PRs that need to be backported to 23.1 labels Mar 22, 2023
Copy link
Member

@nvanbenschoten nvanbenschoten 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 @arulajmani)


pkg/kv/kvserver/txnwait/queue.go line 722 at r1 (raw file):

				p1, p2 := pusheePriority, pusherPriority
				if p1 < p2 || (p1 == p2 && bytes.Compare(req.PusheeTxn.ID.GetBytes(), req.PusherTxn.ID.GetBytes()) < 0) {
					log.Infof(

Do you think we should wrap this in an EveryN? Maybe only log it once a second, and otherwise retain the log.VEventf? I think you can continue to use log.VEventf and then use level=0 for the analogous call to log.Infof, but please double-check if you decide to write this like that.

@nvanbenschoten
Copy link
Member

This still seems like a good idea. I imagine we'll thank ourselves for adding in this logging at some point in the future.

Deadlocks in a workload are rare (and bad) enough that they should be
logged at the level of Info, instead of under vmodule.

Epic: none

Release note: None
Copy link
Collaborator Author

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

Better late than never I guess 😅

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


pkg/kv/kvserver/txnwait/queue.go line 722 at r1 (raw file):

I think you can continue to use log.VEventf and then use level=0 for the analogous call to log.Infof, but please double-check if you decide to write this like that.

You're correct; verified that this is indeed how it works.

@nvanbenschoten nvanbenschoten added backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. labels Jun 25, 2024
Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

@arulajmani
Copy link
Collaborator Author

Thanks!

bors r=nvanbenschoten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants