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 214471 Details for
Bug 315711
dlm: closing connection to node 0
[?]
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.
[patch]
Patch to remove qdisk from cman_get_nodes()
noqdev.patch (text/plain), 10.95 KB, created by
Christine Caulfield
on 2007-10-03 10:23:15 UTC
(
hide
)
Description:
Patch to remove qdisk from cman_get_nodes()
Filename:
MIME Type:
Creator:
Christine Caulfield
Created:
2007-10-03 10:23:15 UTC
Size:
10.95 KB
patch
obsolete
>Index: cman_tool/main.c >=================================================================== >RCS file: /cvs/cluster/cluster/cman/cman_tool/main.c,v >retrieving revision 1.59 >diff -u -p -r1.59 main.c >--- cman_tool/main.c 28 Sep 2007 12:18:19 -0000 1.59 >+++ cman_tool/main.c 3 Oct 2007 10:13:46 -0000 >@@ -333,21 +333,128 @@ static int get_format_opt(const char *op > return FMT_NONE; > } > >+ >+static void print_node(commandline_t *comline, cman_handle_t h, int *format, struct cman_node *node) >+{ >+ char member_type; >+ struct tm *ftime; >+ struct tm *jtime; >+ char jstring[1024]; >+ int i,j,k; >+ >+ if (comline->num_nodenames > 0) { >+ if (node_filter(comline, node->cn_name) == 0) { >+ return; >+ } >+ } >+ >+ switch (node->cn_member) { >+ case 0: >+ member_type = 'X'; >+ break; >+ case 1: >+ member_type = 'M'; >+ break; >+ case 2: >+ member_type = 'd'; >+ break; >+ default: >+ member_type = '?'; >+ break; >+ } >+ >+ jtime = localtime(&node->cn_jointime.tv_sec); >+ if (node->cn_jointime.tv_sec && node->cn_member) >+ strftime(jstring, sizeof(jstring), "%F %H:%M:%S", jtime); >+ else >+ strcpy(jstring, " "); >+ >+ if (!comline->format_opts) { >+ printf("%4d %c %5d %s %s\n", >+ node->cn_nodeid, member_type, >+ node->cn_incarnation, jstring, node->cn_name); >+ } >+ >+ if (comline->fence_opt && !comline->format_opts) { >+ char agent[255]; >+ uint64_t fence_time; >+ int fenced; >+ >+ if (!cman_get_fenceinfo(h, node->cn_nodeid, &fence_time, &fenced, agent)) { >+ if (fence_time) { >+ time_t fence_time_t = (time_t)fence_time; >+ ftime = localtime(&fence_time_t); >+ strftime(jstring, sizeof(jstring), "%F %H:%M:%S", ftime); >+ printf(" Last fenced: %-15s by %s\n", jstring, agent); >+ } >+ if (!node->cn_member && node->cn_incarnation && !fenced) { >+ printf(" Node has not been fenced since it went down\n"); >+ } >+ } >+ } >+ >+ int numaddrs; >+ struct cman_node_address addrs[MAX_INTERFACES]; >+ >+ if (comline->addresses_opt || comline->format_opts) { >+ if (!cman_get_node_addrs(h, node->cn_nodeid, MAX_INTERFACES, &numaddrs, addrs) && >+ numaddrs) >+ { >+ if (!comline->format_opts) { >+ printf(" Addresses: "); >+ for (i = 0; i < numaddrs; i++) >+ { >+ print_address(addrs[i].cna_address); >+ printf(" "); >+ } >+ printf("\n"); >+ } >+ } >+ } >+ >+ if (comline->format_opts) { >+ for (j = 0; j < MAX_FORMAT_OPTS; j++) { >+ switch (format[j]) { >+ case FMT_NONE: >+ break; >+ case FMT_ID: >+ printf("%d ", node->cn_nodeid); >+ break; >+ case FMT_NAME: >+ printf("%s ", node->cn_name); >+ break; >+ case FMT_TYPE: >+ printf("%c ", member_type); >+ break; >+ case FMT_ADDR: >+ for (k = 0; k < numaddrs; k++) { >+ print_address(addrs[k].cna_address); >+ if (k != (numaddrs - 1)) { >+ printf(","); >+ } >+ } >+ printf(" "); >+ break; >+ default: >+ break; >+ } >+ } >+ printf("\n"); >+ } >+} >+ > static void show_nodes(commandline_t *comline) > { > cman_handle_t h; > int count; > int i; > int j; >- int k; > int numnodes; > int dis_count; > int format[MAX_FORMAT_OPTS]; > cman_node_t *dis_nodes; > cman_node_t *nodes; >- struct tm *jtime; >- struct tm *ftime; >- char jstring[1024]; >+ cman_node_t qdev_node; > > h = open_cman_handle(0); > >@@ -399,108 +506,13 @@ static void show_nodes(commandline_t *co > printf("Node Sts Inc Joined Name\n"); > } > >- for (i = 0; i < numnodes; i++) { >- char member_type; >- >- if (comline->num_nodenames > 0) { >- if (node_filter(comline, nodes[i].cn_name) == 0) { >- continue; >- } >- } >- >- switch (nodes[i].cn_member) { >- case 0: >- member_type = 'X'; >- break; >- case 1: >- member_type = 'M'; >- break; >- case 2: >- member_type = 'd'; >- break; >- default: >- member_type = '?'; >- break; >- } >- >- jtime = localtime(&nodes[i].cn_jointime.tv_sec); >- if (nodes[i].cn_jointime.tv_sec && nodes[i].cn_member) >- strftime(jstring, sizeof(jstring), "%F %H:%M:%S", jtime); >- else >- strcpy(jstring, " "); >- >- if (!comline->format_opts) { >- printf("%4d %c %5d %s %s\n", >- nodes[i].cn_nodeid, member_type, >- nodes[i].cn_incarnation, jstring, nodes[i].cn_name); >- } >+ /* Get quorum device & print it. */ >+ if (!cman_get_quorum_device(h, &qdev_node)) >+ print_node(comline, h, format, &qdev_node); > >- if (comline->fence_opt && !comline->format_opts) { >- char agent[255]; >- uint64_t fence_time; >- int fenced; >- >- if (!cman_get_fenceinfo(h, nodes[i].cn_nodeid, &fence_time, &fenced, agent)) { >- if (fence_time) { >- time_t fence_time_t = (time_t)fence_time; >- ftime = localtime(&fence_time_t); >- strftime(jstring, sizeof(jstring), "%F %H:%M:%S", ftime); >- printf(" Last fenced: %-15s by %s\n", jstring, agent); >- } >- if (!nodes[i].cn_member && nodes[i].cn_incarnation && !fenced) { >- printf(" Node has not been fenced since it went down\n"); >- } >- } >- } >- >- int numaddrs; >- struct cman_node_address addrs[MAX_INTERFACES]; >- >- if (comline->addresses_opt || comline->format_opts) { >- if (!cman_get_node_addrs(h, nodes[i].cn_nodeid, MAX_INTERFACES, &numaddrs, addrs) && >- numaddrs) >- { >- if (!comline->format_opts) { >- printf(" Addresses: "); >- for (i = 0; i < numaddrs; i++) >- { >- print_address(addrs[i].cna_address); >- printf(" "); >- } >- printf("\n"); >- } >- } >- } >- >- if (comline->format_opts) { >- for (j = 0; j < MAX_FORMAT_OPTS; j++) { >- switch (format[j]) { >- case FMT_NONE: >- break; >- case FMT_ID: >- printf("%d ", nodes[i].cn_nodeid); >- break; >- case FMT_NAME: >- printf("%s ", nodes[i].cn_name); >- break; >- case FMT_TYPE: >- printf("%c ", member_type); >- break; >- case FMT_ADDR: >- for (k = 0; k < numaddrs; k++) { >- print_address(addrs[k].cna_address); >- if (k != (numaddrs - 1)) { >- printf(","); >- } >- } >- printf(" "); >- break; >- default: >- break; >- } >- } >- printf("\n"); >- } >+ /* Print 'real' nodes */ >+ for (i = 0; i < numnodes; i++) { >+ print_node(comline, h, format, &nodes[i]); > } > > free(nodes); >Index: daemon/cnxman-socket.h >=================================================================== >RCS file: /cvs/cluster/cluster/cman/daemon/cnxman-socket.h,v >retrieving revision 1.19 >diff -u -p -r1.19 cnxman-socket.h >--- daemon/cnxman-socket.h 28 Aug 2007 13:14:10 -0000 1.19 >+++ daemon/cnxman-socket.h 3 Oct 2007 10:13:46 -0000 >@@ -2,7 +2,7 @@ > ******************************************************************************* > ** > ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. >-** Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. >+** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. > ** > ** This copyrighted material is made available to anyone wishing to use, > ** modify, copy, or redistribute it subject to the terms and conditions >@@ -54,6 +54,7 @@ > #define CMAN_CMD_STOP_CONFCHG 0x000000c1 > #define CMAN_CMD_SET_DIRTY 0x800000c2 > #define CMAN_CMD_SET_DEBUGLOG 0x800000c3 >+#define CMAN_CMD_GET_QUORUMDEV 0x000000c4 > > #define CMAN_CMD_DATA 0x00000100 > #define CMAN_CMD_BIND 0x00000101 >Index: daemon/commands.c >=================================================================== >RCS file: /cvs/cluster/cluster/cman/daemon/commands.c,v >retrieving revision 1.73 >diff -u -p -r1.73 commands.c >--- daemon/commands.c 3 Oct 2007 10:06:21 -0000 1.73 >+++ daemon/commands.c 3 Oct 2007 10:13:46 -0000 >@@ -523,6 +523,26 @@ static int do_cmd_get_extrainfo(char *cm > return 0; > } > >+static int do_cmd_get_quorumdev(char *cmdbuf, char **retbuf, int retsize, int *retlen, int offset) >+{ >+ struct cl_cluster_node *user_node; >+ char *outbuf = *retbuf + offset; >+ >+ if (!we_are_a_cluster_member) >+ return -ENOENT; >+ if (!quorum_device) >+ return -ENOENT; >+ >+ if (retsize < sizeof(struct cl_cluster_node)) >+ return -EINVAL; >+ >+ user_node = (struct cl_cluster_node *)outbuf; >+ copy_to_usernode(quorum_device, user_node); >+ >+ *retlen = sizeof(struct cl_cluster_node); >+ return 0; >+} >+ > static int do_cmd_get_all_members(char *cmdbuf, char **retbuf, int retsize, int *retlen, int offset) > { > struct cluster_node *node; >@@ -542,8 +562,6 @@ static int do_cmd_get_all_members(char * > list_iterate(nodelist, &cluster_members_list) { > total_nodes++; > } >- if (quorum_device) >- total_nodes++; > > /* if retsize == 0 then don't return node information */ > if (retsize) { >@@ -566,12 +584,6 @@ static int do_cmd_get_all_members(char * > } > } > >- if (quorum_device) { >- copy_to_usernode(quorum_device, user_node); >- user_node++; >- num_nodes++; >- } >- > *retlen = sizeof(struct cl_cluster_node) * num_nodes; > P_MEMB("get_all_members: retlen = %d\n", *retlen); > return num_nodes; >@@ -1046,6 +1058,7 @@ static void quorum_device_timer_fn(void > if (!quorum_device || quorum_device->state == NODESTATE_DEAD) > return; > >+ P_MEMB("quorum_device_timer_fn\n"); > gettimeofday(&now, NULL); > if (quorum_device->last_hello.tv_sec + quorumdev_poll/1000 < now.tv_sec) { > quorum_device->state = NODESTATE_DEAD; >@@ -1331,6 +1344,10 @@ int process_command(struct connection *c > err = do_cmd_poll_quorum_device(cmdbuf, retlen); > break; > >+ case CMAN_CMD_GET_QUORUMDEV: >+ err = do_cmd_get_quorumdev(cmdbuf, retbuf, retsize, retlen, offset); >+ break; >+ > case CMAN_CMD_UPDATE_FENCE_INFO: > err = do_cmd_update_fence_info(cmdbuf); > break; >Index: lib/libcman.c >=================================================================== >RCS file: /cvs/cluster/cluster/cman/lib/libcman.c,v >retrieving revision 1.37 >diff -u -p -r1.37 libcman.c >--- lib/libcman.c 18 Sep 2007 15:34:41 -0000 1.37 >+++ lib/libcman.c 3 Oct 2007 10:13:46 -0000 >@@ -1037,6 +1037,25 @@ int cman_poll_quorum_device(cman_handle_ > return info_call(h, CMAN_CMD_POLL_QUORUMDEV, &isavailable, sizeof(int), NULL, 0); > } > >+int cman_get_quorum_device(cman_handle_t handle, cman_node_t *node) >+{ >+ struct cman_handle *h = (struct cman_handle *)handle; >+ struct cl_cluster_node clnode; >+ int status; >+ VALIDATE_HANDLE(h); >+ >+ if (!node) { >+ errno = EINVAL; >+ return -1; >+ } >+ >+ status = info_call(h, CMAN_CMD_GET_QUORUMDEV, NULL, 0, &clnode, sizeof(struct cl_cluster_node)); >+ if (!status) >+ copy_node(node, &clnode); >+ return status; >+} >+ >+ > int cman_get_fenceinfo(cman_handle_t handle, int nodeid, uint64_t *time, int *fenced, char *agent) > { > struct cman_handle *h = (struct cman_handle *)handle; >Index: lib/libcman.h >=================================================================== >RCS file: /cvs/cluster/cluster/cman/lib/libcman.h,v >retrieving revision 1.34 >diff -u -p -r1.34 libcman.h >--- lib/libcman.h 28 Aug 2007 13:30:23 -0000 1.34 >+++ lib/libcman.h 3 Oct 2007 10:13:47 -0000 >@@ -389,6 +389,9 @@ int cman_register_quorum_device(cman_han > int cman_unregister_quorum_device(cman_handle_t handle); > int cman_poll_quorum_device(cman_handle_t handle, int isavailable); > >+/* Anyone can call this */ >+int cman_get_quorum_device(cman_handle_t handle, cman_node_t *node); >+ > /* > * Sets the dirty bit inside cman. This indicates that the node has > * some internal 'state' (eg in a daemon, filesystem or lock manager)
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 315711
: 214471 |
215951