Memory-backed member that loses its data on node reboot crash-loops; manual removal wedges the finalizer on 'member not found'

Aperta
#383 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, kubernetes

Direzione di ricerca

Start with controllers/etcdmember_controller.go and trace removeMemberFromEtcd and resolveMemberID, then check the member reconciliation and storage configuration paths for memory-backed members. The issue proposes treating MemberNotFound as success and detecting data loss after a node reboot, but leaves the detection and replacement design open. Done means the member can be replaced and the cluster returns to its expected size without a stuck finalizer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

With storage.medium: Memory, a member whose node reboots comes back with an empty data dir but keeps its etcd member ID. It panics on the leader's first append (tocommit(N) is out of range [lastIndex(0)]) and crash-loops. The operator reports Degraded: 2/3 members ready and does not replace it.

Removing the dead member by hand (etcdctl member remove <id>, then deleting the Pod) then wedges the member finalizer: removeMemberFromEtcd calls MemberRemove(status.MemberID), etcd answers member not found, and the reconciler logs failed to remove member from etcd, will retry every 5 s. The EtcdCluster logs waiting for in-flight member deletion before further scaling, so no replacement is created until the finalizer is removed by hand. After that, the operator scales back to 3/3.

Seen with v0.5.4; controllers/etcdmember_controller.go on main has the same logic.

Proposals

  1. Treat rpctypes.ErrGRPCMemberNotFound from MemberRemove as success; resolveMemberID already treats "not in the member list" that way when status.MemberID is empty.
  2. For memory-backed members, detect a member that restarted with an empty data dir (for example, its Pod's node boot ID changed) and replace it: remove the old member ID, add a new member, and start it with --initial-cluster-state=existing.
Lingua principale
Go
Stelle
154
Fork
31
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cozystack/etcd-operator

Tutte le issue di cozystack/etcd-operator

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.