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: don't use internal types in ScanInternal #2635

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

itsbilal
Copy link
Contributor

This change updates the ScanInternal function signature to not use the internal keyspan.Key type. Instead we use the new InternalRangeKey type alias that exports it.

Also update the pointCollapsingIter to just call SeekGE in NextPrefix instead of panicking.

Necessary for cockroachdb/cockroach#103028.

@itsbilal itsbilal requested a review from a team June 14, 2023 15:32
@itsbilal itsbilal self-assigned this Jun 14, 2023
@itsbilal itsbilal requested a review from sumeerbhola June 14, 2023 15:32
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

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


scan_internal.go line 851 at r1 (raw file):

// InternalRangeKey is a type alias that exports keyspan.Key, for use with
// ScanInternal. Has a helper method to decode the Kind of the trailer.
type InternalRangeKey = keyspan.Key

You can use the rangekey.Key type that already reexports keyspan.Key:

type Key = keyspan.Key

This change updates the ScanInternal function signature
to not use the internal keyspan.Key type. Instead we use
the rangekey.Key type alias that exports it.

Also update the pointCollapsingIter to just call SeekGE
in NextPrefix instead of panicking.

Necessary for cockroachdb/cockroach#103028.
@itsbilal itsbilal force-pushed the disagg-replicate-misc-fixes branch from c05418d to 16e353f Compare June 14, 2023 17:15
Copy link
Contributor Author

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

TFTR!

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @jbowens and @sumeerbhola)


scan_internal.go line 851 at r1 (raw file):

Previously, jbowens (Jackson Owens) wrote…

You can use the rangekey.Key type that already reexports keyspan.Key:

type Key = keyspan.Key

Done.

Copy link
Collaborator

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

:lgtm:

Reviewed 3 of 4 files at r2, all commit messages.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @sumeerbhola)

@itsbilal itsbilal merged commit 3726f55 into cockroachdb:master Jun 14, 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