Răsfoiți Sursa

cpg: Fix stale state after leaving a group

Since v3.0.3, corosync never resets the state of a connection that left
a group with cpg_leave(). Commit 1e2df0ba0 ("cpg: Add more comments to
notify_lib_joinlist") turned the reset of left_list[0] into a loop over
left_list, but bounded it by joined_list_entries. No caller passes both
lists, so the loop never runs for a leave. For the same reason, it
never read past the end of left_list either.

The connection thus stays in CPD_STATE_LEAVE_STARTED with its old pid
and group name. It keeps receiving messages and configuration changes
of the group it left. Joining that group again fails with CS_ERR_EXIST,
because the duplicate check matches the connection's own stale entry.
Joining any other group gets CS_ERR_BUSY, which cpg_join() retries
without delay, so the call never returns and keeps both the client and
corosync busy.

Bound the loop by left_list_entries, restoring the behavior from before
v3.0.3.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Thomas Lamprecht 4 zile în urmă
părinte
comite
3f632a85a8
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      exec/cpg.c

+ 1 - 1
exec/cpg.c

@@ -781,7 +781,7 @@ static int notify_lib_joinlist(
 		 *  contains exactly one process running on local node or more items
 		 *  but none of them is running on local node)
 		 */
-		for (i = 0; i < joined_list_entries; i++) {
+		for (i = 0; i < left_list_entries; i++) {
 			if (left_list[i].nodeid == api->totem_nodeid_get() &&
 			    left_list[i].reason == CONFCHG_CPG_REASON_LEAVE) {
 				qb_list_for_each(iter, &cpg_pd_list_head) {