Commit 032356ab authored by jan.koester's avatar jan.koester
Browse files

tes

parent 39089205
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1092,14 +1092,20 @@ namespace authdb {
            }
        }

        // 3. Vacuum all nodes to reclaim space from overwritten blocks
        if (result.groups_repaired > 0) {
        // 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) {
            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;