feat: add live sync retry backoff

This commit is contained in:
Eric Wendland 2026-07-05 22:57:52 +02:00
commit 2dce1f41cf
8 changed files with 225 additions and 31 deletions

View file

@ -150,10 +150,13 @@ still verified against trusted-admin OpenSSH signatures before import.
Operators can run `geth sync now [node]` to trigger the same best-effort pass
immediately and `geth sync status` to inspect locally recorded last-attempt,
last-success, cursor, import/rejection counts, and errors for each peer stream.
JSON status also includes `state`, `stale`, `stale_after_ms`, and `next_action`
fields so scripts can fail on unhealthy streams. Common daemon errors include a
`next:` recovery line for missing peer cards, missing grants, missing resources,
unavailable endpoints, and missing DB/KV/document registrations.
JSON status also includes `state`, `stale`, `stale_after_ms`,
`consecutive_failures`, `retry_after_ms`, `retry_in_ms`, and `next_action`
fields so scripts can fail on unhealthy streams. Background live-sync backs off
failed streams without blocking explicit `geth sync now [node]` retries. Common
daemon errors include a `next:` recovery line for missing peer cards, missing
grants, missing resources, unavailable endpoints, and missing DB/KV/document
registrations.
Host-opening paths are intentionally narrow. TCP pipe forwarding accepts only
explicit loopback socket addresses on both the local listener and remote target;

View file

@ -228,11 +228,11 @@ Goal: make convergence and failure behavior predictable enough for automation.
- `[x]` Document merge semantics are documented and tested.
- `[x]` DB change application limits are documented and tested.
- `[ ]` Add live-sync retry and backoff policy.
- `[x]` Add live-sync retry and backoff policy.
Acceptance criteria:
- `[ ]` Failed peer streams back off without starving healthy streams.
- `[ ]` Retry state appears in `geth sync status --json`.
- `[ ]` Operators can trigger immediate retry with `geth sync now`.
- `[x]` Failed peer streams back off without starving healthy streams.
- `[x]` Retry state appears in `geth sync status --json`.
- `[x]` Operators can trigger immediate retry with `geth sync now`.
## Phase 7: Script And Automation UX

View file

@ -389,8 +389,10 @@ geth-to-geth connections without granting trust from discovery alone.
watermark has not advanced.
- `[x]` `geth sync status` reports last local attempt, success, cursor,
import/rejection counts, and error for each recorded peer stream.
- `[x]` Failed background live-sync streams record consecutive failures and
retry-after metadata.
- `[x]` `geth sync now [node]` triggers the same best-effort sync pass that
background live sync uses.
background live sync uses, bypassing stream backoff for operator retries.
- `[x]` Tests verify unauthorized streams are omitted from summary output.
- `[x]` Tests verify persisted stream health is exposed in local sync status.