You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "linliu-code (via GitHub)" <gi...@apache.org> on 2026/08/19 07:59:51 UTC

[PR] perf(core): bound the merge chunk rather than moving the merge off the executor [hudi-rs]

linliu-code opened a new pull request, #689:
URL: https://github.com/apache/hudi-rs/pull/689

   > **Stacked on #688 → #687 → #686 → #682 → #678. Review those first.** This targets `main`, so it shows their commits alongside its own. The delta that belongs to this PR is the last commit: 2 files, +166/-6.
   
   Third and last slice of #685, and it closes the one question the ticket left open. **The answer turned out to be "don't add `spawn_blocking`"** — so this PR is a measurement, a decision, and the bound that makes the decision hold.
   
   ## The question
   
   #685 flagged it itself: a merge map that has spilled probes RocksDB synchronously, and once the merge is a `Stream` (#688) that probe runs on the task polling it rather than on a blocking thread. The ticket's own instruction was to measure before adding `spawn_blocking` for its own sake, "since that would reintroduce a crossing".
   
   ## The measurement
   
   `spilled_merge_blocking_duration` (ignored; run with `--release --ignored --nocapture`) times one `merge_base_batch` against a 50 000-key log map, with and without the spill engaged:
   
   | chunk rows | no-spill | spilled |
   |---|---|---|
   | 1024 | 0.4 – 1.1 ms | 5.7 – 6.1 ms |
   | 8192 | 2.8 ms | 39 – 42 ms |
   
   **The no-spill leg is the control, and it is what decides the question.** My first version of this benchmark did not have it, and without it the 40 ms figure looks like a spill problem. With it, the spill is a **~6× amplifier on work that is already synchronous and of the same kind**. Gating `spawn_blocking` on `merge_map_spilled()` (already available on the buffer trait) would treat the amplifier and leave a poll that is milliseconds long either way.
   
   Per-chunk CPU work on the polling task is how a scan or join operator behaves. Handing each chunk to a blocking pool would reintroduce the sync/async crossing #686 and #688 removed, and cost a task hop plus a buffer move per chunk, to shave single-digit milliseconds.
   
   ## What the numbers do say
   
   The cost is linear in a chunk's rows. That makes the chunk size the thing bounding how long one poll occupies its executor — and that bound was **inherited, not chosen**: the base read set no batch size, so it came from `parquet`'s own default of 1024 (`parquet-57.3.1`, `arrow_reader/mod.rs:171`, verified rather than assumed). That is a silent bound. A larger default upstream, or a caller passing a bigger batch size through here, multiplies every poll's cost with nothing failing.
   
   `base_read_options` now asks for it explicitly as `MERGE_CHUNK_ROWS`.
   
   **Behaviour change, small but real:** a parquet base file is unaffected — 1024 is what it was already getting. A **lance** base file defaulted to 8192, so its merge chunks become 1024: the same rows in more chunks, and the bound is now uniform across base-file formats instead of differing eightfold by backend. `read_data` concatenates its stream, so the single-batch path returns exactly what it did before.
   
   ## How are the changes test-covered
   
   - [ ] N/A
   - [x] Automated tests (unit and/or integration tests)
   - [ ] Manual tests
     - [ ] Details are described below
   
   `test_a_merged_chunk_is_bounded_by_the_readers_own_batch_size` writes 5000 rows in **one** row group and asserts no chunk exceeds the bound — so a chunk that followed the file's layout fails it. It also asserts the option directly, and that combination is deliberate: the bound agrees with parquet's default today, so no output-level assertion can distinguish the pin from the default, while the realistic future break is a caller passing a larger size (for instance making `hoodie.read.stream.batch_size` effective on the merge path — the gap recorded in #687).
   
   Mutation-checked, each reverted: dropping the pin, and raising it eightfold. Each fails that test.
   
   Verified locally: format, clippy over all targets and without default features, the full `hudi-core` suite both ways (1324 lib tests, 1303 without defaults), the gold parity sweep green across all fixtures and both reader versions, and `cargo check` of `hudi-cpp` and `hudi-python`. Fork PR, so none of it ran in CI — the numbers are local.
   
   ## Limits of the measurement
   
   Stated so nobody reads more into it than it supports:
   
   - The spill file is freshly written, so the page cache is warm and **the disk component is understated**. A cold spill file would be slower — though still bounded by the same chunk size, which is the point of pinning it.
   - One machine, single-threaded, release build. It is enough to separate "milliseconds" from "hundreds of milliseconds", which is the distinction the decision rests on, and not enough to quote as a throughput figure.
   
   If the spilled path ever does need to come off the executor, the hook is unchanged and cheap: `merge_map_spilled()` on the buffer trait, checked once per merge rather than per chunk.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] perf(core): bound the merge chunk rather than moving the merge off the executor [hudi-rs]

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on code in PR #689:
URL: https://github.com/apache/hudi-rs/pull/689#discussion_r3910930893


