streamstack icon indicating copy to clipboard operation
streamstack copied to clipboard

[feature] Disk / EBS / NFS WAL for low-latency durable acks

Open addu390 opened this issue 3 months ago • 4 comments

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 + WalFactory URI scheme (slot already reserved for block WAL).
  • Bound unuploaded tail via --wal-upload-interval-ms (chaange to a non-zero default, e.g. 30s).

addu390 avatar Aug 31 '26 00:08 addu390

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.

mchauhan3 avatar Sep 02 '26 22:09 mchauhan3

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.

addu390 avatar Sep 02 '26 23:09 addu390

Does that still work if ownership gets transferred while the node is down though? Imagining a case where

  1. Node A goes down after write to EBS and ack for stream X, before flush to S3.
  2. Node B takes ownership of stream X.
  3. Node A comes up, reattaches and finds unflushed writes, but is unable to write. Additionally flushing at this point might violate order?

mchauhan3 avatar Sep 02 '26 23:09 mchauhan3

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.

addu390 avatar Sep 03 '26 00:09 addu390