]> git.proxmox.com Git - mirror_corosync.git/commitdiff
cpg: Add CPG_REASON_UNDEFINED
authorJan Friesse <jfriesse@redhat.com>
Tue, 16 Apr 2019 10:52:31 +0000 (12:52 +0200)
committerJan Friesse <jfriesse@redhat.com>
Tue, 16 Apr 2019 12:49:10 +0000 (14:49 +0200)
Previously the reason field for the member_list items
in cpg_totem_confchg_fn was unset what may be little confusing.

Solution is to add a special value CPG_REASON_UNDEFINED and use it for
the member_list items.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
exec/cpg.c
include/corosync/cpg.h
man/cpg_initialize.3.in
man/cpg_model_initialize.3.in

index b7ac579285e6733d3ee865a52a8512a0e08c7c70..e39ca340810c4a34d364a036300a7c2663fff4e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006-2015 Red Hat, Inc.
+ * Copyright (c) 2006-2019 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -712,6 +712,7 @@ static int notify_lib_joinlist(
                        if (!founded) {
                                retgi->nodeid = pi->nodeid;
                                retgi->pid = pi->pid;
+                               retgi->reason = CPG_REASON_UNDEFINED;
                                retgi++;
                        }
                }
index 5ebd47823f81fe43f28d8c079c69b35f68249c7f..600bbf7072572331cae1fe7285478e09438cc0e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006-2011 Red Hat, Inc.
+ * Copyright (c) 2006-2019 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -80,6 +80,7 @@ typedef enum {
  * @brief The cpg_reason_t enum
  */
 typedef enum {
+       CPG_REASON_UNDEFINED = 0,
        CPG_REASON_JOIN = 1,
        CPG_REASON_LEAVE = 2,
        CPG_REASON_NODEDOWN = 3,
index bdecc1e1b78f62706cae1a01b6afc10c02443474..38c7de50dd946871eedc5e311d5dcc941489080d 100644 (file)
@@ -1,5 +1,5 @@
 .\"/*
-.\" * Copyright (c) 2006-2009 Red Hat, Inc.
+.\" * Copyright (c) 2006-2019 Red Hat, Inc.
 .\" *
 .\" * All rights reserved.
 .\" *
@@ -31,7 +31,7 @@
 .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" * THE POSSIBILITY OF SUCH DAMAGE.
 .\" */
-.TH CPG_INITIALIZE 3 2004-08-31 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
+.TH CPG_INITIALIZE 3 2019-04-16 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
 .SH NAME
 cpg_initialize \- Create a new connection to the CPG service
 .SH SYNOPSIS
@@ -132,18 +132,20 @@ struct cpg_address {
 .IP
 .PP
 where nodeid is a 32 bit unique node identifier, pid is the process ID of the process that has joined/left the group
-or sent the message, and reason is an integer code indicating why the node joined/left the group.
+or sent the message, and reason is an integer code indicating why the node joined/left the group (this value is not
+set for the member_list items).
 .PP
 .IP
 .RS
 .ne 18
 .nf
 .PP
-CPG_REASON_JOIN     - the process joined a group using cpg_join().
-CPG_REASON_LEAVE    - the process left a group using cpg_leave()
-CPG_REASON_NODEDOWN - the process left a group because the node left the cluster.
-CPG_REASON_NODEUP   - the process joined a group because it was already a member of a group on a node that has just joined the cluster
-CPG_REASON_PROCDOWN - the process left a group without calling cpg_leave()
+CPG_REASON_JOIN      - the process joined a group using cpg_join().
+CPG_REASON_LEAVE     - the process left a group using cpg_leave()
+CPG_REASON_NODEDOWN  - the process left a group because the node left the cluster.
+CPG_REASON_NODEUP    - the process joined a group because it was already a member of a group on a node that has just joined the cluster
+CPG_REASON_PROCDOWN  - the process left a group without calling cpg_leave()
+CPG_REASON_UNDEFINED - a special value used for the member_list items
 .ta
 .fi
 .RE
index e06325d3c9dd72ff5bb4a14732917c63ea6148f4..17ca16aa1507c7660aea8d1c55b340dccae59b4b 100644 (file)
@@ -1,5 +1,5 @@
 .\"/*
-.\" * Copyright (c) 2010 Red Hat, Inc.
+.\" * Copyright (c) 2010-2019 Red Hat, Inc.
 .\" *
 .\" * All rights reserved.
 .\" *
@@ -32,7 +32,7 @@
 .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" * THE POSSIBILITY OF SUCH DAMAGE.
 .\" */
-.TH CPG_MODEL_INITIALIZE 3 2010-04-07 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
+.TH CPG_MODEL_INITIALIZE 3 2019-04-16 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
 .SH NAME
 cpg_model_initialize \- Create a new connection to the CPG service
 .SH SYNOPSIS
@@ -166,18 +166,20 @@ struct cpg_address {
 .IP
 .PP
 where nodeid is a 32 bit unique node identifier, pid is the process ID of the process that has joined/left the group
-or sent the message, and reason is an integer code indicating why the node joined/left the group.
+or sent the message, and reason is an integer code indicating why the node joined/left the group (this value is not
+set for the member_list items).
 .PP
 .IP
 .RS
 .ne 18
 .nf
 .PP
-CPG_REASON_JOIN     - the process joined a group using cpg_join().
-CPG_REASON_LEAVE    - the process left a group using cpg_leave()
-CPG_REASON_NODEDOWN - the process left a group because the node left the cluster.
-CPG_REASON_NODEUP   - the process joined a group because it was already a member of a group on a node that has just joined the cluster
-CPG_REASON_PROCDOWN - the process left a group without calling cpg_leave()
+CPG_REASON_JOIN      - the process joined a group using cpg_join().
+CPG_REASON_LEAVE     - the process left a group using cpg_leave()
+CPG_REASON_NODEDOWN  - the process left a group because the node left the cluster.
+CPG_REASON_NODEUP    - the process joined a group because it was already a member of a group on a node that has just joined the cluster
+CPG_REASON_PROCDOWN  - the process left a group without calling cpg_leave()
+CPG_REASON_UNDEFINED - a special value used for the member_list items
 .ta
 .fi
 .RE