perf: remove two redundant object-store calls in datasets metadata fetch - #1760
Draft
prabhaks wants to merge 1 commit into
Draft
perf: remove two redundant object-store calls in datasets metadata fetch#1760prabhaks wants to merge 1 commit into
prabhaks wants to merge 1 commit into
Conversation
…etch get_manifest_list fetched the base stream.json unconditionally, but on Query/Prism-mode nodes that result was never read since those modes merge every ingestor's stream.json instead. Move the fetch into the branch that actually needs it (Mode::All). get_first_and_latest_event_from_storage awaited its two independent extract_timestamp_for_date calls sequentially. Run them concurrently with try_join! instead. Both are part of the object-store I/O behind POST /api/prism/v1/datasets, which has been observed taking 50s+ on multi-TB, multi-day deployments.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Two small, low-risk fixes in the object-store I/O behind
POST /api/prism/v1/datasets, which has been observed taking 50s+ to respond on multi-TB, multi-day deployments even on a 44 vCPU / 192GB query node.get_manifest_list(src/query/mod.rs) unconditionally fetched the basestream.jsonviaget_stream_json, but onMode::Query/Mode::Prismnodes that result is never read (those modes merge every ingestor'sstream.jsoninstead viaget_all_stream_jsons). Moved the fetch into theelsebranch that actually needs it (Mode::All).get_first_and_latest_event_from_storage(src/storage/object_storage.rs) awaited its two independentextract_timestamp_for_datecalls sequentially. Replaced withtokio::try_join!to run them concurrently, matching the existingtokio::join!pattern already used one call up the stack inget_prism_logstream_info.Both changes are behavior-preserving on the success path (same I/O, fewer/faster round trips). Two notes worth flagging for review:
get_manifest_listchange means a failed/corrupt basestream.jsonon a Query-mode node no longer short-circuits the whole call — it now proceeds toget_all_stream_jsonsinstead, which can succeed where the old code would fail. This seems like a desirable side effect but is a real change in failure-path behavior, not just a speedup./datasetslatency (bundles stats/retention/hottier/info/counts/query per stream); the dominant cost — a manifest-list scan that's unbounded by stream history when no retention policy is configured — needs a larger catalog-level change and is intentionally not part of this PR. Happy to open a separate issue for that once there's an associated tracking issue for this one (the Parseable team mentioned they'd be opening one).Test plan
cargo test --lib— 426 passed, 0 failed (full existing suite, no regressions)cargo fmt --check— cleancargo clippy --lib— clean