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

sstable: remove global seq num property #3310

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

RaduBerinde
Copy link
Member

This PR is only for the top commit (the rest is #3297).

sstable: remove global seq num property

This change removes the "global seq num" sstable property and instead
passes it to iterators, as a SyntheticSeqNum. This cleans up a lot
of the code that manipulated the global seq num in the reader and
allows the same external file backing to be shared.

As part of this change, we create a new struct IterTransforms and
move the synthetic suffix as well as hideObsoletePoints to this
struct. This cleans up the call sites, and allows easily adding more
transforms in the future (e.g prefix replacement).

We add a method on FileMetadata that generates the proper
IterTransforms for that table.

@RaduBerinde RaduBerinde requested review from itsbilal, msbutler and a team February 16, 2024 15:38
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde
Copy link
Member Author

We will be able to move PrefixReplacement from vState to IterTransforms as well, I just didn't want to tackle it in the same PR.

@RaduBerinde RaduBerinde force-pushed the seq-num-reader branch 2 times, most recently from d1ab47f to 3403bf8 Compare February 19, 2024 19:11
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.

Nice! :lgtm:

Sorry for the delay

Reviewed 7 of 7 files at r1, 57 of 57 files at r4, 9 of 10 files at r5, 17 of 55 files at r6, all commit messages.
Reviewable status: 27 of 65 files reviewed, all discussions resolved (waiting on @itsbilal and @msbutler)

@RaduBerinde
Copy link
Member Author

TFTR!

This change removes the "global seq num" sstable property and instead
passes it to iterators, as a `SyntheticSeqNum`. This cleans up a lot
of the code that manipulated the global seq num in the reader and
allows the same external file backing to be shared.

As part of this change, we create a new struct `IterTransforms` and
move the synthetic suffix as well as `hideObsoletePoints` to this
struct. This cleans up the call sites, and allows easily adding more
transforms in the future (e.g prefix replacement).

We add a method on `FileMetadata` that generates the proper
`IterTransforms` for that table.
@RaduBerinde RaduBerinde merged commit 2b9ea0c into cockroachdb:master Feb 22, 2024
10 of 11 checks passed
@RaduBerinde RaduBerinde deleted the seq-num-reader branch February 22, 2024 18:50
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