How are pieces being repaired?

Can’t find the answer to my question, so I thought about asking it here:

How does the repair functionality actually work? I get that if the pieces fall below a threshold, a repair task is initiated. But what actually happens when repairing?

A) Enough pieces to rebuild the segment are pulled from nodes, the segment is rebuilt and the newly created pieces (those above the threshold) are sent to new nodes. The nodes providing the pieces to rebuild the segment keep their pieces.

B) Enough pieces are pulled, the segment is rebuilt, all rebuilt pieces are sent to new nodes. The older nodes (that provided pieces for the rebuild) lose their pieces (garbage collected?).

1 Like

A with the small addition that any node that was not contacted but otherwise is still considered healthy will also keep their piece.

3 Likes

See also

1 Like

considered healthy=not suspended?

1 Like

No, pieces are available (the nodes are rendered as online) and didn’t failed audits on these pieces.

1 Like

I always forget these little details. According to this test suspended nodes will get replaced: storj/satellite/repair/repair_test.go at 2ce49aceb2ccaa5d121679354f6310118dae7e08 · storj/storj · GitHub

3 Likes