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

TableInfo: Return valid Left key #1309

Closed
wants to merge 1 commit into from
Closed

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Apr 17, 2020

TableInfo function returns table boundaries. This is used in dgraph to calculate tablet size. As seen in issue hypermodeinc/dgraph#5026, badger could return !badger!head or !badger!move keys as the start of the table. These are valid start keys for badger but they're invalid for dgraph.
This PR changes TableInfo function so that we return only valid table start. For a table which contains the following keys

!badger!Head!
!badger!Move!...
!badger!Move!...
a
b
za

The valid starting key (left key) should be a and the end key should be za.


This change is Reviewable

@jarifibrahim jarifibrahim requested a review from a team April 17, 2020 11:26

// Create copies of smallest and biggest.
smallest = append(smallest, t.Smallest()...)
biggest = append(biggest, t.Biggest()...)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There could be a table with only badgerPrefix keys. What should we do in that case? Skip the table?

Copy link
Contributor

@gja gja 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 2 files reviewed, 2 unresolved discussions (waiting on @ashish-goswami, @jarifibrahim, and @manishrjain)


levels_test.go, line 580 at r1 (raw file):

		createAndOpen(db, kv, 1)

		// Without key count.

split this with t.Run() ?

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

Don't need this PR.

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @ashish-goswami, @jarifibrahim, and @manishrjain)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants