Commit 1f8aa742 authored by jan.koester's avatar jan.koester
Browse files

test

parent e7be8e84
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -1286,9 +1286,23 @@ namespace authdb {
                    continue;
                }

                // Data is valid — safe to remove and re-store for correct placement
                // Data is valid — safe to re-store for correct placement.
                // SAFETY: store FIRST so correct blocks exist on correct nodes.
                // If this throws, original data remains on old nodes.
                scrub_client_->store(gid, data.data(), data.size());

                // Data is now safely placed. Remove all copies and re-store
                // for clean distribution without leftover misplaced blocks.
                try {
                    scrub_client_->remove(gid);
                    scrub_client_->store(gid, data.data(), data.size());
                } catch (const std::exception &ce) {
                    // Cleanup pass failed — data is still safe from the
                    // first store(). Misplaced blocks may remain.
                    std::cerr << "[SCRUB] group " << gid
                              << " — cleanup pass failed: " << ce.what()
                              << " (data is safe)" << std::endl;
                }
                result.groups_repaired++;

                std::cerr << "[SCRUB] group " << gid << " — repaired" << std::endl;