Loading src/backends/cluster.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,17 @@ namespace authdb { if (!g_Cluster || !g_Cluster->isRunning()) return; // While scrub/rebuild is running, blocks may not be on all nodes // yet — skip the expensive network fetch and use cached data. if (g_Cluster->isScrubRunning()) { auto cache = getDomainCache(); if (!cache->buffer.empty() && _Buffer.size() <= sizeof(AuthHeader)) { _Buffer = cache->buffer; _ClusterDataExists.store(_Buffer.size() > sizeof(AuthHeader)); } return; } auto cache = getDomainCache(); auto now = std::chrono::steady_clock::now(); Loading src/cluster.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -676,10 +676,10 @@ namespace authdb { std::cerr << "Cluster: recovered — all " << health.nodes_online << "/" << n << " nodes online"; recovery_epoch_.fetch_add(1); // Auto-scrub after recovery — but only when domain // backends are loaded, otherwise scrub would treat // all domain groups as orphaned and delete them. // Do NOT bump recovery_epoch_ here — wait until // scrub has repaired/rebalanced data so that // backends don't attempt fetches before blocks // are available on all nodes. if (domains_ready_.load()) { std::cerr << ", starting scrub" << std::endl; std::thread([this](){ Loading @@ -687,6 +687,9 @@ namespace authdb { }).detach(); } else { std::cerr << " (scrub deferred — domains not ready)" << std::endl; // No scrub possible yet, bump epoch so backends // at least try once when domains become ready. recovery_epoch_.fetch_add(1); } healthy_cycles = 0; } Loading Loading
src/backends/cluster.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,17 @@ namespace authdb { if (!g_Cluster || !g_Cluster->isRunning()) return; // While scrub/rebuild is running, blocks may not be on all nodes // yet — skip the expensive network fetch and use cached data. if (g_Cluster->isScrubRunning()) { auto cache = getDomainCache(); if (!cache->buffer.empty() && _Buffer.size() <= sizeof(AuthHeader)) { _Buffer = cache->buffer; _ClusterDataExists.store(_Buffer.size() > sizeof(AuthHeader)); } return; } auto cache = getDomainCache(); auto now = std::chrono::steady_clock::now(); Loading
src/cluster.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -676,10 +676,10 @@ namespace authdb { std::cerr << "Cluster: recovered — all " << health.nodes_online << "/" << n << " nodes online"; recovery_epoch_.fetch_add(1); // Auto-scrub after recovery — but only when domain // backends are loaded, otherwise scrub would treat // all domain groups as orphaned and delete them. // Do NOT bump recovery_epoch_ here — wait until // scrub has repaired/rebalanced data so that // backends don't attempt fetches before blocks // are available on all nodes. if (domains_ready_.load()) { std::cerr << ", starting scrub" << std::endl; std::thread([this](){ Loading @@ -687,6 +687,9 @@ namespace authdb { }).detach(); } else { std::cerr << " (scrub deferred — domains not ready)" << std::endl; // No scrub possible yet, bump epoch so backends // at least try once when domains become ready. recovery_epoch_.fetch_add(1); } healthy_cycles = 0; } Loading