feat: remove peers (CLI + HTTP) so retired nodes stop being retried #10

Closed
opened 2026-11-05 02:19:53 +00:00 by david · 0 comments
Owner

Peers are only ever merged (UpsertPeer/MergePeer), so a node that moves address or is decommissioned stays in the peers table forever and fails on every anti-entropy sweep.

Observed in practice on the laptop node: a retired LAN peer (http://192.168.8.240:8931) logged connect: no route to host every minute for weeks. The only fix was editing SQLite by hand.

Change

  • KnoxDB.DeletePeer(identifier) — deletes by exact peer_id or exact addr.
  • DELETE /v1/peers/{peer_id} and DELETE /v1/peers?addr=<url> on the gossip API (protected by the existing bearer-token middleware, like every other route).
  • knox gossip peer list / knox gossip peer rm <peer-id|address>, which warns when the removed address is still in KNOX_PEERS and would therefore be re-learned.

Note

Deletion is not permanent against a static seed: KNOX_PEERS is re-merged on the next sweep, so a seeded peer must also leave the environment.

Peers are only ever merged (`UpsertPeer`/`MergePeer`), so a node that moves address or is decommissioned stays in the `peers` table forever and fails on every anti-entropy sweep. Observed in practice on the laptop node: a retired LAN peer (`http://192.168.8.240:8931`) logged `connect: no route to host` every minute for weeks. The only fix was editing SQLite by hand. ## Change - `KnoxDB.DeletePeer(identifier)` — deletes by exact `peer_id` or exact `addr`. - `DELETE /v1/peers/{peer_id}` and `DELETE /v1/peers?addr=<url>` on the gossip API (protected by the existing bearer-token middleware, like every other route). - `knox gossip peer list` / `knox gossip peer rm <peer-id|address>`, which warns when the removed address is still in `KNOX_PEERS` and would therefore be re-learned. ## Note Deletion is not permanent against a static seed: `KNOX_PEERS` is re-merged on the next sweep, so a seeded peer must also leave the environment.
david closed this issue 2026-11-05 02:27:53 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: david/knox#10