Skip to content

[server] Keep async KV flushes on WAL batch boundaries - #4268

Open
platinumhamburg wants to merge 7 commits into
apache:mainfrom
platinumhamburg:fix-kv-flush-wal-batch-boundaries
Open

[server] Keep async KV flushes on WAL batch boundaries#4268
platinumhamburg wants to merge 7 commits into
apache:mainfrom
platinumhamburg:fix-kv-flush-wal-batch-boundaries

Conversation

@platinumhamburg

Copy link
Copy Markdown
Contributor

Track pending WAL batch ends through append, recovery, flush completion and truncation. Keep each independently completed native write on whole WAL batches so storage backpressure cannot publish an interior high watermark.

Cover native write rejection, retry, byte and entry budgets, duplicate and empty batches, leader HW publication, follower truncation and WAL recovery with real storage tests.

Purpose

Linked issue: close #4267

Brief change log

Tests

API and Format

Documentation

Track pending WAL batch ends through append, recovery, flush completion and truncation. Keep each independently completed native write on whole WAL batches so storage backpressure cannot publish an interior high watermark.

Cover native write rejection, retry, byte and entry budgets, duplicate and empty batches, leader HW publication, follower truncation and WAL recovery with real storage tests.
Reuse boxed batch ends and bypass segment scanning for a single WAL batch. Allocate the segment list only when splitting is required. Consolidate byte and entry budget coverage in the real Replica recovery test and retain the complete truncation and recovery scenario.
Accumulate complete WAL batches before checking the soft entry and byte budgets. Remove lookahead batch counters and keep trailing empty batches in the final segment. Verify grouped native writes, partial completion and recovery through real storage tests.
Keep real append/backpressure/retry and WAL recovery/truncation scenarios. Remove duplicate parameter combinations and buffer regressions while retaining existing grouping tests.
Replace the boxed boundary queue and flush snapshots with a flag on the final KV mutation of each confirmed WAL batch. Split directly on marked entries and retain the requested flush target for empty tails. Boundary cleanup follows the existing entry completion and truncation lifecycle.
Name the tail mutation marker explicitly for WAL batches and describe its per-batch call ordering. Name native write budgets as entry and byte targets rather than hard maxima.
Continue writing an existing key after deleting the KV directory so RocksDB surfaces the storage error even when the large WAL batch is applied in one native write. Keep the existing failover and full restored-data assertions.
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.

[Bug] Asynchronous KV flush can publish a high watermark inside a WAL batch

1 participant