Skip to contentSkip to conversation

decrease expected_replies when remote node is down.

PATCH New dongmao zhang 1 participant 1 message Feb 25, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 decrease expected_replies when remote node is down.

dear list,

when clvmd is waiting for remote node's relies, but the remote node could be possiblly closed at the same time. This could result in a request timeout in mainloop. The default timeout is 60 seconds. This is still too large.

https://bugzilla.novell.com/show_bug.cgi?id=837538
https://bugzilla.novell.com/show_bug.cgi?id=862633
clvmd users usually meet this when they call LVM command(like vgscan) in one node, while other nodes's clvmd is closing.

My solution to this is to decrement in-flight request's expected_replies. The command could finish much faster in this situation. I only add this on corosync, and test it on corosync

---
 daemons/clvmd/clvmd-corosync.c |    7 ++++-
 daemons/clvmd/clvmd.c          |   53 +++++++++++++++++++++++++++++++++++++++-
 daemons/clvmd/clvmd.h          |    2 +
 3 files changed, 60 insertions(+), 2 deletions(-)
daemons/clvmd/clvmd-corosync.c +6 -1
index e68cb73..8e642ca 100644
@@ -251,11 +251,16 @@ static void corosync_cpg_confchg_callback(cpg_handle_t handle,
 		ninfo = dm_hash_lookup_binary(node_hash,
 					      (char *)&left_list[i].nodeid,
 					      COROSYNC_CSID_LEN);
-		if (ninfo)
+		if (ninfo) {
 			ninfo->state = NODE_DOWN;
+			char name[MAX_CLUSTER_MEMBER_NAME_LEN];
+			sprintf(name, "%x", ninfo->nodeid);
+			decrease_inflight_expected_reply(name);
+		}
 	}
 
 	num_nodes = member_list_entries;
+
 }
 
 static int _init_cluster(void)
daemons/clvmd/clvmd.c +52 -1

65 lines not on this page · raw message

daemons/clvmd/clvmd.h +2 -0
index 0f837dd..52e4e61 100644
@@ -112,6 +112,8 @@ extern int do_post_command(struct local_client *client);
 extern void cmd_client_cleanup(struct local_client *client);
 extern int add_client(struct local_client *new_client);
 
+
+extern void decrease_inflight_expected_reply();
 extern void clvmd_cluster_init_completed(void);
 extern void process_message(struct local_client *client, char *buf,
 			    int len, const char *csid);
Signature · 1 line
1.7.3.4