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

db: genericize rangeDel{Cache,Frags} into keySpan{Cache,Frags} #1356

Merged
merged 1 commit into from
Nov 1, 2021

Conversation

jbowens
Copy link
Collaborator

@jbowens jbowens commented Oct 28, 2021

Rename the memtable's rangeDelCache and rangeDelFrags types to
keySpanCache and keySpanFrags so they may be used for caching range
key fragments too.

In addition to the pure renames, I made a small refactor to decouple the
dependency on memTable.tombstones by adding a pointer to the skiplist
in a keySpanCache field.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jbowens)


mem_table.go, line 371 at r1 (raw file):

		return nil
	}
	return frags.get(c.skl, c.cmp, c.formatKey)

Can't the code in this method extract these from m like the callee used to do, and then call frags.get. I am trying to understand why we need the member variables in keySpanCache.

Or is this just the first step in the refactor and get will eventually not take a memTable parameter. Should it be removed now itself, since it is unused?

Rename the memtable's `rangeDelCache` and `rangeDelFrags` types to
`keySpanCache` and `keySpanFrags` so they may be used for caching range
key fragments too.

In addition to the pure renames, I made a small refactor to decouple the
dependency on `memTable.tombstones` by adding a pointer to the skiplist
to a `keySpanCache` field.
Copy link
Collaborator Author

@jbowens jbowens 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: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @sumeerbhola)


mem_table.go, line 371 at r1 (raw file):

Previously, sumeerbhola wrote…

Can't the code in this method extract these from m like the callee used to do, and then call frags.get. I am trying to understand why we need the member variables in keySpanCache.

Or is this just the first step in the refactor and get will eventually not take a memTable parameter. Should it be removed now itself, since it is unused?

Oops, yeah, I forgot to remove the memTable parameter when extracting this change from another branch. Thanks :)

Copy link
Collaborator

@sumeerbhola sumeerbhola 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: all files reviewed, 1 unresolved discussion (waiting on @sumeerbhola)

Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

TFTR!

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @sumeerbhola)

@jbowens jbowens merged commit 7369c45 into cockroachdb:master Nov 1, 2021
@jbowens jbowens deleted the keySpanCache branch November 1, 2021 15:16
@jbowens jbowens mentioned this pull request Nov 30, 2021
29 tasks
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