Introduce SplitId(Arc<str>) newtype, confine Ulid to split id generation#6564
Draft
fulmicoton-dd wants to merge 1 commit into
Draft
Introduce SplitId(Arc<str>) newtype, confine Ulid to split id generation#6564fulmicoton-dd wants to merge 1 commit into
fulmicoton-dd wants to merge 1 commit into
Conversation
68bd42d to
2a13d2f
Compare
Replace the `pub type SplitId = String` alias with an opaque `SplitId(Arc<str>)` newtype so that no code outside of split id generation depends on the internal structure of a split id. This is the first step towards adding a random prefix to split ids (to spread S3 read load across prefixes), keeping that future change localized to the generator. The newtype is serde-transparent, so on-disk and wire representations are unchanged (backward compatible). It is adopted by SplitMetadata, the searcher split cache (where Ulid was used as an opaque key) and the indexing split store registry. Wire/proto types, search-internal hit tracking, CLI args and id-list helpers feeding proto requests stay String. After this change ulid::Ulid is referenced for split ids in only two places: - new_split_id(), the generation site - a temporary shim in the indexing split cache that recovers a split's creation time from the trailing ULID of its id, tolerant of a future random prefix. This store is slated for removal with the compactor service.
2a13d2f to
2d30d2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the
pub type SplitId = Stringalias with an opaqueSplitId(Arc<str>)newtype so that no code outside of split id generation depends on the internal structure of a split id. This is the first step towards adding a random prefix to split ids (to spread S3 read load across prefixes), keeping that future change localized to the generator.The newtype is serde-transparent, so on-disk and wire representations are unchanged (backward compatible). It is adopted by SplitMetadata, the searcher split cache (where Ulid was used as an opaque key) and the indexing split store registry. Wire/proto types, search-internal hit tracking, CLI args and id-list helpers feeding proto requests stay String.
After this change ulid::Ulid is referenced for split ids in only two places:
Description
Describe the proposed changes made in this PR.
How was this PR tested?
Describe how you tested this PR.