[feature] Disk / EBS / NFS WAL for low-latency durable acks
Summary
Add a block/file WAL backend behind the existing WriteAheadLog trait so appends can ack in single-digit milliseconds.
Latency is bounded by batchInterval + object upload. A local or shared-disk WAL is the ack accelerator, S3 remains long-term storage after delta upload + trim.
Backends
- EBS / local disk: lowest latency, single-AZ
- NFS (EFS): multi-AZ, per-node WAL paths on one mount for failover without volume detach
- Keep S3 WAL as the default
Notes
- Implement as another
WriteAheadLog+WalFactoryURI scheme (slot already reserved for block WAL). - Bound unuploaded tail via
--wal-upload-interval-ms(chaange to a non-zero default, e.g. 30s).
Does this change the durability guarantee? If the node goes down after sending the ACK, it's possible that the record never makes it to S3.
With EBS, unlike NVMe, a node crash/restart wouldn't lead to data loss. The volume is reattached and the tail recovered. Exposure is to AZ/volume loss before flush to S3. And --wal-upload-interval-ms tightens this further.
Beyond EBS, EFS/NFS would be a better option for a Multi-AZ safety net.
The recommendation would still be to continue using the default S3-based WAL and disk-based WAL for very low-latency needs.
Does that still work if ownership gets transferred while the node is down though? Imagining a case where
- Node A goes down after write to EBS and ack for stream X, before flush to S3.
- Node B takes ownership of stream X.
- Node A comes up, reattaches and finds unflushed writes, but is unable to write. Additionally flushing at this point might violate order?
It wouldn't. For multi-node/cluster deployments, one option is to use shared volumes, with paths like /node1/wal, /node2/wal.
Or tolerate the limitation of stream ownership change while the node is down, would require a new node to reattach to the same volume, which is ugly.
However, planned scale down is not going to be a problem, because the WAL will be flushed.