##########
crates/core/src/storage/reader.rs:
##########
@@ -240,62 +223,113 @@ impl StorageReader {
         LogBlockFetcher::new(self.object_store.clone(), self.location.clone())
     }
 
-    /// Refill the window if the cursor has moved outside it. No-op past the end.
-    fn ensure_window(&mut self) -> Result<()> {
-        if self.pos >= self.file_len {
-            return Ok(());
-        }
-        let in_window = self.pos >= self.window_start
-            && self.pos < self.window_start + self.window.len() as u64;
-        if in_window {
-            return Ok(());
-        }
-        let start = self.pos;
-        let end = (start + self.window_size).min(self.file_len);
-        self.window = get_range_blocking(&self.object_store, &self.location, start, end - start)?;
-        self.window_start = start;
+    /// Length of the whole file, known without reading any of it.
+    pub fn file_len(&self) -> u64 {
+        self.file_len
+    }
+
+    /// Where the cursor sits.
+    pub fn position(&self) -> u64 {
+        self.pos
+    }
+
+    /// Move the cursor. No I/O, and a position past the end of the file is
+    /// allowed: it fails at the next read, which is what lets a caller skip past
+    /// a block's content without paying for it.
+    pub fn seek_to(&mut self, pos: u64) {
+        self.pos = pos;
+    }
+
+    /// Whether `[start, end)` lies inside the resident window.
+    fn window_covers(&self, start: u64, end: u64) -> bool {
+        start >= self.window_start && end <= self.window_start + self.window.len() as u64
+    }
+
+    /// Fetch a window starting at the cursor.
+    async fn fill_window(&mut self) -> Result<()> {

Review Comment:
   non-blocking: Two fetch patterns here look worth a measurement before the merge-down: on a file whose blocks are smaller than the window, the walk's refills sweep essentially the whole file and Pass 3 then re-fetches the admitted content, so total bytes read are ~2x the old whole-file GET; and for a block larger than the window, `is_block_corrupted`'s trailing-pointer probe evicts and re-fetches the header-side window (seek to trailing → refill → seek back → refill again), costing ~2 extra windows per large block. Have you considered a bytes-fetched counter in the object-storage bench you already plan, or restoring/keeping the walk window across the corruption probe? The memory win is measured and real — this is only about knowing what it costs in bandwidth where round trips were the justification.



##########
crates/core/src/file_group/reader_v2/merge_iterator.rs:
##########
@@ -487,22 +554,23 @@ impl Iterator for FileGroupMergeIterator {
             Err((e, merge_ms, build_ms)) => {
                 self.done = true;
                 self.record_chunk_timing(merge_ms, build_ms);
-                Some(Err(core_to_arrow_err(e)))
+                Some(Err(e))
             }
         }
     }
-}
 
