Skip to content

internal/db: Remove node from dqlite cluster on failed join#775

Draft
claudiubelu wants to merge 1 commit into
canonical:v3from
claudiubelu:v3-cleanup-dqlite
Draft

internal/db: Remove node from dqlite cluster on failed join#775
claudiubelu wants to merge 1 commit into
canonical:v3from
claudiubelu:v3-cleanup-dqlite

Conversation

@claudiubelu

Copy link
Copy Markdown
Contributor

dqlite.Close() tears down Raft connections but does not remove the node from the dqlite cluster membership. When db.Join() fails after the node has already been added to the cluster (via cli.Add in app.run), the reverter only called Close(), leaving a ghost member in dqlite.

This ghost node causes CheckMembershipConsistency to fail (the node exists in dqlite but not in core_cluster_members), which blocks token generation and all future cluster joins.

Fix the Join reverter to explicitly ask the dqlite leader to remove us before closing. Also correct a misleading comment in the Bootstrap reverter.

(cherry picked from commit f9c6754)

dqlite.Close() tears down Raft connections but does not remove the node
from the dqlite cluster membership. When db.Join() fails after the node
has already been added to the cluster (via cli.Add in app.run), the
reverter only called Close(), leaving a ghost member in dqlite.

This ghost node causes CheckMembershipConsistency to fail (the node
exists in dqlite but not in core_cluster_members), which blocks token
generation and all future cluster joins.

Fix the Join reverter to explicitly ask the dqlite leader to remove us
before closing. Also correct a misleading comment in the Bootstrap
reverter.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
(cherry picked from commit f9c6754)
@roosterfish roosterfish marked this pull request as draft July 8, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant