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/engine: add pebbleIterator support for time-bound iterators #41854

Merged
merged 2 commits into from Oct 23, 2019

Conversation

petermattis
Copy link
Collaborator

Fixes #41743

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Define the Pebble table property collectors in `storage/engine` so they
can be used for more than just writing sstables.

Release note: None
Copy link
Member

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

:lgtm:

Doing string comparisons on big endian encoded timestamps seems a bit unintuitive at first but I assume it's worth it for avoiding two extra timestamp decodes for every table.

Reviewed 2 of 2 files at r1, 6 of 6 files at r3.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajkr and @sumeerbhola)

Copy link
Collaborator Author

@petermattis petermattis left a comment

Choose a reason for hiding this comment

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

TFTR!

Doing string comparisons on big endian encoded timestamps seems a bit unintuitive at first but I assume it's worth it for avoiding two extra timestamp decodes for every table.

I was confused about this as well initially, but decided to stick with this approach as it mirrors what we do on the C++ side.

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

@petermattis petermattis merged commit 183a9e1 into cockroachdb:master Oct 23, 2019
@petermattis petermattis deleted the pmattis/pebble-time-bound branch October 23, 2019 20:06
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.

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


pkg/storage/engine/pebble.go, line 97 at r3 (raw file):

func (t *pebbleTimeBoundPropCollector) Add(key pebble.InternalKey, value []byte) error {
	_, ts, ok := enginepb.SplitMVCCKey(key.UserKey)

are we not doing the write intent metadata handling that is done by TimeBoundTblPropCollector? I remember you had said it was buggy but I can't reconstruct the reason. We won't accurately account for deletions of the metadata so it won't be as tight as it could be but it still seems tighter than using the 0 timestamp. What am I missing?

Copy link
Collaborator Author

@petermattis petermattis 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 (waiting on @ajkr and @sumeerbhola)


pkg/storage/engine/pebble.go, line 97 at r3 (raw file):

Previously, sumeerbhola wrote…

are we not doing the write intent metadata handling that is done by TimeBoundTblPropCollector? I remember you had said it was buggy but I can't reconstruct the reason. We won't accurately account for deletions of the metadata so it won't be as tight as it could be but it still seems tighter than using the 0 timestamp. What am I missing?

Good catch. Tat seems to be missing. This was all just code movement in this PR and I didn't check that this property collector was identical to the C++ one. I'll file an issue.

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.

storage/engine: add pebbleIterator support for time-bound iteration
4 participants