r/compsci • • 23d ago

Exploring Data Integrity and Fault Tolerance in Erasure-Coded Distributed Storage Systems

Hello everyone!

I've been exploring a research direction around distributed storage systems, particularly the challenge of maintaining data integrity and availability when information is distributed across multiple storage nodes.

The research idea I'm investigating is titled:

Verifiable Erasure-Coded Cloud Storage Systems

The problem I'm interested in

Erasure coding allows a system to divide data into fragments and distribute them across multiple storage nodes. This improves storage efficiency and fault tolerance because the original data can be reconstructed even when some fragments become unavailable.

However, distributing data introduces another challenge: how can a storage system efficiently verify that its fragments remain intact and have not been corrupted or improperly modified?

Traditional integrity checks can help detect corruption, but I am interested in exploring verification mechanisms that can operate without requiring the entire original dataset to be reconstructed.

The technical direction

I'm particularly interested in investigating the interaction between:

  • Erasure Coding: Distributing data fragments to improve fault tolerance and storage efficiency.
  • Cryptographic Verification: Establishing confidence in the integrity of stored fragments.
  • Distributed Storage Architecture: Handling node failures, corrupted fragments, and verification across multiple storage nodes.

One challenge I find particularly interesting is balancing verification overhead against storage efficiency, fault tolerance, and system performance.

A question for the community

When combining erasure coding with cryptographic integrity verification, what are the most significant architectural or theoretical challenges that should be considered?

In particular, are there established approaches that allow efficient verification of individual or distributed fragments without reconstructing the entire original dataset?

I'd be interested in relevant research papers, established techniques, and alternative approaches that address this problem.

I'm currently exploring the research literature and refining the problem formulation before moving towards an experimental prototype.

I'd appreciate technically grounded discussion and critical perspectives.

Thanks for reading!

3 Upvotes

4 comments sorted by

6

u/celestrion 23d ago edited 23d ago

I've been on a team that implemented the design for distributed erasure coding for a major cloud provider. This was about six years ago, so the details have likely changed, but the challenges tend to be fundamental.

Our architecture used erasure coding to split writes across nodes in a tight cluster (multiple 100Gb/s RDMA links between nodes) with hashes at the node level to detect corruption. We relied on sufficient redundancy in the erasure coding matrix for that dataset so that the corruption needed to just be "okay / not okay" rather than something we could recover independent bits from. If one of the chunks was bad, we just threw it out and ran the syndrome to recover the whole stripe.

Cryptographic verification was something we left up to the next level of abstraction. The obvious use-case for this was deduplication and content-based addressing (common in object storage schemes). The biggest performance hit in this pipeline is the place where the writes went from moving RDMA pointers in memory to hitting actual bytes (for hashing), so this is a great place to run the stripe-hash and the individual-chunk hashes in parallel; you're already taking the hit once, so let the actual storage nodes trust the striping node to provide the checksum in sideband.

In my design for this part of the subsystem, that "trust" meant that the node which owned the stripe would allocate storage en bloc from the storage nodes and write directly over RDMA to NVMe drives on the far end. The storage nodes only did traffic-cop stuff by verifying that the LBAs under write were allocated to the node requesting the write.

Node failures is always a fun topic if you have multiple writers for a given dataset. That either implies explicit locking or a follow-the-leader style consensus algorithm, and your lock-holder/leader can always be the node that fell over. I had some novel work in this, as I designed our initial consensus algorithm. We never applied for a patent under which to publish that work (translation: I cannot give you details) so, suffice it to say that the major common consensus algorithms have support for calling elections when the leader goes away, and you want a way to signal that with minimum latency. It's also very wasteful to have one leader for all the storage in play, so that's another knob to turn.

One challenge I find particularly interesting is balancing verification overhead against storage efficiency, fault tolerance, and system performance.

One of the other novel things in our design was that we had per-stripe matrices to support different qualities of service and to keep the level of redundancy constant under failure (normally write to 14 nodes with 4 redundant chunks, but now 2 nodes are down? Write to 12 nodes with 4 redundant chunks and shrink the stripe). For object storage (our target audience), this is probably fine, but for traditional filesystems, this makes performance unpredictable.

The really surprising (not really, when you think about it for a minute) finding we had was that anything we did in the datapath to add redundancy or verification on the sub-block level just murdered performance. Even something as simple as a parity byte blew latency up because RDMA and DMA really work. When you can take a bunch of pointers to 4k blocks, stripe them into scatter-gather I/O vectors and point them at NVMe drives, the hardware does everything apart from the book-keeping. Once you want to look inside, you've got the CPU involved, and SIMD can only do so much to keep things moving. There's probably work to be done in moving that work out of the fast path, where there's some dirty-block list and a background-job that hashes the recently-written blocks asynchronously from some very reliable storage and then shuffles them off to cheap QLC.

