feat(cluster)!: let topics require durable acks and flatten config - #4092
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4092 +/- ##
============================================
+ Coverage 86.03% 86.39% +0.35%
- Complexity 1449 1455 +6
============================================
Files 1248 1258 +10
Lines 195841 205504 +9663
Branches 161138 170716 +9578
============================================
+ Hits 168495 177540 +9045
- Misses 23212 23501 +289
- Partials 4134 4463 +329
🚀 New features to boost your workflow:
|
|
/ready |
|
/ready |
edcc53c to
194d0fd
Compare
The earlier guide tied acknowledgements to flush thresholds and the removed enforce_fsync option. Document independent replicated and persisted policies, quorum WAL recovery, and asynchronous exceptions. Align related references with the implemented configuration schema. Adapted from 68dd8d38534011bcd4adddf9dd89b12cb6ea99ad. Refs apache/iggy#4092
Bounded commit walks can leave resident operations unapplied and open redundant peer repair. Check the whole requested window before opening a session, including adopted suffixes above the commit frontier. Verify that ticks drain resident backlogs while later holes still repair.
Mixed-durability topics write message bodies into both the WAL and materialized logs. Let the WAL own the shared segment inode and defer body and directory barriers until durable publication, retaining the original writers across buffered rotations. Publish completed references separately from durable progress so replicated replies keep their flush thresholds without waiting under the append lock. Preserve clean-file sync elision and recovery gates. Cover policy combinations, delayed writes, storage faults, transfers, and cluster restart after persisted offsets acknowledge predecessors.
The cleanup tests set message expiry at topic creation. On a slow cluster, the cleaner can remove segments before the pre-expiry assertions run. A fixed sleep can also end before the cleaner runs. Create the topics without expiry and enable a 100 ms expiry after setup. Poll up to 30 s for cleanup in every partition. The staggered bootstrap test waited for log lines from the late replica that announce view adoption and repair or state transfer. Normal commit processing can catch the replica up without a repair or transfer line. Read its metadata superblock view and wait for the topic partition directory instead. The consumer group scenario logged its root client in once after connect. The metadata leader can move during polling, and QUIC and WebSocket reconnects do not restore that login. Use the reconnecting root login, so the transport logs in again after each reconnect.
|
Thanks for explaining, @hubcio. That helps a lot. I’ll try to help with the review |
Recovery rejection lacked retry and cooperative ownership coverage. Exercise real partition reads and state transfer, preserving the recovery fence, and clarify checkpoint-prepare residency.
Named writes could attest the wrong topic's durability, while WAL backpressure misclassified accepted retries. Pending ACKs could leak or force serial superblock writes, and truncation blocked the shard. Pin HTTP routing to the captured topic and check replays before WAL admission. Drain WAL ACKs after the bounded superblock pass and avoid queueing them without a WAL. Move truncation to the bounded storage worker and preserve the restart fence for waiting replacements. Keep Helm encryption compatible with released images and require an explicit layout for unknown builds. Add regression coverage for routing, replay outcomes, ACK retries, cancellation and truncation.
|
Thanks for the fixes, Hubert. I'd like to help strengthen confidence in the PR's core acknowledgment guarantee. Awaited success requires quorum commit under the selected policy, and The existing storage tests already exercise the predecessor dependency. I'd like to extend that coverage to the client reply through the partition and consensus code, starting with I'll first check how this fits the existing partition fixtures. From there, I'd look for missing cases involving persistence failures and stale completions after fencing, alongside controls for successful progress and independent policy selection. Let me know if someone is already covering this path. |
|
sounds good, but lets do that in next PRs later today. we plan to merge this one today. |
Producer acknowledgments did not wait for recoverable storage. The
enforce_fsyncoption synchronized segment flushes, but replicas sentPrepareOkbefore prepares reached stable storage. Consumer-offsetsynchronization was one server-wide key.
This PR adds two create-only topic options,
durabilityandconsumer_offset_durability. Each isreplicated(the default) orpersisted, and neither inherits the other. Both policies write todisk and complete after VSR quorum commit. Persisted also requires
recoverable stable-storage copies on the quorum, or a local sync in a
single-replica group.
In replicated groups, a persisted policy adds a bounded per-partition
prepare WAL, sized by
partition.wal_bytes_max. WAL records referencemessage bodies in segment files, and hard links keep them until
reclamation. Replicas forward each prepare before their own WAL write
completes. Reclamation waits for durable materialized state, and
missing history or storage errors fail closed.
AWS i4i benchmarks found two costs outside the WAL, which this PR
removes. Produce admission zero-filled each request buffer before the
copy, and repair ran for operations that were already resident.
The configuration drops
[system]. Itspathkey and remainingtables move to the root, and
IGGY_SYSTEM_*variables loseSYSTEM_.This PR removes the stream, topic and partition path keys,
archive_expired,recreate_missing_stateandconsumer_offset_enforce_fsync. The server refuses to boot with arelocated key or a stored topic with
enforce_fsync=true.The Rust, Java, C#, Go, Node, Python, PHP and C++ SDKs, the CLI and
the benchmark expose both options. The HTTP
Iggy-Durabilityheaderreports
replicatedorpersistedinstead ofreplicated-memory.Poll auto-commit and
ack=noneproduce stay asynchronous.A deterministic simulator storage model injects crashes, power loss
and torn writes into WAL tests. Cluster tests cover crashes and
corruption, and a compatibility test boots a baseline data directory.
The in-memory partition simulator does not run persisted topics.