Просмотр исходного кода

totemconfig: Do not process totem.nodeid

totem.nodeid is relict from times when nodelist was not required and
totemsrp was sending whole membership with ip addresses.

With Corosync 3 ip addresses are no longer sent so
it is not possible to find "next" node ip address where to send token
(because only nodeid is sent) without having information about all of
the nodes stored locally.

When totem.nodeid was configured it was partly used and other parts
(most notably totemudpu_token_target_set) were using autogenerated
nodeid. Together it was not possible to create even single node
membership.

Solution is to ignore totem.nodeid completely (and display warning when
it is set).

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Jan Friesse 4 лет назад
Родитель
Сommit
6e57e5a96b
3 измененных файлов с 13 добавлено и 10 удалено
  1. 3 2
      exec/main.c
  2. 8 6
      exec/totemconfig.c
  3. 2 2
      exec/totemconfig.h

+ 3 - 2
exec/main.c

@@ -1425,8 +1425,9 @@ int main (int argc, char **argv, char **envp)
 		log_printf (LOGSYS_LEVEL_WARNING, "member section is deprecated.");
 	}
 
-	if (totem_config_warnings & TOTEM_CONFIG_WARNING_TOTEM_NODEID_IGNORED) {
-		log_printf (LOGSYS_LEVEL_WARNING, "nodeid appears both in totem section and nodelist. Nodelist one is used.");
+	if (totem_config_warnings & TOTEM_CONFIG_WARNING_TOTEM_NODEID_SET) {
+		log_printf (LOGSYS_LEVEL_WARNING, "nodeid in totem section is deprecated and ignored. "
+		    "Nodelist (or autogenerated) nodeid is going to be used.");
 	}
 
 	if (totem_config_warnings & TOTEM_CONFIG_BINDNETADDR_NODELIST_SET) {

+ 8 - 6
exec/totemconfig.c

@@ -1755,7 +1755,7 @@ extern int totem_config_read (
 	uint16_t u16;
 	int i;
 	int local_node_pos;
-	int nodeid_set;
+	uint32_t u32;
 
 	*warnings = 0;
 
@@ -1811,7 +1811,9 @@ extern int totem_config_read (
 		free(str);
 	}
 
-	icmap_get_uint32("totem.nodeid", &totem_config->node_id);
+	if (icmap_get_uint32("totem.nodeid", &u32) == CS_OK) {
+		*warnings |= TOTEM_CONFIG_WARNING_TOTEM_NODEID_SET;
+	}
 
 	totem_config->clear_node_high_bit = 0;
 	if (icmap_get_string("totem.clear_node_high_bit", &str) == CS_OK) {
@@ -1904,12 +1906,12 @@ extern int totem_config_read (
 		local_node_pos = find_local_node(icmap_get_global_map(), 1);
 		if (local_node_pos != -1) {
 
+			assert(totem_config->node_id == 0);
+
 			snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "nodelist.node.%u.nodeid", local_node_pos);
+			(void)icmap_get_uint32(tmp_key, &totem_config->node_id);
+
 
-			nodeid_set = (totem_config->node_id != 0);
-			if (icmap_get_uint32(tmp_key, &totem_config->node_id) == CS_OK && nodeid_set) {
-				*warnings |= TOTEM_CONFIG_WARNING_TOTEM_NODEID_IGNORED;
-			}
 			if ((totem_config->transport_number == TOTEM_TRANSPORT_KNET) && (!totem_config->node_id)) {
 				*error_string = "Knet requires an explicit nodeid for the local node";
 				return -1;

+ 2 - 2
exec/totemconfig.h

@@ -44,8 +44,8 @@
 
 #define TOTEM_CONFIG_WARNING_MEMBERS_IGNORED		(1<<1)
 #define TOTEM_CONFIG_WARNING_MEMBERS_DEPRECATED		(1<<2)
-#define TOTEM_CONFIG_WARNING_TOTEM_NODEID_IGNORED	(1<<3)
-#define TOTEM_CONFIG_BINDNETADDR_NODELIST_SET	(1<<4)
+#define TOTEM_CONFIG_WARNING_TOTEM_NODEID_SET		(1<<3)
+#define TOTEM_CONFIG_BINDNETADDR_NODELIST_SET		(1<<4)
 
 extern int totem_config_read (
 	struct totem_config *totem_config,