mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Stop clvmd complaining about nodes that have left the cluster
This commit is contained in:
parent
09a929fc92
commit
b499b916ca
@ -5,6 +5,7 @@ Version 2.02.10 -
|
|||||||
Add mirror options to man pages.
|
Add mirror options to man pages.
|
||||||
Prevent mirror renames.
|
Prevent mirror renames.
|
||||||
Move CMDLIB code into separate file and record whether static build.
|
Move CMDLIB code into separate file and record whether static build.
|
||||||
|
Stop clvmd complaining about nodes that have left the cluster
|
||||||
|
|
||||||
Version 2.02.09 - 17th August 2006
|
Version 2.02.09 - 17th August 2006
|
||||||
==================================
|
==================================
|
||||||
|
@ -137,7 +137,7 @@ static int _cluster_send_message(void *buf, int msglen, char *csid, const char *
|
|||||||
|
|
||||||
if (cman_send_data(c_handle, buf, msglen, 0, CLUSTER_PORT_CLVMD, nodeid) <= 0)
|
if (cman_send_data(c_handle, buf, msglen, 0, CLUSTER_PORT_CLVMD, nodeid) <= 0)
|
||||||
{
|
{
|
||||||
log_error(errtext);
|
log_error(errtext);
|
||||||
}
|
}
|
||||||
return msglen;
|
return msglen;
|
||||||
}
|
}
|
||||||
@ -152,16 +152,18 @@ static void _get_our_csid(char *csid)
|
|||||||
|
|
||||||
/* Call a callback routine for each node is that known (down means not running a clvmd) */
|
/* Call a callback routine for each node is that known (down means not running a clvmd) */
|
||||||
static int _cluster_do_node_callback(struct local_client *client,
|
static int _cluster_do_node_callback(struct local_client *client,
|
||||||
void (*callback) (struct local_client *, char *,
|
void (*callback) (struct local_client *, char *,
|
||||||
int))
|
int))
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int somedown = 0;
|
int somedown = 0;
|
||||||
|
|
||||||
for (i = 0; i < _get_num_nodes(); i++) {
|
for (i = 0; i < _get_num_nodes(); i++) {
|
||||||
callback(client, (char *)&nodes[i].cn_nodeid, node_updown[nodes[i].cn_nodeid]);
|
if (nodes[i].cn_member) {
|
||||||
if (!node_updown[nodes[i].cn_nodeid])
|
callback(client, (char *)&nodes[i].cn_nodeid, node_updown[nodes[i].cn_nodeid]);
|
||||||
somedown = -1;
|
if (!node_updown[nodes[i].cn_nodeid])
|
||||||
|
somedown = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return somedown;
|
return somedown;
|
||||||
}
|
}
|
||||||
@ -205,7 +207,7 @@ static void event_callback(cman_handle_t handle, void *private, int reason, int
|
|||||||
|
|
||||||
static struct local_client *cman_client;
|
static struct local_client *cman_client;
|
||||||
static int _cluster_fd_callback(struct local_client *fd, char *buf, int len, char *csid,
|
static int _cluster_fd_callback(struct local_client *fd, char *buf, int len, char *csid,
|
||||||
struct local_client **new_client)
|
struct local_client **new_client)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Save this for data_callback */
|
/* Save this for data_callback */
|
||||||
@ -243,7 +245,7 @@ static void _add_up_node(char *csid)
|
|||||||
max_updown_nodes);
|
max_updown_nodes);
|
||||||
} else {
|
} else {
|
||||||
log_error
|
log_error
|
||||||
("Realloc failed. Node status for clvmd will be wrong. quitting\n");
|
("Realloc failed. Node status for clvmd will be wrong. quitting\n");
|
||||||
exit(999);
|
exit(999);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -297,36 +299,37 @@ static void get_members()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not enough room for new nodes list ? */
|
/* Not enough room for new nodes list ? */
|
||||||
if (num_nodes > count_nodes && nodes) {
|
if (num_nodes > count_nodes && nodes) {
|
||||||
free(nodes);
|
free(nodes);
|
||||||
nodes = NULL;
|
nodes = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodes == NULL) {
|
if (nodes == NULL) {
|
||||||
count_nodes = num_nodes + 10; /* Overallocate a little */
|
count_nodes = num_nodes + 10; /* Overallocate a little */
|
||||||
nodes = malloc(count_nodes * sizeof(struct cman_node));
|
nodes = malloc(count_nodes * sizeof(struct cman_node));
|
||||||
if (!nodes) {
|
if (!nodes) {
|
||||||
log_error("Unable to allocate nodes array\n");
|
log_error("Unable to allocate nodes array\n");
|
||||||
exit(5);
|
exit(5);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
status = cman_get_nodes(c_handle, count_nodes, &retnodes, nodes);
|
status = cman_get_nodes(c_handle, count_nodes, &retnodes, nodes);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
log_error("Unable to get node details");
|
log_error("Unable to get node details");
|
||||||
exit(6);
|
exit(6);
|
||||||
}
|
|
||||||
|
|
||||||
if (node_updown == NULL) {
|
|
||||||
node_updown =
|
|
||||||
(int *) malloc(sizeof(int) *
|
|
||||||
max(num_nodes, max_updown_nodes));
|
|
||||||
memset(node_updown, 0,
|
|
||||||
sizeof(int) * max(num_nodes, max_updown_nodes));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node_updown == NULL) {
|
||||||
|
node_updown =
|
||||||
|
(int *) malloc(sizeof(int) *
|
||||||
|
max(num_nodes, max_updown_nodes));
|
||||||
|
memset(node_updown, 0,
|
||||||
|
sizeof(int) * max(num_nodes, max_updown_nodes));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Convert a node name to a CSID */
|
/* Convert a node name to a CSID */
|
||||||
static int _csid_from_name(char *csid, char *name)
|
static int _csid_from_name(char *csid, char *name)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user