Flip fallback coverage model: each host defines its own recovery profile
Previously HOST1 defined what it would run for HOST2 (FALLBACK_HOST1_COVERS_HOST2_TIER*).
Now each host defines what it wants run when IT goes down (FALLBACK_HOST1_TIER*), and the
covering server reads the down host's conf via the RAM/persistent cache.
get_tier_containers() reads FALLBACK_${REMOTE_ID}_TIER* instead of
FALLBACK_${MY_ID}_COVERS_${REMOTE_ID}_TIER*. Tier data migrated to the correct host confs.
Writeback paths and delays were already REMOTE_ID-based — no change needed there.
This commit is contained in:
@@ -67,11 +67,10 @@ function vv_fb_remote_running(string $ip, string $sshKey): array {
|
||||
// ── Covers — what a node runs for the other when it's down ───────────────────
|
||||
|
||||
function vv_fb_covers(string $covering, string $remote, string $coveringRaw, string $remoteRaw): array {
|
||||
$cu = strtoupper($covering); // HOST1
|
||||
$ru = strtoupper($remote); // HOST2
|
||||
$ru = strtoupper($remote); // HOST2 — covered host owns its own tier lists
|
||||
$tiers = [];
|
||||
for ($t = 1; $t <= 4; $t++) {
|
||||
$tiers["tier$t"] = vv_fb_bash_array($coveringRaw, "FALLBACK_{$cu}_COVERS_{$ru}_TIER{$t}");
|
||||
$tiers["tier$t"] = vv_fb_bash_array($remoteRaw, "FALLBACK_{$ru}_TIER{$t}");
|
||||
}
|
||||
// Delays: how long the remote (covered) host must be down before each tier fires.
|
||||
// Stored in the *remote* host's conf as REMOTE_TIER*_DELAY.
|
||||
|
||||
Reference in New Issue
Block a user