fix(server): back off commit retries after store failures; sharpen fault drill
The first dev drill showed a full volume driving ~140 refused publications a second. Commit retries now back off 100 ms doubling to a 2 s cap, reset on the next confirmed commit. fault-drill.sh reports the empty-volume pod's exit code, restarts and logs, and prints node-specific iptables rules for db-outage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -144,8 +144,18 @@ if [ "$scenario" = empty ] || [ "$scenario" = all ]; then
|
||||
sleep 45
|
||||
if ready_pod "$pod" 1 > /dev/null; then fail "empty: a host became Ready on an empty volume"; fi
|
||||
empty_pod="$(current_pods | grep -v "^$pod$" | head -1)"
|
||||
quarantined="$("${k[@]}" logs -n "$ns" "$empty_pod" --previous 2>/dev/null | grep -c '^phase quarantined' || true)"
|
||||
say "empty pod=$empty_pod ready=never quarantined_lines=$quarantined"
|
||||
[ -n "$empty_pod" ] || fail "empty: no replacement pod was created"
|
||||
# Evidence: the container's exits (4 = quarantined) and both of its logs.
|
||||
"${k[@]}" logs -n "$ns" "$empty_pod" > "$work/$empty_pod.current.log" 2>&1 || true
|
||||
"${k[@]}" logs -n "$ns" "$empty_pod" --previous > "$work/$empty_pod.previous.log" 2>&1 || true
|
||||
restarts="$("${k[@]}" get pod -n "$ns" "$empty_pod" -o jsonpath='{.status.containerStatuses[0].restartCount}')"
|
||||
exit_code="$("${k[@]}" get pod -n "$ns" "$empty_pod" -o jsonpath='{.status.containerStatuses[0].lastState.terminated.exitCode}')"
|
||||
quarantined="$(cat "$work/$empty_pod.current.log" "$work/$empty_pod.previous.log" | grep -c '^phase quarantined' || true)"
|
||||
say "empty pod=$empty_pod ready=never restarts=${restarts:-0} last_exit=${exit_code:-none} quarantined_lines=$quarantined"
|
||||
say "empty last log lines:"; tail -n 5 "$work/$empty_pod.previous.log" "$work/$empty_pod.current.log" | sed 's/^/ /'
|
||||
if [ "${exit_code:-}" != 4 ] && [ "$quarantined" -eq 0 ]; then
|
||||
say "WARN empty: no quarantine evidence (exit 4 or a 'phase quarantined' line); see the logs above"
|
||||
fi
|
||||
"${k[@]}" patch -n "$ns" deployment/evo-region --type json -p \
|
||||
'[{"op":"replace","path":"/spec/template/spec/volumes/0","value":{"name":"objects","persistentVolumeClaim":{"claimName":"aevolution-objects"}}}]' > /dev/null
|
||||
loaded_pod "$empty_pod"; pod="$POD"
|
||||
@@ -157,7 +167,13 @@ fi
|
||||
if [ "$scenario" = db-outage ]; then
|
||||
sleep 5
|
||||
epoch0="$(metric "$pod" evo_region_lease_epoch)"
|
||||
say "block the database from the store node for at least 30 s now (lease 20 s), then lift it."
|
||||
node="$("${k[@]}" get pod -n "$ns" "$pod" -o jsonpath='{.spec.nodeName}')"
|
||||
node_ip="$("${k[@]}" get node "$node" -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}')"
|
||||
# The pod reaches the database from its node's address (egress is SNATed off-cluster).
|
||||
say "pod $pod runs on $node ($node_ip). On the database VM, block it for at least 30 s (lease 20 s):"
|
||||
say " sudo iptables -I INPUT -s $node_ip -p tcp --dport 5432 -j DROP"
|
||||
say " then lift it with:"
|
||||
say " sudo iptables -D INPUT -s $node_ip -p tcp --dport 5432 -j DROP"
|
||||
say "waiting for the host to lose readiness..."
|
||||
for _ in $(seq 1 600); do [ "$(metric "$pod" evo_region_ready)" = 0 ] && break; sleep 0.5; done
|
||||
[ "$(metric "$pod" evo_region_ready)" = 0 ] || fail "db-outage: host stayed ready"
|
||||
|
||||
Reference in New Issue
Block a user