You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "hanahmily (via GitHub)" <gi...@apache.org> on 2026/08/07 05:34:19 UTC

[PR] Improve trace merge sampler staging memory [skywalking-banyandb]

hanahmily opened a new pull request, #1259:
URL: https://github.com/apache/skywalking-banyandb/pull/1259

   ## What changed
   
   - derive a preferred complete-trace sampler decision batch from selected part metadata while preserving the resource-derived hard staging and per-trace limits
   - retain strict complete-trace boundaries, fail-open oversized-trace behavior, and fragment-guard use of the hard ceiling
   - report the metadata estimate, planned and actual batches, charged bytes, peak staged bytes, and effective limits in the merge benchmark
   - extend the controlled Docker harness and HTML report for adaptive-batch evidence
   - document the balanced fresh-process acceptance series and same-process cold/warm reuse diagnostic
   
   ## Why
   
   The 2-core, 4-GiB production envelope derives a safe 256-MiB staging ceiling, but the frozen mature merge is smaller than that ceiling. A single sampler call therefore retains the entire merge working set and prevents BanyanDB's bounded internal pools from being reused within the merge. The preferred batch is a performance working window; the existing resource-derived ceiling remains the safety limit.
   
   ## Results
   
   The balanced DR/RD comparison used five fresh Docker processes per mode and the same frozen mature production selection.
   
   - all 10 runs preserved 147,126 rows and the core, latency, and start-time ledgers
   - all retain-all runs evaluated and retained 33,353 complete traces
   - hard ceiling: 256 MiB; preferred batch: 27.25 MiB; peak staged: 27.25 MiB
   - five complete-trace sampler calls per fresh-process retain-all merge
   - versus the prior one-call retain-all median: allocated bytes -12.4%, allocations -2.3%, peak Go heap -34.6%, peak RSS -20.4%
   
   A five-merge same-process diagnostic preserved correctness and reduced warm allocated bytes to 225.93-238.53 MiB from a 263.10-MiB cold merge. Reused arena capacity is included in exact runtime accounting, so warm merges safely used six complete-trace calls.
   
   The allocation-count, allocated-byte, and RSS optimization targets remain open, so this PR is intentionally a draft.
   
   ## Validation
   
   - `make pre-push`
   - balanced 5+5 controlled mature-merge series in a 2-CPU, 4-GiB Docker container
   - five same-process cold/warm retain-all merges using identical frozen seed clones
   - exact core and secondary-index ledger reconciliation for every measured merge
   


-- 
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: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] Improve trace merge sampler staging memory [skywalking-banyandb]

Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily merged PR #1259:
URL: https://github.com/apache/skywalking-banyandb/pull/1259


-- 
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: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] Improve trace merge sampler staging memory [skywalking-banyandb]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1259:
URL: https://github.com/apache/skywalking-banyandb/pull/1259#discussion_r3739993452


##########
scripts/run-trace-merge-baseline.sh:
##########
@@ -192,9 +210,15 @@ run_controlled_once() {
   fi
   docker logs "$container" >"$run_dir/data-node.log" 2>&1 || true
   docker rm -f "$container" >/dev/null 2>&1 || true
+  docker run --rm -v "$run_dir":/run "$IMAGE" chmod -R 0777 /run
   active_container=""
 }
 
+if [[ "$FULL_PIPELINE" != "disabled" && "$FULL_PIPELINE" != "retain-all" ]]; then
+  echo "FULL_PIPELINE must be disabled or retain-all" >&2
+  exit 1
+fi

Review Comment:
   When FULL_PIPELINE=retain-all, the script will pass --plugin/--plugin-sha256 to the benchmark, but there is no early validation that $CONTROLLED_PLUGIN exists (unlike the CONTROLLED_ALTERNATING=1 path). If a user sets CONTROLLED_PLUGIN to a custom path that is missing, the run fails later inside Docker; fail fast with a clear message.



##########
docs/design/trace-pipeline-merge-optimization-plan.md:
##########
@@ -10,16 +10,16 @@ The controlled mature-merge comparison uses the same frozen production selection
 retain-all variants. Each variant ran in five fresh resource-limited Docker processes. All ten runs passed the selection,
 maturity, row-count, secondary-index, and logical-ledger correctness gates.
 
-Each retain-all run made two plugin calls, evaluated and retained 33,353 complete trace IDs, dropped no traces, and
+Each retain-all run made one plugin call, evaluated and retained 33,353 complete trace IDs, dropped no traces, and

Review Comment:
   The optimization plan’s “Current Result (Baseline)” section says each retain-all run made **one** plugin call, but later in the same document it states retain-all runs consistently made **five** sampler calls. These statements conflict; update the baseline summary to match the five-call behavior described below.



-- 
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: notifications-unsubscribe@skywalking.apache.org

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