Commit 5019a460 authored by jan.koester's avatar jan.koester
Browse files

test

parent 9e94b507
Loading
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -607,8 +607,31 @@ namespace authdb {
                    }
                }

                // Verify local store is writable
                bool store_ok = true;
                if (store_) {
                    try {
                        // Write and remove a sentinel block to test I/O
                        const uint64_t sentinel_gid = 0;
                        const uint32_t sentinel_idx = UINT32_MAX;
                        uint8_t probe = 0x01;
                        store_ok = store_->store(sentinel_gid, sentinel_idx, &probe, 1);
                        if (store_ok)
                            store_->remove_group(sentinel_gid);
                    } catch (...) {
                        store_ok = false;
                    }
                    if (!store_ok && !critical_) {
                        std::cerr << "Cluster: CRITICAL — local store not writable"
                                  << std::endl;
                    }
                }

                bool was_critical = critical_;
                if (health.nodes_online >= n) {
                if (!store_ok) {
                    degraded_ = true;
                    critical_ = true;
                } else if (health.nodes_online >= n) {
                    if (degraded_) {
                        std::cerr << "Cluster: recovered — all "
                                  << health.nodes_online << "/" << n