Accepting request 487284 from home:BinLiu:branches:network:ha-clustering:Factory

Added:0001-totemconfig.c-Fixed-Evicted-from-CPG-membership.patch
   removed: 0001-totemip.c-Fixed-Evicted-from-CPG-membership.patch

OBS-URL: https://build.opensuse.org/request/show/487284
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=84
This commit is contained in:
Bin Liu 2017-04-11 10:29:05 +00:00 committed by Git OBS Bridge
parent 8a649b990e
commit 3a011e8578
4 changed files with 75 additions and 115 deletions

View File

@ -0,0 +1,72 @@
From 622a4a629346f3b52ecac140ab99fb3023dca8f9 Mon Sep 17 00:00:00 2001
From: Bin Liu <bliu@suse.com>
Date: Tue, 11 Apr 2017 16:57:55 +0800
Subject: [PATCH] totemconfig.c: Fixed Evicted from CPG membership
---
exec/main.c | 4 ++++
exec/totemconfig.c | 13 ++++++++++++-
exec/totemconfig.h | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/exec/main.c b/exec/main.c
index 0ca5634a..f09b73cf 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -1261,6 +1261,10 @@ int main (int argc, char **argv, char **envp)
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_BINDNETADDR_NODELIST_SET) {
+ log_printf (LOGSYS_LEVEL_WARNING, "%s", "interface section bindnetaddr is used together with nodelist. "
+ "Nodelist one is going to be used.");
+ }
if (totem_config_warnings != 0) {
log_printf (LOGSYS_LEVEL_WARNING, "Please migrate config file to nodelist.");
diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index f232ea8f..305a7fe4 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -975,7 +975,7 @@ extern int totem_config_read (
uint64_t *warnings)
{
int res = 0;
- char *str;
+ char *str, *ring0_addr_str;
unsigned int ringnumber = 0;
int member_count = 0;
icmap_iter_t iter, member_iter;
@@ -1048,6 +1048,17 @@ extern int totem_config_read (
*/
config_convert_nodelist_to_interface(totem_config);
} else {
+ if (icmap_get_string("nodelist.node.0.ring0_addr", &ring0_addr_str) == CS_OK) {
+ /*
+ * Both bindnetaddr and ring0_addr are set.
+ * Log warning information, and use nodelist instead
+ */
+ *warnings |= TOTEM_CONFIG_BINDNETADDR_NODELIST_SET;
+
+ config_convert_nodelist_to_interface(totem_config);
+
+ free(ring0_addr_str);
+ }
free(str);
}
diff --git a/exec/totemconfig.h b/exec/totemconfig.h
index 10607cc2..368ecabf 100644
--- a/exec/totemconfig.h
+++ b/exec/totemconfig.h
@@ -46,6 +46,7 @@
#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)
extern int totem_config_read (
struct totem_config *totem_config,
--
2.12.0

View File

@ -1,113 +0,0 @@
From 557370ad7a68d6a9676d3d029262f481b85be181 Mon Sep 17 00:00:00 2001
From: Bin Liu <bliu@suse.com>
Date: Mon, 10 Apr 2017 10:45:10 +0800
Subject: [PATCH] totemip.c: Fixed Evicted from CPG membership
In a two-node cluster, I 've one node configured with open-vswtich:
5: br-fixed: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
inet 192.168.124.88/24 scope global br-fixed
inet 192.168.124.87/24 scope global secondary br-fixed
inet 192.168.124.83/24 brd 192.168.124.255 scope global secondary tentative br-fixed
inet 192.168.124.89/24 scope global secondary br-fixed
while I use 192.168.124.83 in node list of corosync.conf with udpu, and the bind_addr is
192.168.124.0. After upgrading corosync on this node, the it uses 192.168.124.88 instead
of 192.168.124.83. As we can see:
corosync-cfgtool -s
Printing ring status.
Local node ID 1084783704
corosync-quorumtool -s
Membership information:
Nodeid Votes Name
1084783697 1 d52-54-77-77-01-02
1084783699 1 d52-54-77-77-01-01 (local)
while the other node can only see itself:
corosync-cfgtool -s
Printing ring status.
Local node ID 1084783697
RING ID 0
id = 192.168.124.81
status = ring 0 active with no faults
corosync-quorumtool -s
Membership information:
Nodeid Votes Name
1084783697 1 d52-54-77-77-01-02.virtual.cloud.suse.de (local)
this patch will check if there are both nodelist and bindnetaddr and if so, display warning
and use nodelist information.
---
exec/main.c | 4 ++++
exec/totemconfig.c | 18 ++++++++++++++++--
exec/totemconfig.h | 1 +
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/exec/main.c b/exec/main.c
index 0ca5634a..d5403dc8 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -1262,6 +1262,10 @@ int main (int argc, char **argv, char **envp)
log_printf (LOGSYS_LEVEL_WARNING, "nodeid appears both in totem section and nodelist. Nodelist one is used.");
}
+ if (totem_config_warnings & TOTEM_CONFIG_BINDNETADDR_NODELIST_SET) {
+ log_printf (LOGSYS_LEVEL_WARNING, "%s", error_string);
+ }
+
if (totem_config_warnings != 0) {
log_printf (LOGSYS_LEVEL_WARNING, "Please migrate config file to nodelist.");
}
diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index f232ea8f..4b4d22c7 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -975,7 +975,8 @@ extern int totem_config_read (
uint64_t *warnings)
{
int res = 0;
- char *str;
+ char *str, *bind_addr_str, *ring0_addr_str;
+ char msg[128];
unsigned int ringnumber = 0;
int member_count = 0;
icmap_iter_t iter, member_iter;
@@ -1042,7 +1043,20 @@ extern int totem_config_read (
totem_config->ip_version = totem_config_get_ip_version();
- if (icmap_get_string("totem.interface.0.bindnetaddr", &str) != CS_OK) {
+ if((icmap_get_string("totem.interface.0.bindnetaddr", &bind_addr_str) == CS_OK) &&
+ (icmap_get_string("nodelist.node.0.ring0_addr", &ring0_addr_str) == CS_OK)) {
+ /* check to see if both bindnetaddr and ring0_addr are set, if yes, log warning information
+ * if yes, log warning information, and use nodelist instead
+ * if no, no change at all */
+ if (bind_addr_str && ring0_addr_str) {
+ *warnings |= TOTEM_CONFIG_BINDNETADDR_NODELIST_SET;
+ sprintf(msg, "Both bindnetaddr %s and nodelist %s set, we will use nodelist instead",
+ bind_addr_str, ring0_addr_str);
+ *error_string = msg;
+ }
+
+ config_convert_nodelist_to_interface(totem_config);
+ } else if (icmap_get_string("totem.interface.0.bindnetaddr", &str) != CS_OK) {
/*
* We were not able to find ring 0 bindnet addr. Try to use nodelist informations
*/
diff --git a/exec/totemconfig.h b/exec/totemconfig.h
index 10607cc2..9792cb7d 100644
--- a/exec/totemconfig.h
+++ b/exec/totemconfig.h
@@ -46,6 +46,7 @@
#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)
extern int totem_config_read (
struct totem_config *totem_config,
--
2.12.0

View File

@ -2,7 +2,8 @@
Mon Apr 10 06:42:51 UTC 2017 - bliu@suse.com
- [upgrade] Changing the pre-upgrade role for node failed(bsc#1030437)
Added:0001-totemip.c-Fixed-Evicted-from-CPG-membership.patch
Added:0001-totemconfig.c-Fixed-Evicted-from-CPG-membership.patch
removed: 0001-totemip.c-Fixed-Evicted-from-CPG-membership.patch
-------------------------------------------------------------------
Tue Mar 14 07:14:58 UTC 2017 - bliu@suse.com

View File

@ -62,7 +62,7 @@ Patch7: corosync-start-stop-level.patch
Patch8: disable-build-html-docs.patch
Patch9: 0001-Logsys-Change-logsys-syslog_priority-priority.patch
Patch10: 0001-logconfig.c-make-logging.syslog_priority-and-logging.patch
Patch11: 0001-totemip.c-Fixed-Evicted-from-CPG-membership.patch
Patch11: 0001-totemconfig.c-Fixed-Evicted-from-CPG-membership.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# openais is indeed gone and should be uninstalled. Yes, we do not