Przeglądaj źródła

RRP: Fix ring initialization issue for UDPU mode

Redundant ring has some problem in the UDP unicast mode. The problem
is the second ring has not been successfully initialized, that is, the
second time iface_changes happens, the member list for that interface
has not been added, which results in that ring cannot transmit normal
message. So the second ring cannot take over the work if the first
ring is down. This patch fixes this issue.

comments from review:
More work is needed probably in totemnet where totemnet maintains the
the of node list and an iterator for them, and totemudpu_member_add adds
state information to a context for the iteration.

In any regard, that is somewhat difficult to test, so I'll merge this
patch for now - keep in mind interface changes on the bindnetaddr will
cause problems with udpu after this patch has been commmitted.

Signed-off-by: Jiaju Zhang <jjzhang@suse.de>
Reviewed-by: Steven Dake <sdake@redhat.com>
(cherry picked from commit c6bfc6b5d62d19686104265e8a1b2409f4c1eaf8)
Jiaju Zhang 14 lat temu
rodzic
commit
ea058b299d
1 zmienionych plików z 7 dodań i 5 usunięć
  1. 7 5
      exec/totemsrp.c

+ 7 - 5
exec/totemsrp.c

@@ -4401,17 +4401,19 @@ void main_iface_change_fn (
 			"Created or loaded sequence id %lld.%s for this ring.\n",
 			instance->my_ring_id.seq,
 			totemip_print (&instance->my_ring_id.rep));
-		for (i = 0; i < instance->totem_config->interfaces[iface_no].member_count; i++) {
-			totemsrp_member_add (instance,
-				&instance->totem_config->interfaces[iface_no].member_list[i],
-				iface_no);
 
-		}
 		if (instance->totemsrp_service_ready_fn) {
 			instance->totemsrp_service_ready_fn ();
 		}
 
 	}
+
+	for (i = 0; i < instance->totem_config->interfaces[iface_no].member_count; i++) {
+		totemsrp_member_add (instance,
+			&instance->totem_config->interfaces[iface_no].member_list[i],
+			iface_no);
+	}
+
 	if (instance->iface_changes >= instance->totem_config->interface_count) {
 		memb_state_gather_enter (instance, 15);
 	}