forked from pool/corosync
Accepting request 536229 from home:BinLiu:branches:network:ha-clustering:Factory
OBS-URL: https://build.opensuse.org/request/show/536229 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=114
This commit is contained in:
parent
4560e27e9c
commit
c548204c02
@ -1,80 +0,0 @@
|
||||
From c1d0a5fe6380b007dd31f85a07b4aaca57eb14a2 Mon Sep 17 00:00:00 2001
|
||||
From: Bin Liu <bliu@suse.com>
|
||||
Date: Wed, 7 Jun 2017 13:46:25 +0800
|
||||
Subject: [PATCH] votequorum: Report errors from
|
||||
votequorum_exec_send_reconfigure
|
||||
|
||||
If votequorum_exec_send_reconfigure() returns an error (ie the
|
||||
packet could not be sent) then we should either return it to the
|
||||
sender (for a library call) or, for an internal call, log it.
|
||||
---
|
||||
exec/votequorum.c | 30 ++++++++++++++++++++----------
|
||||
1 file changed, 20 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/exec/votequorum.c b/exec/votequorum.c
|
||||
index d29a717f..e85c07d3 100644
|
||||
--- a/exec/votequorum.c
|
||||
+++ b/exec/votequorum.c
|
||||
@@ -1559,8 +1559,10 @@ static void votequorum_refresh_config(
|
||||
if (strcmp(key_name, "quorum.cancel_wait_for_all") == 0 &&
|
||||
cancel_wfa >= 1) {
|
||||
icmap_set_uint8("quorum.cancel_wait_for_all", 0);
|
||||
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA,
|
||||
- us->node_id, 0);
|
||||
+ if (votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA,
|
||||
+ us->node_id, 0)) {
|
||||
+ log_printf(LOGSYS_LEVEL_ERROR, "Failed to send Cancel WFA message to other nodes");
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1578,12 +1580,16 @@ static void votequorum_refresh_config(
|
||||
votequorum_exec_send_nodeinfo(us->node_id);
|
||||
votequorum_exec_send_nodeinfo(VOTEQUORUM_QDEVICE_NODEID);
|
||||
if (us->votes != old_votes) {
|
||||
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES,
|
||||
- us->node_id, us->votes);
|
||||
+ if(votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES,
|
||||
+ us->node_id, us->votes)) {
|
||||
+ log_printf(LOGSYS_LEVEL_ERROR, "Failed to send new votes message to other nodes");
|
||||
+ }
|
||||
}
|
||||
if (us->expected_votes != old_expected_votes) {
|
||||
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES,
|
||||
- us->node_id, us->expected_votes);
|
||||
+ if(votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES,
|
||||
+ us->node_id, us->expected_votes)) {
|
||||
+ log_printf(LOGSYS_LEVEL_ERROR, "Failed to send new votes message to other nodes");
|
||||
+ }
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
@@ -2610,8 +2616,10 @@ static void message_handler_req_lib_votequorum_setexpected (void *conn, const vo
|
||||
goto error_exit;
|
||||
}
|
||||
|
||||
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES, us->node_id,
|
||||
- req_lib_votequorum_setexpected->expected_votes);
|
||||
+ if(votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES, us->node_id,
|
||||
+ req_lib_votequorum_setexpected->expected_votes)) {
|
||||
+ error = CS_ERR_NO_RESOURCES;
|
||||
+ }
|
||||
|
||||
error_exit:
|
||||
res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
|
||||
@@ -2657,8 +2665,10 @@ static void message_handler_req_lib_votequorum_setvotes (void *conn, const void
|
||||
goto error_exit;
|
||||
}
|
||||
|
||||
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES, nodeid,
|
||||
- req_lib_votequorum_setvotes->votes);
|
||||
+ if(votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES, nodeid,
|
||||
+ req_lib_votequorum_setvotes->votes)) {
|
||||
+ error = CS_ERR_NO_RESOURCES;
|
||||
+ }
|
||||
|
||||
error_exit:
|
||||
res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
|
||||
--
|
||||
2.12.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user