persist: rip lgbytes/lgalloc out of blob and arrow paths#36307
Open
antiguru wants to merge 1 commit intoMaterializeInc:mainfrom
Open
persist: rip lgbytes/lgalloc out of blob and arrow paths#36307antiguru wants to merge 1 commit intoMaterializeInc:mainfrom
antiguru wants to merge 1 commit intoMaterializeInc:mainfrom
Conversation
Lgalloc is disabled in practice, so the memcpy from SDK `Bytes` (azure)
or arrow `Buffer`s into freshly-allocated `MetricsRegion`s falls back to
the heap and is pure overhead. Stream SDK `Bytes` straight into
`SegmentedBytes` for azure and stop reallocating arrow buffers. Keep
the parquet null-buffer workaround in `realloc_data` (now `rebuild_data`)
since it's independent of lgalloc.
Removes:
* `LgBytesMetrics` and `MetricsRegion` from `mz_ore::lgbytes` (delete the
whole module).
* `S3BlobMetrics::lgbytes`.
* `ColumnarMetrics::{lgbytes_arrow, cfg, is_cc_active}` and the
associated constructor params.
* `BlobConfig::try_from`'s `cfg` param, `AzureBlobConfig`'s `cfg` field,
and the `persist_enable_arrow_lgalloc_{cc,noncc}_sizes` dyncfgs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DAlperin
approved these changes
Apr 28, 2026
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.
Lgalloc is disabled in practice, so the memcpy from SDK `Bytes` (azure) or arrow `Buffer`s into freshly-allocated `MetricsRegion`s falls back to the heap and is pure overhead.
This PR streams SDK `Bytes` straight into `SegmentedBytes` for the azure get path and stops reallocating arrow buffers in the parquet decode path.
The parquet null-buffer workaround stays (now in `rebuild_data`); it's independent of lgalloc.
Follow-up to #36305 which did the same for S3.
Motivation
Reduces CPU and allocator pressure on every persist read.
Tips for reviewer
The behavior changes are in `fetch_chunk` (`src/persist/src/azure.rs`) and `rebuild_data`/`realloc_buffer` (`src/persist/src/indexed/columnar/arrow.rs`).
Everything else is dead-code removal that follows: `mz_ore::lgbytes` module is deleted, `LgBytesMetrics` and `MetricsRegion` go away, and the now-unused `cfg`/`is_cc_active` plumbing in `ColumnarMetrics`, `AzureBlobConfig`, and `BlobConfig::try_from` is dropped.
Checklist