Skip to content

fix(partitions): account for segment-backed append batches - #4202

Merged
hubcio merged 2 commits into
apache:masterfrom
jiengup:fix/simulator-test
Sep 17, 2026
Merged

hubcio merged 2 commits into
apache:masterfrom
jiengup:fix/simulator-test

Conversation

@jiengup

@jiengup jiengup commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

Closes #4142

Rationale

Group commit used the padded full prepare size even when segment storage wrote only a small reference record to the WAL. This prevented large segment-backed messages from coalescing despite their small WAL footprint.

What changed?

Append batching now tracks retained capacity, actual padded WAL extent, and segment-body work separately. The WAL extent controls group-commit coalescing, while an independent segment-body limit preserves the safeguard requested in the #4092 review discussion.

The previously ignored eight-message test now completes in one barrier group. A nine-message regression test verifies that batches still split when segment-body work exceeds its limit.

Local Execution

  • Passed cargo fmt --all
  • Passed cargo sort --no-format --workspace
  • Passed cargo clippy -p journal -p partitions -p simulator --all-features --all-targets -- -D warnings
  • Passed cargo test -p journal -p partitions -p simulator
  • Passed ./scripts/ci/taplo.sh --check
  • Pre-commit hooks ran and passed

AI Usage

  1. Tool: OpenAI Codex
  2. Scope: Repository analysis, implementation assistance, test updates, and review of the final diff.
  3. Verification: Ran the relevant journal, partitions, and simulator tests, clippy, formatting, Taplo, and pre-commit checks.
  4. I reviewed and can explain every line of the change.

@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer
  • /pin - exempt the PR from the stale bot, /unpin to undo

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Sep 16, 2026
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.46154% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.57%. Comparing base (1284e30) to head (d3de54f).

Files with missing lines Patch % Lines
core/partitions/src/persistence.rs 89.55% 1 Missing and 6 partials ⚠️
core/journal/src/partition_journal.rs 81.81% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #4202       +/-   ##
=============================================
- Coverage     87.46%   70.57%   -16.89%     
  Complexity     1575     1575               
=============================================
  Files          1280     1278        -2     
  Lines        223192   197661    -25531     
  Branches     186557   161023    -25534     
=============================================
- Hits         195223   139509    -55714     
- Misses        23264    53535    +30271     
+ Partials       4705     4617       -88     
Components Coverage Δ
Rust Core 67.64% <88.46%> (-20.89%) ⬇️
Java SDK 68.68% <ø> (ø)
C# SDK 77.48% <ø> (+0.02%) ⬆️
Python SDK 90.97% <ø> (ø)
PHP SDK 85.67% <ø> (ø)
Node SDK 96.45% <ø> (+0.02%) ⬆️
Go SDK 70.08% <ø> (-0.09%) ⬇️
Files with missing lines Coverage Δ
core/journal/src/partition_journal.rs 94.60% <81.81%> (-0.06%) ⬇️
core/partitions/src/persistence.rs 91.88% <89.55%> (-0.16%) ⬇️

... and 356 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hubcio
hubcio merged commit 13a0d91 into apache:master Sep 17, 2026
97 checks passed
@github-actions github-actions Bot removed the S-waiting-on-review PR is waiting on a reviewer label Sep 17, 2026
@numinnex

Copy link
Copy Markdown
Contributor

/dst

@numinnex

Copy link
Copy Markdown
Contributor

/dst cancel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix given_large_bodies_when_appending_then_wal_records_should_coalesce_into_one_barrier_group

3 participants