The obvious next step in all of this is to add redundancy by mirroring I/Os offsite, and that's when you've really got to decide where you stand with CAP because time-of-flight latency is always considerable when sending bits to somewhere far enough away to not be taken out by the same weather system or enemy action or utility-scale power glitch. Some implementations would mirror a hash-protected copy of the intent log and rely on the far side to to striping, and that always seemed like the sanest compromise to me.

Also complecting the situation is the notion of multi-tenancy. Customers probably don't want to read each other's data. You can enforce this with namespacing in the case of NVMe. Or, you can use per-customer crypto keys. Every approach has nasty trade-offs.

2

u/No_Astronomer7655 22d ago

This is an awesome write-up, thank you for sharing how you architected that in production.

Your point about sub-block verification in the datapath murdering performance when the CPU has to touch every byte really hits home. In a tight cluster with 100Gb/s RDMA where the storage nodes trust the striping node, doing simple node-level hashes and just throwing out a bad chunk to re-run the syndrome makes total sense.

The specific corner I'm looking at is what happens when you don't have 100Gb/s RDMA or a trusted cluster—specifically decentralized P2P storage over standard TCP links where recovery bandwidth is the bottleneck. To avoid pulling $k$ full chunks across congested links to a single requester, recent systems (like ECPipe and PivotRepair) use slice-pipelined repair, where node 1 sends a 64 KiB partial parity slice to node 2, node 2 XORs its own slice into it and forwards it to node 3, and so on down a $k$-hop chain.

Because intermediate nodes are mutating the slice in transit, a simple end-to-end hash at the sink can tell you the final reconstructed chunk is bad, but it can't tell you which relay in the pipeline poisoned the parity. At the same time, just like you pointed out, running heavy cryptographic verification at every intermediate hop kills throughput.

That's why I'm currently prototyping a comparison in Go between two approaches to see how bad that CPU hit actually is:

  1. In-transit homomorphic MACs over GF(2^128) (using PCLMULQDQ/SIMD carry-less multiplication so intermediate nodes can verify linear combinations in the fast path), versus
  2. Moving verification out of the intermediate fast path (optimistic verification only at the sink, where intermediate relays just attach a lightweight Ed25519 signature over the hash of their outgoing slice as a receipt, and the sink only runs a log2(k) binary search over those receipts out-of-band when a corrupted chunk is actually detected).

Also, your point about dynamically shrinking the stripe matrix from 14 to 12 nodes while keeping 4 parity chunks constant during node downtime is super clever—how did you handle the metadata bookkeeping when stripes of the same object had different matrix dimensions during background healing?

2

u/celestrion 22d ago • Mindblown

decentralized P2P storage over standard TCP links where recovery bandwidth is the bottleneck.

I'd have to think on this a lot more, but my initial reaction is that the point-to-point chain is a great theoretical design that won't hold up in real-world use. I can definitely see why you'd prefer it over (n-1)-squared links among nodes, but that node at the far end of the chain has a 100% change of starvation in the case of any failure, and its immediate parent has an (n-1)/n chance of starvation. Effective per-node utilization has a very depressing curve as you move away from the initial writer.

There was a lot of research in topologies of node connectivity during the massively parallel computer days of the late 1980s and early 1990s. There might be some papers giving a good description of topologies that work well over high-latency links (IBM's Parallel Sysplex is a model of that today, but with very few nodes per system, so it might be naively (n-1)-squared). The general shape of the work in the masspar days was that all nodes connect to some nodes, and you wanted the average path to be log-something(n) and redundant.

But then you're adding cluster reformation and DHT-like complexity to an already hard problem.

(optimistic verification only at the sink, where intermediate relays just attach a lightweight Ed25519 signature over the hash of their outgoing slice as a receipt, and the sink only runs a log2(k) binary search over those receipts out-of-band when a corrupted chunk is actually detected).

To me, this sounds like a very promising path forward, but make sure to benchmark Ed25519 verifies over representative data. It's probably slower than you think. This whole problem might be one of the few places where an FPGA (or scatter-gather blasting at a GPU) is still a reasonable answer.

Also, your point about dynamically shrinking the stripe matrix from 14 to 12 nodes while keeping 4 parity chunks constant during node downtime is super clever—how did you handle the metadata bookkeeping when stripes of the same object had different matrix dimensions during background healing?

When I say that we had per-stripe matrices, that's a simplification. We had a sparse addressing layer for stripes themselves, and the address of the stripe informed the next layer down of the geometry of the slice (there's an obvious performance hack implied in this which I can't talk about, but think on it for a moment). We also had a periodic preening task that would run when the system was healthy to read the metadata of objects written under a state of duress and verify that they had the correct geometry. If not, we'd issue an in-place (as far as the content-address layer was concerned) rewrite to square-up the back-end geometry.