-impl RecordBatchReader for FileGroupMergeIterator {
-    fn schema(&self) -> SchemaRef {
-        self.output_schema.clone()
+    /// Drive this merge as a `Stream`, for a caller that wants to compose it.
+    ///
+    /// Chunk-at-a-time and demand-driven: nothing is merged until the consumer
+    /// asks, so the extra memory over the merge map itself is one chunk.
+    pub fn into_stream(self) -> BoxStream<'static, Result<RecordBatch>> {

Review Comment:
   non-blocking: `unfold` panics if polled again after it returns `Ready(None)`, and this stream is the public surface of `read_stream`. `next_chunk`'s sticky `done` already makes the extra poll semantically a no-op, so a `.fuse()` before `.boxed()` would turn that panic into the `None` the caller expects, for free.



##########
crates/core/src/file_group/reader_v2/merge_iterator.rs:
##########
@@ -376,92 +397,138 @@ impl Iterator for FileGroupMergeIterator {
         //   Ok(None)                                       — stream exhausted
         //   Err((e, merge_ms, build_ms))                   — terminal error
         type Chunk = (RecordBatch, u64, u64);
-        let produced: Result<Option<Chunk>, (CoreError, u64, u64)> = match &mut self.source {
-            MergeSource::Eager { source } => {
-                // One source batch = one emitted chunk. The
-                // source is a `RecordBatchReader` — lazy (`ParquetSyncReader`
-                // doing block_on per row-group) or eager (`RecordBatchIterator`
-                // over a Vec for tests / instant-range-filter fallback). The
-                // CoW / empty-FG no-merge path never materializes the whole
-                // base file; it pulls one row-group at a time.
-                match source.next() {
-                    None => Ok(None),
-                    // Eager has no merge work; build timing is the converter only.
-                    Some(Ok(batch)) => Ok(Some((batch, 0, 0))),
-                    Some(Err(e)) => Err((CoreError::ArrowError(e), 0, 0)),
+        let produced: std::result::Result<Option<Chunk>, (CoreError, u64, u64)> =
+            match &mut self.source {
+                MergeSource::Eager { source } => {
+                    // One source batch = one emitted chunk. The no-merge path
+                    // (CoW, or a file group with no log files) never
+                    // materialises the whole base file; it pulls one row group
+                    // at a time.
+                    match source.next().await {
+                        None => Ok(None),
+                        // Eager has no merge work; build timing is the converter only.
+                        Some(Ok(batch)) => Ok(Some((batch, 0, 0))),
+                        Some(Err(e)) => Err((e, 0, 0)),
+                    }
                 }
-            }
 
-            MergeSource::Buffered {
-                buffer,
-                merge_schema,
-                state,
-            } => {
-                // Vectorized merge path: pull the next merged base
-                // batch, or drain log-only inserts, then hand it to the shared
-                // timing / projection / exhaustion tail below (Step 2) so the
-                // stream-stats timing is preserved. Loop to skip base
-                // chunks fully eliminated by log deletes.
-                let merge_start = Instant::now();
-                let mut chunk_err: Option<CoreError> = None;
-                let mut out_batch: Option<RecordBatch> = None;
-                loop {
-                    match state {
-                        BufferedState::BaseScanning => {
-                            match buffer.next_merged_base_batch(merge_schema) {
-                                Ok(Some(b)) => {
-                                    if b.num_rows() == 0 {
-                                        // All base rows in this source batch lost
-                                        // to a log delete — pull the next.
+                MergeSource::Buffered {
+                    buffer,
+                    base_source,
+                    merge_schema,
+                    state,
+                } => {
+                    // Vectorized merge path: pull the next base batch and merge
+                    // it, or drain log-only inserts, then hand the result to the
+                    // shared timing / projection / exhaustion tail below
+                    // (Step 2). Loop to skip base batches fully eliminated by
+                    // log deletes.
+                    //
+                    // Only the merge itself is timed. Timing the whole loop
+                    // would fold the base file's read latency into
+                    // `final_merge_ms`, which is meant to measure merging.
+                    let mut merge_ms = 0u64;
+                    let mut chunk_err: Option<CoreError> = None;
+                    let mut out_batch: Option<RecordBatch> = None;
+                    loop {
+                        match state {
+                            BufferedState::BaseScanning => {
+                                // Pull first, merge second. Only the source knows
+                                // when the base is exhausted, so that is the only
+                                // thing that moves the state machine on to the
+                                // drain — a merge that yields no rows just means
+                                // this batch contributed none, and must not be
+                                // read as the end of the base file.
+                                let pulled = match base_source.as_mut() {
+                                    None => None,
+                                    Some(source) => match source.next().await {
+                                        None => {
+                                            *base_source = None;
+                                            None
+                                        }
+                                        Some(b) => Some(b),
+                                    },
+                                };
+                                let base = match pulled {
+                                    None => {
+                                        // Base exhausted — drain log-only inserts
+                                        // on the next loop turn.
+                                        *state = BufferedState::DrainingLogInserts;
                                         continue;
                                     }
-                                    out_batch = Some(b);
-                                    break;
-                                }
-                                Ok(None) => {
-                                    // Base source exhausted — drain log-only
-                                    // inserts on the next loop turn.
-                                    *state = BufferedState::DrainingLogInserts;
-                                    continue;
+                                    Some(Ok(b)) => b,
+                                    Some(Err(e)) => {
+                                        // Drop the source: a failed read must not
+                                        // be resumed as if it had merely ended,
+                                        // which would truncate the output
+                                        // silently.
+                                        *base_source = None;
+                                        log::error!("[FileGroupMergeStream] base file source: {e}");
+                                        chunk_err = Some(CoreError::ReadFileSliceError(format!(
+                                            "base file source error: {e}"

Review Comment:
   non-blocking: The Buffered path stringifies a base-source error into `ReadFileSliceError` while the Eager path forwards the original `CoreError`, so the same storage failure surfaces as a different variant depending on whether the slice had log files. Forwarding `e` unchanged here (and in `pull_and_merge_next_base_batch`) would keep the taxonomy uniform and preserve the source chain for callers that classify retryable errors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] perf(core): bound the merge chunk rather than moving the merge off the executor [hudi-rs]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #689:
URL: https://github.com/apache/hudi-rs/pull/689#issuecomment-5503936766

   ## [Codecov](https://app.codecov.io/gh/apache/hudi-rs/pull/689?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `67.92929%` with `127 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 80.22%. Comparing base ([`e8ff14a`](https://app.codecov.io/gh/apache/hudi-rs/commit/e8ff14a15e6a7e035f6f86f860a6cff5e7460747?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6b24fec`](https://app.codecov.io/gh/apache/hudi-rs/commit/6b24fece215bfffd9a8123b93bbedd0cea5055e3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/hudi-rs/pull/689?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [crates/core/src/file\_group/log\_file/reader.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Ffile_group%2Flog_file%2Freader.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL2ZpbGVfZ3JvdXAvbG9nX2ZpbGUvcmVhZGVyLnJz) | 61.61% | [38 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [crates/core/src/storage/reader.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Fstorage%2Freader.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL3N0b3JhZ2UvcmVhZGVyLnJz) | 57.57% | [28 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...core/src/file\_group/reader\_v2/log\_record\_reader.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Ffile_group%2Freader_v2%2Flog_record_reader.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL2ZpbGVfZ3JvdXAvcmVhZGVyX3YyL2xvZ19yZWNvcmRfcmVhZGVyLnJz) | 70.96% | [27 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [crates/core/src/file\_group/reader\_v2/engine.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Ffile_group%2Freader_v2%2Fengine.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL2ZpbGVfZ3JvdXAvcmVhZGVyX3YyL2VuZ2luZS5ycw==) | 56.52% | [20 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [crates/core/src/file\_group/log\_file/log\_block.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Ffile_group%2Flog_file%2Flog_block.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL2ZpbGVfZ3JvdXAvbG9nX2ZpbGUvbG9nX2Jsb2NrLnJz) | 70.58% | [5 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [.../src/file\_group/reader\_v2/buffer/position\_based.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Ffile_group%2Freader_v2%2Fbuffer%2Fposition_based.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL2ZpbGVfZ3JvdXAvcmVhZGVyX3YyL2J1ZmZlci9wb3NpdGlvbl9iYXNlZC5ycw==) | 33.33% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...es/core/src/file\_group/reader\_v2/merge\_iterator.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Ffile_group%2Freader_v2%2Fmerge_iterator.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL2ZpbGVfZ3JvdXAvcmVhZGVyX3YyL21lcmdlX2l0ZXJhdG9yLnJz) | 93.84% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [crates/core/src/file\_group/reader\_v2/adapter.rs](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&filepath=crates%2Fcore%2Fsrc%2Ffile_group%2Freader_v2%2Fadapter.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y3JhdGVzL2NvcmUvc3JjL2ZpbGVfZ3JvdXAvcmVhZGVyX3YyL2FkYXB0ZXIucnM=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/hudi-rs/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main     #689      +/-   ##
   ==========================================
   - Coverage   80.36%   80.22%   -0.15%     
   ==========================================
     Files         118      118              
     Lines       11089    11151      +62     
   ==========================================
   + Hits         8912     8946      +34     
   - Misses       2177     2205      +28     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/hudi-rs/pull/689?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] perf(core): bound the merge chunk rather than moving the merge off the executor [hudi-rs]

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on code in PR #689:
URL: https://github.com/apache/hudi-rs/pull/689#discussion_r3910875891


##########
crates/core/src/file_group/reader_v2/engine.rs:
##########
@@ -133,9 +134,25 @@ pub struct HoodieFileGroupReader {
     // visible to (a) the base parquet read here, and (b) the parquet log
     // block decoder in `file_group::log_file::content::Decoder`. The gate
     // (CoW || mor_pk_safe) lives at the use sites; this file's gate is at
-    // `make_base_file_source` below.
+    // `base_file_source` below.
 }
 
+/// Rows per base batch handed to the merge, and therefore per merged chunk.
+///
+/// Load-bearing rather than cosmetic: merging a chunk is synchronous work on the
+/// task that polls the stream, and its cost is linear in the chunk's rows. On
+/// this machine, one merge of a 1024-row chunk against a 50k-key log map takes
+/// 0.4-1.1 ms, and 5.7-6.1 ms once the merge map has spilled to disk; at 8192
+/// rows those become 2.8 ms and ~40 ms. So the chunk size is what bounds how long
+/// a single poll occupies its executor, and it is set here rather than inherited.
+///
+/// 1024 is what `parquet` already defaults to, so this pins today's behaviour
+/// instead of changing it. Pinned because the bound is silent if it moves: a
+/// larger default upstream would multiply the blocking above with nothing
+/// failing. Measured by `spilled_merge_blocking_duration` (ignored; run with
+/// `--release --ignored --nocapture`).
+const MERGE_CHUNK_ROWS: usize = 1024;

Review Comment:
   non-blocking: The chunk bound pinned here is 1024 for merged base chunks, but the log-only drain still emits 4096-row chunks per poll (`DEFAULT_BATCH_SIZE` in `drain_log_only_inserts`), and a spilled map's drain does its RocksDB pulls on the same polling task the bound exists to protect. Was leaving the drain at 4x the merge bound deliberate — e.g. because the drain has no per-row map probe — or should it follow `MERGE_CHUNK_ROWS` too? Either answer seems fine, but the asymmetry is the one occupancy decision the PR doesn't record.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] perf(core): bound the merge chunk rather than moving the merge off the executor [hudi-rs]

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on PR #689:
URL: https://github.com/apache/hudi-rs/pull/689#issuecomment-5504750416

   non-blocking: one question on object-storage performance before this stack's numbers get quoted. The memory win is measured and convincing, but every performance-shaped claim is local so far: the PR's own account says wall time is 7-10% slower on a local filesystem (attributed to lost OS readahead), the round-trip saving from `get_ranges` coalescing is unmeasured, and the header walk's windowed refills change the byte and round-trip profile in ways a local disk cannot show at all. Is an S3 (or other object-store) run of the fg-bench/memory-bench pair planned before the merge-down — ideally with a bytes-fetched counter, which would also answer the window-refill question on `fill_window` above in the same run?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] perf(core): bound the merge chunk rather than moving the merge off the executor [hudi-rs]

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua merged PR #689:
URL: https://github.com/apache/hudi-rs/pull/689


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org