fix(metrics): scope the seed to one named replica #45

Merged
binjovi-bot merged 1 commit from chore/vm-restore-fix into trunk 2026-09-03 20:58:16 +00:00
Owner

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-1 had 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_POD names 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

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-1` had 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_POD` names 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
fix(metrics): scope the seed to one named replica
All checks were successful
binjovi/ci Binjovi completed the frozen plan
399f08c27d
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-1 had 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_POD names 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 replica's 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.

Claude-Session: https://claude.ai/code/session_01MdSbMhzabSbpG8TtP9Ur3H
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/olly!45
No description provided.