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

kvserver: use messages on NotLeaseholderErrors everywhere #56334

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

andreimatei
Copy link
Contributor

NLHE permits custom messages in it, but the field was rarely used. This
patch makes every instance where we instantiate the error provide a
message, since this error comes from a wide variety of conditions.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

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_strong:

Reviewed 4 of 4 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @andreimatei)


pkg/kv/kvserver/replica_application_result.go, line 217 at r1 (raw file):

			r.store.StoreID(),
			r.mu.state.Desc,
			"request's timestamp below closed timestamp",

Aren't we setting this two lines down? Maybe just move that message (which is a little better) in here?


pkg/kv/kvserver/replica_range_lease.go, line 1101 at r1 (raw file):

					log.VErrEventf(ctx, 2, "lease acquisition failed: %s", ctx.Err())
					return roachpb.NewError(newNotLeaseHolderError(nil, r.store.StoreID(), r.Desc(),
						"lease acquisition canceled"))

maybe add "because context canceled" to differentiate with next message.


pkg/kv/kvserver/replica_range_lease.go, line 1105 at r1 (raw file):

					llHandle.Cancel()
					return roachpb.NewError(newNotLeaseHolderError(nil, r.store.StoreID(), r.Desc(),
						"lease acquisition cancled because node is stopping"))

canceled

NLHE permits custom messages in it, but the field was rarely used. This
patch makes every instance where we instantiate the error provide a
message, since this error comes from a wide variety of conditions.

Release note: None
Copy link
Contributor Author

@andreimatei andreimatei 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! 1 of 0 LGTMs obtained


pkg/kv/kvserver/replica_application_result.go, line 217 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Aren't we setting this two lines down? Maybe just move that message (which is a little better) in here?

done


pkg/kv/kvserver/replica_range_lease.go, line 1101 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

maybe add "because context canceled" to differentiate with next message.

done


pkg/kv/kvserver/replica_range_lease.go, line 1105 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

canceled

done

Copy link
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

bors r+

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

@craig
Copy link
Contributor

craig bot commented Nov 12, 2020

This PR was included in a batch that was canceled, it will be automatically retried

@craig
Copy link
Contributor

craig bot commented Nov 12, 2020

Build succeeded:

@craig craig bot merged commit a5e67b6 into cockroachdb:master Nov 12, 2020
@andreimatei andreimatei deleted the nlhe-msg branch December 16, 2021 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants