mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-12 22:33:54 -04:00
The membership tick's call to PurgeDepartedBefore was the only production wiring this change introduced, and removing it left the suite green. A retention nothing applies is a departure that never ages out, which is the state the sweep's held-ness filter exists to make reachable at all. A spec now ages a released row past DepartedRetention on the database clock, starts a real Membership, and waits for the row to go. Release and Deregister leaned on "no owner id is ever empty" to avoid touching an already-departed row, which is the accident Owner refuses to lean on. A departed row keeps its epoch and carries an empty owner, so a release or a deregistration naming an empty id matched it and stamped a fresh departure over the old one, making a worker that left long ago look like one that has only just gone. Both now filter on connectionIsHeld. The comment on DisconnectedAt claimed a held row never carries a departure. A binary from before this column existed claims without clearing the stamp, so a rolling upgrade produces exactly that row. The comment now says what holds, and says to ask held-ness first and read the stamp second. The sweep's vocabulary follows the code: it records departures where the comments still said it deleted rows, and its log line separates the instance rows it deleted from the connection rows it left behind. Assisted-by: Claude Opus 5 [claude-code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io>