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

kv: add all lock strengths and durabilities to TestLockTableConcurrentRequests #111465

Merged

Conversation

nvanbenschoten
Copy link
Member

Informs #91545.
Informs #100193.

This commit expands TestLockTableConcurrentRequests to support Shared, Exclusive, and Intent locking strength, in addition to both Replicated and Unreplicated locking durabilities. This provides randomized coverage of the lock table with these combinations.

The commit then temporarily disables Shared locks in the test, which occasionally fail with the panic: tryMakeNewDistinguished called with new claimant txn. This is related to #111144, so we can re-enable Shared locks when that issue is resolved.

Release note: None

@nvanbenschoten nvanbenschoten requested a review from a team as a code owner September 28, 2023 23:25
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@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.

:lgtm:

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


pkg/kv/kvserver/concurrency/lock_table_test.go line 747 at r1 (raw file):

		// latch at max timestamp. See
		// https://github.com/cockroachdb/cockroach/issues/102264.
		return spanset.SpanReadOnly, hlc.MaxTimestamp

nit: Should we add a comment explaining why we don't need to duplicate the special case for replicated shared locks here?


pkg/kv/kvserver/concurrency/lock_table_test.go line 1482 at r1 (raw file):

		keys = append(keys, roachpb.Key(string(rune('a'+i))))
	}
	strs := []lock.Strength{lock.None, lock.Shared, lock.Exclusive, lock.Intent}

nit: should we pull this behind a method in locking.go, kind of like we do for isolation levels? I was thinking about it earlier today when looking at TestTxnCoordSenderRetries, but then we switched approaches.

…tRequests

Informs cockroachdb#91545.
Informs cockroachdb#100193.

This commit expands TestLockTableConcurrentRequests to support Shared,
Exclusive, and Intent locking strength, in addition to both Replicated
and Unreplicated locking durabilities. This provides randomized coverage
of the lock table with these combinations.

The commit then temporarily disables Shared locks in the test, which
occasionally fail with the panic: `tryMakeNewDistinguished called with new claimant txn`.
This is related to cockroachdb#111144, so we can re-enable Shared locks when that issue
is resolved.

Release note: None
@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/lockTableRandomLocks branch from 086d7f1 to 1448128 Compare September 29, 2023 01:38
Copy link
Member Author

@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.

TFTR!

bors r+

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


pkg/kv/kvserver/concurrency/lock_table_test.go line 747 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

nit: Should we add a comment explaining why we don't need to duplicate the special case for replicated shared locks here?

Done.


pkg/kv/kvserver/concurrency/lock_table_test.go line 1482 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

nit: should we pull this behind a method in locking.go, kind of like we do for isolation levels? I was thinking about it earlier today when looking at TestTxnCoordSenderRetries, but then we switched approaches.

I considered the same thing, but it wasn't clear what we wanted to do with lock.Update. Should we just exclude it? I'll leave like this for now, but we can reconsider in a targetted PR if we think it could clean up some code.

@craig
Copy link
Contributor

craig bot commented Sep 29, 2023

Build succeeded:

@craig craig bot merged commit 27e7c16 into cockroachdb:master Sep 29, 2023
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/lockTableRandomLocks branch September 29, 2023 02:29
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