Loading src/cluster.cpp +6 −13 Original line number Diff line number Diff line Loading @@ -1094,7 +1094,7 @@ namespace authdb { << " data groups across " << n << " nodes" << " (skipped " << session_gids.size() << " session groups)" << std::endl; // 2. For each group, check block distribution and repair // 2. Repair under-replicated AND rebalance misplaced in one pass for (auto &[gid, present_nodes] : group_nodes) { result.groups_checked++; Loading @@ -1103,13 +1103,12 @@ namespace authdb { continue; } // Group is under-replicated: retrieve and re-store to fill missing nodes // Group is under-replicated or misplaced: retrieve and re-store std::cerr << "[SCRUB] group " << gid << " present on " << present_nodes.size() << "/" << n << " nodes — repairing" << std::endl; try { // Retrieve reconstructs from available shards (needs >= k) auto data = pclient_->retrieve(gid); if (data.empty()) { std::cerr << "[SCRUB] group " << gid Loading @@ -1118,8 +1117,8 @@ namespace authdb { continue; } // Re-store redistributes to all nodes (overwrites existing shards, // fills missing ones) // remove + store ensures correct block placement on all nodes pclient_->remove(gid); pclient_->store(gid, data.data(), data.size()); result.groups_repaired++; Loading @@ -1131,20 +1130,14 @@ namespace authdb { } } // 3. Rebalance: move misplaced blocks to their correct nodes auto rb = pclient_->rebalance(); result.groups_repaired += rb.rebalanced; result.groups_failed += rb.failed; // 4. Vacuum all nodes to reclaim space from overwritten / deleted blocks if (result.groups_repaired > 0 || rb.rebalanced > 0) { // 3. Vacuum all nodes to reclaim space from overwritten / deleted blocks if (result.groups_repaired > 0) { pclient_->vacuum_all_nodes(); recovery_epoch_.fetch_add(1); } std::cerr << "[SCRUB] complete: checked=" << result.groups_checked << " repaired=" << result.groups_repaired << " rebalanced=" << rb.rebalanced << " failed=" << result.groups_failed << std::endl; return result; Loading Loading
src/cluster.cpp +6 −13 Original line number Diff line number Diff line Loading @@ -1094,7 +1094,7 @@ namespace authdb { << " data groups across " << n << " nodes" << " (skipped " << session_gids.size() << " session groups)" << std::endl; // 2. For each group, check block distribution and repair // 2. Repair under-replicated AND rebalance misplaced in one pass for (auto &[gid, present_nodes] : group_nodes) { result.groups_checked++; Loading @@ -1103,13 +1103,12 @@ namespace authdb { continue; } // Group is under-replicated: retrieve and re-store to fill missing nodes // Group is under-replicated or misplaced: retrieve and re-store std::cerr << "[SCRUB] group " << gid << " present on " << present_nodes.size() << "/" << n << " nodes — repairing" << std::endl; try { // Retrieve reconstructs from available shards (needs >= k) auto data = pclient_->retrieve(gid); if (data.empty()) { std::cerr << "[SCRUB] group " << gid Loading @@ -1118,8 +1117,8 @@ namespace authdb { continue; } // Re-store redistributes to all nodes (overwrites existing shards, // fills missing ones) // remove + store ensures correct block placement on all nodes pclient_->remove(gid); pclient_->store(gid, data.data(), data.size()); result.groups_repaired++; Loading @@ -1131,20 +1130,14 @@ namespace authdb { } } // 3. Rebalance: move misplaced blocks to their correct nodes auto rb = pclient_->rebalance(); result.groups_repaired += rb.rebalanced; result.groups_failed += rb.failed; // 4. Vacuum all nodes to reclaim space from overwritten / deleted blocks if (result.groups_repaired > 0 || rb.rebalanced > 0) { // 3. Vacuum all nodes to reclaim space from overwritten / deleted blocks if (result.groups_repaired > 0) { pclient_->vacuum_all_nodes(); recovery_epoch_.fetch_add(1); } std::cerr << "[SCRUB] complete: checked=" << result.groups_checked << " repaired=" << result.groups_repaired << " rebalanced=" << rb.rebalanced << " failed=" << result.groups_failed << std::endl; return result; Loading