Parcourir la source

config: Disallow corosync-cmapctl updates of nodelist

It didn't work anyway (the config system requires whole links
to be configured at once) and caused crashes.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Christine Caulfield il y a 7 ans
Parent
commit
e6be234565
3 fichiers modifiés avec 3 ajouts et 92 suppressions
  1. 1 0
      exec/main.c
  2. 0 44
      exec/totemconfig.c
  3. 2 48
      man/cmap_keys.8

+ 1 - 0
exec/main.c

@@ -1030,6 +1030,7 @@ static void set_icmap_ro_keys_flag (void)
 	icmap_set_ro_access("runtime.totem.", CS_TRUE, CS_TRUE);
 	icmap_set_ro_access("runtime.totem.", CS_TRUE, CS_TRUE);
 	icmap_set_ro_access("uidgid.config.", CS_TRUE, CS_TRUE);
 	icmap_set_ro_access("uidgid.config.", CS_TRUE, CS_TRUE);
 	icmap_set_ro_access("system.", CS_TRUE, CS_TRUE);
 	icmap_set_ro_access("system.", CS_TRUE, CS_TRUE);
+	icmap_set_ro_access("nodelist.", CS_TRUE, CS_TRUE);
 
 
 	/*
 	/*
 	 * Set RO flag for constrete keys of configuration which can't be changed
 	 * Set RO flag for constrete keys of configuration which can't be changed

+ 0 - 44
exec/totemconfig.c

@@ -1293,44 +1293,6 @@ static int put_nodelist_members_to_config(struct totem_config *totem_config, int
 	return 0;
 	return 0;
 }
 }
 
 
-static void nodelist_dynamic_notify(
-	int32_t event,
-	const char *key_name,
-	struct icmap_notify_value new_val,
-	struct icmap_notify_value old_val,
-	void *user_data)
-{
-	int res;
-	unsigned int ring_no;
-	unsigned int member_no;
-	char tmp_str[ICMAP_KEYNAME_MAXLEN];
-	uint8_t reloading;
-	const char *error_string;
-	struct totem_config *totem_config = (struct totem_config *)user_data;
-
-	/*
-	* If a full reload is in progress then don't do anything until it's done and
-	* can reconfigure it all atomically
-	*/
-	if (icmap_get_uint8("config.totemconfig_reload_in_progress", &reloading) == CS_OK && reloading) {
-		return ;
-	}
-
-	res = sscanf(key_name, "nodelist.node.%u.ring%u%s", &member_no, &ring_no, tmp_str);
-	if (res != 3)
-		return ;
-
-	if (strcmp(tmp_str, "_addr") != 0) {
-		return;
-	}
-
-	if (put_nodelist_members_to_config(totem_config, 1, &error_string)) {
-		log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
-	}
-}
-
-
-
 static void config_convert_nodelist_to_interface(struct totem_config *totem_config)
 static void config_convert_nodelist_to_interface(struct totem_config *totem_config)
 {
 {
 	int res = 0;
 	int res = 0;
@@ -2217,10 +2179,4 @@ static void add_totem_config_notification(struct totem_config *totem_config)
 		totem_reload_notify,
 		totem_reload_notify,
 		totem_config,
 		totem_config,
 		&icmap_track);
 		&icmap_track);
-
-	icmap_track_add("nodelist.node.",
-		ICMAP_TRACK_ADD | ICMAP_TRACK_DELETE | ICMAP_TRACK_MODIFY | ICMAP_TRACK_PREFIX,
-		nodelist_dynamic_notify,
-		(void *)totem_config,
-		&icmap_track);
 }
 }

+ 2 - 48
man/cmap_keys.8

@@ -65,7 +65,8 @@ key is same as in the configuration file. All values are of string type.
 
 
 .TP
 .TP
 nodelist.*
 nodelist.*
-Values read from the configuration file. Each node element in the configuration file gets
+Values are read from the configuration file only (dynamic updates are not allowed).
+Each node element in the configuration file gets
 assigned its position starting from zero. So the first node from the config file has
 assigned its position starting from zero. So the first node from the config file has
 nodelist.node.0. prefix. To be a valid entry, each node must have
 nodelist.node.0. prefix. To be a valid entry, each node must have
 .B ring0_addr
 .B ring0_addr
@@ -389,53 +390,6 @@ For removal of permissions, simply delete the key
 .br
 .br
 # corosync-cmapctl -d uidgid.gid.500
 # corosync-cmapctl -d uidgid.gid.500
 
 
-.SH DYNAMIC ADD/REMOVE OF UDPU NODE
-Eg. To add the node with address 10.34.38.108
-and nodeid 3. This node is called NEW and it's not running corosync yet.
-
-.PP
-* Find a node position in the node list which is not used yet. It's recommended that you
-use highest_number + 1. Let's say output of corosync-cmapctl looks like:
-
-.br
-nodelist.local_node_pos (u32) = 1
-.br
-nodelist.node.0.nodeid (u32) = 1
-.br
-nodelist.node.0.ring0_addr (str) = 10.34.38.106
-.br
-nodelist.node.1.nodeid (u32) = 2
-.br
-nodelist.node.1.ring0_addr (str) = 10.34.38.107
-
-So next node position will be 2.
-.PP
-* Add all entries needed for the node on all running nodes, as:
-
-.br
-# corosync-cmapctl -s nodelist.node.2.nodeid u32 3
-.br
-# corosync-cmapctl -s nodelist.node.2.ring0_addr str 10.34.38.108
-
-Always add the ring0_addr key last. The Corosync engine on all nodes should reply
-with
-.I notice  [TOTEM ] adding new UDPU member {10.34.38.108}
-message.
-.PP
-* Add node information to the configuration file on all nodes so that it
-will survive a restart of corosync.
-.PP
-* Copy and edit configuration file to the NEW node.
-.PP
-* Start corosync on the NEW node.
-
-Removal of a UDPU node is a very similar, slightly reversed action, so
-.PP
-* Stop corosync on the OLD node.
-.PP
-* Remove the relevant entries from cmap on all nodes.
-.PP
-* Change the configuration file on all nodes.
 
 
 .SH "SEE ALSO"
 .SH "SEE ALSO"
 .BR corosync_overview (7),
 .BR corosync_overview (7),