Procházet zdrojové kódy

main: Display reason why cluster cannot be formed

(backported from master 95b91e4ae7246e3d780ad04ef7f629c959d949a4)

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Jan Friesse před 8 roky
rodič
revize
d87bc9d437
1 změnil soubory, kde provedl 13 přidání a 2 odebrání
  1. 13 2
      exec/main.c

+ 13 - 2
exec/main.c

@@ -473,6 +473,7 @@ static void corosync_totem_stats_updater (void *data)
 	int t, prev, i;
 	int32_t token_count;
 	char key_name[ICMAP_KEYNAME_MAXLEN];
+	const char *cstr;
 
 	stats = api->totem_get_stats();
 
@@ -510,11 +511,21 @@ static void corosync_totem_stats_updater (void *data)
 
 	if (stats->mrp->srp->continuous_gather > MAX_NO_CONT_GATHER ||
 	    stats->mrp->srp->continuous_sendmsg_failures > MAX_NO_CONT_SENDMSG_FAILURES) {
+		cstr = "";
+
+		if (stats->mrp->srp->continuous_sendmsg_failures > MAX_NO_CONT_SENDMSG_FAILURES) {
+			cstr = "number of multicast sendmsg failures is above threshold";
+		}
+
+		if (stats->mrp->srp->continuous_gather > MAX_NO_CONT_GATHER) {
+			cstr = "totem is continuously in gather state";
+		}
+
 		log_printf (LOGSYS_LEVEL_WARNING,
 			"Totem is unable to form a cluster because of an "
-			"operating system or network fault. The most common "
+			"operating system or network fault (reason: %s). The most common "
 			"cause of this message is that the local firewall is "
-			"configured improperly.");
+			"configured improperly.", cstr);
 		icmap_set_uint8("runtime.totem.pg.mrp.srp.firewall_enabled_or_nic_failure", 1);
 	} else {
 		icmap_set_uint8("runtime.totem.pg.mrp.srp.firewall_enabled_or_nic_failure", 0);