Commit 94c9d8a2 authored by jan.koester's avatar jan.koester
Browse files

test

parent 8e386b2a
Loading
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -659,12 +659,19 @@ namespace authdb {
                    if (degraded_) {
                        std::cerr << "Cluster: recovered — all "
                                  << health.nodes_online << "/" << n
                                  << " nodes online, starting scrub" << std::endl;
                                  << " nodes online";
                        recovery_epoch_.fetch_add(1);
                        // Auto-scrub after recovery to rebalance shards
                        // Auto-scrub after recovery — but only when domain
                        // backends are loaded, otherwise scrub would treat
                        // all domain groups as orphaned and delete them.
                        if (domains_ready_.load()) {
                            std::cerr << ", starting scrub" << std::endl;
                            std::thread([this](){
                                try { scrub(); } catch (...) {}
                            }).detach();
                        } else {
                            std::cerr << " (scrub deferred — domains not ready)" << std::endl;
                        }
                        healthy_cycles = 0;
                    }
                    degraded_ = false;