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

internal/rangekey: remove ForeignSSTTransformer #2782

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

itsbilal
Copy link
Member

@itsbilal itsbilal commented Aug 1, 2023

Tests in #2698 combined with TestIngestShared caught that we
were not returning range keys in the order expected by other internal
iterators when reading from a foreign sstable. This change removes
the ForeignSSTTransformer as it's no longer necessary given
all range keys are emitted at the ingestion sequence number.

@itsbilal itsbilal requested review from raggar and a team August 1, 2023 21:42
@itsbilal itsbilal self-assigned this Aug 1, 2023
@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.

Do we have metamorphic test coverage that should have caught this?

Is this ForeignSSTTransformer still necessary? I thought that we could use ordinary ingest global seqnum replacement for range keys now?

Reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @RahulAggarwal1016)

Tests in cockroachdb#2698 combined with `TestIngestShared` caught that we
were not returning range keys in the order expected by other internal
iterators when reading from a foreign sstable. This change removes
the ForeignSSTTransformer as it's no longer necessary given
all range keys are emitted at the ingestion sequence number.
@itsbilal
Copy link
Member Author

itsbilal commented Aug 1, 2023

@jbowens Yes, metamorphic testing of foreign sstable iterators would have caught this, so #2711 is probably the one to wait for.

And you're right, we don't need the coalescing logic anymore. There was one concern around excess rangekeydels/unsets being emitted due to snapshots (because the obsolete key kind logic doesn't really apply here), but I don't think it should functionally change anything given all keys in the sstable will have the same sequence number. I've changed this PR to just remove ForeignSSTTransformer.

@itsbilal itsbilal changed the title internal/rangekey: Fix sort of range keys in foreign sstable iterators internal/rangekey: remove ForeignSSTTransformer Aug 1, 2023
@raggar
Copy link
Contributor

raggar commented Aug 2, 2023

lgtm

@itsbilal
Copy link
Member Author

itsbilal commented Aug 2, 2023

TFTR!

@itsbilal itsbilal merged commit 42d81d2 into cockroachdb:master Aug 2, 2023
9 checks passed
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 3 files reviewed, 1 unresolved discussion


internal/rangekey/coalesce.go line 412 at r2 (raw file):

				fallthrough
			case 6:
				if seqNum != base.SeqNumForLevel(f.Level) {

We can now also update the ingestion code path to set normal sequence numbers for shared files (but in an order that respects their levels) and remove base.SeqNumForLevel, base.SeqNumL5, etc, right?

itsbilal added a commit to itsbilal/pebble that referenced this pull request Jan 2, 2024
This change updates the virtual sstable range key iterator to
hide obsolete range keys for shared ingested files. It does
this by reusing the ForeignSSTTransformer that was removed
in cockroachdb#2782.

This change also cleans up some dangling references to the older
`isForeign` way of determining whether to hide obsolete keys,
in lieu of the newer isSharedIngested approach to address
boomerang shared files.

Fixes cockroachdb#3174.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Jan 3, 2024
This change updates the virtual sstable range key iterator to
hide obsolete range keys for shared ingested files. It does
this by reusing the ForeignSSTTransformer that was removed
in cockroachdb#2782.

This change also cleans up some dangling references to the older
`isForeign` way of determining whether to hide obsolete keys,
in lieu of the newer isSharedIngested approach to address
boomerang shared files.

Fixes cockroachdb#3174.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Jan 3, 2024
This change updates the virtual sstable range key iterator to
hide obsolete range keys for shared ingested files. It does
this by reusing the ForeignSSTTransformer that was removed
in cockroachdb#2782.

This change also cleans up some dangling references to the older
`isForeign` way of determining whether to hide obsolete keys,
in lieu of the newer isSharedIngested approach to address
boomerang shared files.

Fixes cockroachdb#3174.
itsbilal added a commit to itsbilal/pebble that referenced this pull request Jan 3, 2024
This change updates the virtual sstable range key iterator to
hide obsolete range keys for shared ingested files. It does
this by reusing the ForeignSSTTransformer that was removed
in cockroachdb#2782.

This change also cleans up some dangling references to the older
`isForeign` way of determining whether to hide obsolete keys,
in lieu of the newer isSharedIngested approach to address
boomerang shared files.

Fixes cockroachdb#3174.
itsbilal added a commit that referenced this pull request Jan 3, 2024
This change updates the virtual sstable range key iterator to
hide obsolete range keys for shared ingested files. It does
this by reusing the ForeignSSTTransformer that was removed
in #2782.

This change also cleans up some dangling references to the older
`isForeign` way of determining whether to hide obsolete keys,
in lieu of the newer isSharedIngested approach to address
boomerang shared files.

Fixes #3174.
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.

4 participants