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

storage: ignore {exclusive,shared} locks in ScanConflictingIntentsForDroppingLatchesEarly #110830

Merged

Conversation

arulajmani
Copy link
Collaborator

ScanConflictingIntentsForDroppingLatchesEarly is called by non-locking read requests to check for conflicts before evaluating. Non-locking reads do not conflict with Exclusive or Shared locks -- so these can be ignored when scanning the lock table. This patch does so, by making use of an appropriately configured LockTableIterator.

Informs #100193

Release note: None

@arulajmani arulajmani requested a review from a team as a code owner September 18, 2023 16:22
@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:

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


pkg/storage/engine.go line 2035 at r1 (raw file):

			return true /* needsIntentHistory */, nil
		}
		v, err := iter.UnsafeValue()

nit: iter.ValueProto avoids one of these error checks, if you want it.


pkg/storage/engine_test.go line 2226 at r1 (raw file):

				err = MVCCAcquireLock(ctx, rw, txnA, lock.Exclusive, keyB, nil /*ms*/, 0 /*maxConflicts*/)
				require.NoError(t, err)
				require.NoError(t, err)

nit: remove this line.

…DroppingLatchesEarly

ScanConflictingIntentsForDroppingLatchesEarly is called by non-locking
read requests to check for conflicts before evaluating. Non-locking
reads do not conflict with Exclusive or Shared locks -- so these can
be ignored when scanning the lock table. This patch does so, by making
use of an appropriately configured `LockTableIterator`.

Informs cockroachdb#100193

Release note: None
@arulajmani arulajmani force-pushed the rl-ignore-repl-locks-drop-latches-early branch from 904edbb to 0c9bbb4 Compare September 18, 2023 16:40
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.

Thanks!

bors r=nvanbenschoten

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


pkg/storage/engine.go line 2035 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

nit: iter.ValueProto avoids one of these error checks, if you want it.

cc: @aayushshah15


pkg/storage/engine_test.go line 2226 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

nit: remove this line.

done.

@craig
Copy link
Contributor

craig bot commented Sep 18, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 18, 2023

Build succeeded:

@craig craig bot merged commit 0b2ced7 into cockroachdb:master Sep 18, 2023
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