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:
@@ -75,10 +75,10 @@
|
||||
# failed handback: containers stop on the covering server, remote goes down
|
||||
# again mid-rsync. Strikes prevent this.
|
||||
#
|
||||
# MY_ID-Based Routing
|
||||
# All tier arrays, DDNS lists, and writeback paths are selected via MY_ID
|
||||
# set by detect_hosts() — not hostname string comparison. The same script
|
||||
# and same config file handle both directions symmetrically.
|
||||
# REMOTE_ID-Based Coverage Config
|
||||
# Tier arrays, writeback paths, and delays are all defined in the covered
|
||||
# host's own conf and read via REMOTE_ID — not MY_ID. Each host owns its
|
||||
# complete recovery profile. The same script handles both directions.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL SAFEGUARDS
|
||||
@@ -150,9 +150,10 @@
|
||||
# FALLBACK_HOST*_STOP_ON_NO_NET
|
||||
# Containers stopped when this host loses internet
|
||||
#
|
||||
# FALLBACK_HOST*_COVERS_HOST*_TIER1–4
|
||||
# Containers this host starts for the remote when remote is down, by tier.
|
||||
# Variable pattern: FALLBACK_${MY_ID}_COVERS_${REMOTE_ID}_TIER${N}
|
||||
# FALLBACK_HOST*_TIER1–4
|
||||
# Containers started on this host when the partner is down — defined in the
|
||||
# partner's own conf (what the partner wants covered). Read via REMOTE_ID.
|
||||
# Variable pattern: FALLBACK_${REMOTE_ID}_TIER${N}
|
||||
#
|
||||
# HOST*_TIER2_DELAY / TIER3_DELAY / TIER4_DELAY
|
||||
# Minutes after FALLBACK entry before activating each tier.
|
||||
@@ -537,8 +538,7 @@ remote_ddns_stop() {
|
||||
|
||||
get_tier_containers() {
|
||||
local tier="$1"
|
||||
local remote_id="${REMOTE_ID}"
|
||||
local var_name="FALLBACK_${MY_ID}_COVERS_${remote_id}_TIER${tier}"
|
||||
local var_name="FALLBACK_${REMOTE_ID}_TIER${tier}"
|
||||
eval "echo \"\${${var_name}[@]:-}\""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user