feat: remove peers (CLI + HTTP) so retired nodes stop being retried #10
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Peers are only ever merged (
UpsertPeer/MergePeer), so a node that moves address or is decommissioned stays in thepeerstable 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) loggedconnect: no route to hostevery minute for weeks. The only fix was editing SQLite by hand.Change
KnoxDB.DeletePeer(identifier)— deletes by exactpeer_idor exactaddr.DELETE /v1/peers/{peer_id}andDELETE /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 inKNOX_PEERSand would therefore be re-learned.Note
Deletion is not permanent against a static seed:
KNOX_PEERSis re-merged on the next sweep, so a seeded peer must also leave the environment.