Add optional/ephemeral volume notation for restore resilience

Introduce x-optional-volumes for beacon sidecars (prysm, nimbus, lighthouse,
teku, lodestar) that are checkpoint-sync capable and rebuild state quickly.
Mark reth sockets volumes as ephemeral (runtime IPC artifacts).

Script changes:
- volume-utils.sh: add is_optional_volume_key() function
- restore-volumes.sh: tolerate missing optional/ephemeral volume archives
- clone-backup.sh: skip missing optional/ephemeral volumes gracefully
- list-restorable.sh: only require archives for non-optional persistent volumes

This fixes the de-25 ethereum prysm incident (entire 1.1T restore failed
due to missing prysm archive) and arc-testnet reth sockets restore loops.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-08-04 06:10:55 +00:00
parent d21f2669ae
commit d896378eb7
46 changed files with 115 additions and 14 deletions

View File

@@ -218,6 +218,22 @@ is_ephemeral_volume_key() {
return 1
}
is_optional_volume_key() {
local key=$1
local compose_file=$2
if [[ -n "$compose_file" && -f "$compose_file" ]]; then
local optional
optional=$(yaml2json < "$compose_file" 2>/dev/null | jq -r '.["x-optional-volumes"] // [] | .[]' 2>/dev/null)
while IFS= read -r vol; do
[[ -z "$vol" ]] && continue
[[ "$key" == "$vol" ]] && return 0
done <<< "$optional"
fi
return 1
}
get_volume_keys() {
local compose_file=$1
yaml2json < "$compose_file" 2>/dev/null | jq -r '.volumes | keys[]' 2>/dev/null