Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 314758 Details for
Bug 457104
improve upgrades to RHEL6
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
groupd patch
groupd-version.patch (text/plain), 4.74 KB, created by
David Teigland
on 2008-08-21 22:09:31 UTC
(
hide
)
Description:
groupd patch
Filename:
MIME Type:
Creator:
David Teigland
Created:
2008-08-21 22:09:31 UTC
Size:
4.74 KB
patch
obsolete
>commit 7750b587665f8edd9fcbda39a2e1281b690fade6 >Author: David Teigland <teigland@redhat.com> >Date: Thu Aug 21 13:55:52 2008 -0500 > > groupd: send and check version messages > > for better compatibility with and upgrades to cluster3 eventually. > > bz 457104 > > - cluster3 nodes that are trying to detect old cluster2 nodes will be > helped by the cluster2 groupd sending its version. > - if someone adds a cluster2 node to a cluster3 cluster (which is not > supposed to be done), detect the newer version and exit > > Signed-off-by: David Teigland <teigland@redhat.com> > >diff --git a/group/daemon/cpg.c b/group/daemon/cpg.c >index d5cfb8d..2cac91f 100644 >--- a/group/daemon/cpg.c >+++ b/group/daemon/cpg.c >@@ -33,6 +33,20 @@ static cpg_handle_t saved_handle; > static struct cpg_name saved_name; > static int message_flow_control_on; > >+#define GROUP_LIBGROUP 2 >+#define GROUP_LIBCPG 3 >+ >+#define CLUSTER2 2 >+#define CLUSTER3 3 >+ >+struct group_version { >+ uint32_t nodeid; >+ uint16_t cluster; >+ uint16_t group_mode; >+ uint16_t groupd_compat; >+ uint16_t groupd_count; >+ uint32_t unused; >+}; > > static node_t *find_group_node(group_t *g, int nodeid) > { >@@ -194,6 +208,52 @@ static int send_gid(uint32_t gid) > return send_message_groupd(&g, &msg, sizeof(msg), MSG_GLOBAL_ID); > } > >+static void _send_version(int nodeid, int cluster, int mode, int compat) >+{ >+ group_t g, *gp; >+ char *buf; >+ msg_t *msg; >+ int len; >+ int count = 0; >+ struct group_version *ver; >+ >+ list_for_each_entry(gp, &gd_groups, list) >+ count++; >+ >+ /* just so log_group will work */ >+ memset(&g, 0, sizeof(group_t)); >+ strcpy(g.name, "groupd"); >+ >+ len = sizeof(msg_t) + sizeof(struct group_version); >+ >+ buf = malloc(len); >+ if (!buf) >+ return; >+ memset(buf, 0, len); >+ >+ msg = (msg_t *)buf; >+ ver = (struct group_version *)(buf + sizeof(msg_t)); >+ >+ msg->ms_type = MSG_GROUP_VERSION; >+ msg_bswap_out(msg); >+ >+ log_debug("send_version nodeid %d cluster %d mode %d compat %d", >+ nodeid, cluster, mode, compat); >+ >+ ver->nodeid = cpu_to_le32(nodeid); >+ ver->cluster = cpu_to_le16(cluster); >+ ver->group_mode = cpu_to_le16(mode); >+ ver->groupd_compat = cpu_to_le16(compat); >+ ver->groupd_count = cpu_to_le16(count); >+ >+ send_message_groupd(&g, buf, len, MSG_GROUP_VERSION); >+} >+ >+static void send_version(void) >+{ >+ _send_version(our_nodeid, CLUSTER2, GROUP_LIBGROUP, 1); >+} >+ > void process_groupd_confchg(void) > { > group_t *g; >@@ -204,6 +264,9 @@ void process_groupd_confchg(void) > log_debug("groupd confchg total %d left %d joined %d", > saved_member_count, saved_left_count, saved_joined_count); > >+ if (saved_joined_count) >+ send_version(); >+ > memcpy(&groupd_cpg_member, &saved_member, sizeof(saved_member)); > groupd_cpg_member_count = saved_member_count; > >@@ -303,6 +366,29 @@ group_t *find_group_by_handle(cpg_handle_t h) > return NULL; > } > >+static void version_copy_in(struct group_version *ver) >+{ >+ ver->nodeid = le32_to_cpu(ver->nodeid); >+ ver->cluster = le16_to_cpu(ver->cluster); >+ ver->group_mode = le16_to_cpu(ver->group_mode); >+ ver->groupd_compat = le16_to_cpu(ver->groupd_compat); >+ ver->groupd_count = le16_to_cpu(ver->groupd_count); >+} >+ >+static void receive_version(int from, msg_t *msg, int len) >+{ >+ struct group_version *ver; >+ >+ ver = (struct group_version *)((char *)msg + sizeof(msg_t)); >+ >+ version_copy_in(ver); >+ >+ if (ver->group_mode == GROUP_LIBCPG) { >+ log_print("incompatible group mode from %d", from); >+ exit(1); >+ } >+} >+ > void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name, > uint32_t nodeid, uint32_t pid, void *data, int data_len) > { >@@ -318,6 +404,11 @@ void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name, > > msg_bswap_in(msg); > >+ if (msg->ms_type == MSG_GROUP_VERSION) { >+ receive_version(nodeid, msg, data_len); >+ return; >+ } >+ > if (msg->ms_type == MSG_GLOBAL_ID) { > to_nodeid = msg->ms_global_id & 0x0000FFFF; > counter = (msg->ms_global_id >> 16) & 0x0000FFFF; >diff --git a/group/daemon/gd_internal.h b/group/daemon/gd_internal.h >index 691d187..f1269cc 100644 >--- a/group/daemon/gd_internal.h >+++ b/group/daemon/gd_internal.h >@@ -191,9 +191,10 @@ struct app { > #define MSG_APP_RECOVER 3 > #define MSG_APP_INTERNAL 4 > #define MSG_GLOBAL_ID 5 >+#define MSG_GROUP_VERSION 6 > > #define MSG_VER_MAJOR 1 >-#define MSG_VER_MINOR 0 >+#define MSG_VER_MINOR 1 > #define MSG_VER_PATCH 0 > > struct msg { >diff --git a/group/daemon/main.c b/group/daemon/main.c >index 90a9b48..a31937f 100644 >--- a/group/daemon/main.c >+++ b/group/daemon/main.c >@@ -109,7 +109,7 @@ static int do_read(int fd, void *buf, size_t count) > static int ignore_gfs_nolock(char *sysfs_dir, char *table) > { > char path[PATH_MAX]; >- int rv, fd; >+ int fd; > > if (!strstr(sysfs_dir, "gfs")) > return 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 457104
: 314758