fix(metrics): scope the seed to one named replica #45
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/vm-restore-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The first guard tested for
/storage/data, which vmsingle creates on an empty volume, so the seed skipped itself on the very replica it was written for.Size is no better:
victoriametrics-1had already collected 1.3 GB from vmagent in the hour since its volume was replaced, against about 19 GB on a populated replica, and it keeps growing.Guard on the pod name instead.
SEED_PODnames the one replica to seed and every other pod exits immediately, so this can never overwrite a replica holding the only good copy. A sentinel file makes the seeded pod idempotent across restarts.vmrestore wants an empty target, so the seeded replicas directory is cleared first. Nothing unique is lost: vmagent dual-writes every sample to both replicas, so whatever this replica collected is a strict subset of the source.
A fresh 19 GB backup of replica 0 was taken at 20:56 so the seed is current rather than four hours stale.
https://claude.ai/code/session_01MdSbMhzabSbpG8TtP9Ur3H