48
42
cman_handle_t pcmk_cman_handle = NULL;
51
static char *pcmk_uname = NULL;
52
static int pcmk_uname_len = 0;
53
static uint32_t pcmk_nodeid = 0;
54
45
int ais_membership_timer = 0;
55
46
gboolean ais_membership_force = FALSE;
56
int ais_dispatch(gpointer user_data);
58
#define cs_repeat(counter, max, code) do { \
60
if(rc == CS_ERR_TRY_AGAIN || rc == CS_ERR_QUEUE_FULL) { \
62
crm_debug("Retrying operation after %ds", counter); \
67
} while(counter < max)
69
enum crm_ais_msg_types
70
text2msg_type(const char *text)
72
int type = crm_msg_none;
74
CRM_CHECK(text != NULL, return type);
75
if (safe_str_eq(text, "ais")) {
77
} else if (safe_str_eq(text, "crm_plugin")) {
79
} else if (safe_str_eq(text, CRM_SYSTEM_CIB)) {
81
} else if (safe_str_eq(text, CRM_SYSTEM_CRMD)) {
83
} else if (safe_str_eq(text, CRM_SYSTEM_DC)) {
85
} else if (safe_str_eq(text, CRM_SYSTEM_TENGINE)) {
87
} else if (safe_str_eq(text, CRM_SYSTEM_PENGINE)) {
89
} else if (safe_str_eq(text, CRM_SYSTEM_LRMD)) {
91
} else if (safe_str_eq(text, CRM_SYSTEM_STONITHD)) {
92
type = crm_msg_stonithd;
93
} else if (safe_str_eq(text, "stonith-ng")) {
94
type = crm_msg_stonith_ng;
95
} else if (safe_str_eq(text, "attrd")) {
99
/* This will normally be a transient client rather than
100
* a cluster daemon. Set the type to the pid of the client
102
int scan_rc = sscanf(text, "%d", &type);
104
if (scan_rc != 1 || type <= crm_msg_stonith_ng) {
105
/* Ensure its sane */
113
get_ais_data(const AIS_Message * msg)
116
char *uncompressed = NULL;
117
unsigned int new_size = msg->size + 1;
119
if (msg->is_compressed == FALSE) {
120
crm_trace("Returning uncompressed message data");
121
uncompressed = strdup(msg->data);
124
crm_trace("Decompressing message data");
125
uncompressed = calloc(1, new_size);
127
rc = BZ2_bzBuffToBuffDecompress(uncompressed, &new_size, (char *)msg->data,
128
msg->compressed_size, 1, 0);
130
CRM_ASSERT(rc == BZ_OK);
131
CRM_ASSERT(new_size == msg->size);
47
int plugin_dispatch(gpointer user_data);
138
49
int ais_fd_sync = -1;
139
50
int ais_fd_async = -1; /* never send messages via this channel */
140
51
void *ais_ipc_ctx = NULL;
142
53
hdb_handle_t ais_ipc_handle = 0;
143
static char *ais_cluster_name = NULL;
146
get_ais_nodeid(uint32_t * id, char **uname)
56
plugin_get_details(uint32_t * id, char **uname)
191
107
crm_info("Server details: id=%u uname=%s cname=%s", answer.id, answer.uname, answer.cname);
194
*uname = strdup(answer.uname);
195
ais_cluster_name = strdup(answer.cname);
109
local_id = answer.id;
110
local_uname = strdup(answer.uname);
112
if(id) *id = local_id;
113
if(uname) *uname = strdup(local_uname);
201
crm_get_cluster_name(char **cname)
203
CRM_CHECK(cname != NULL, return FALSE);
204
if (ais_cluster_name) {
205
*cname = strdup(ais_cluster_name);
212
send_ais_text(int class, const char *data,
213
gboolean local, crm_node_t * node, enum crm_ais_msg_types dest)
215
static int msg_id = 0;
216
static int local_pid = 0;
217
enum cluster_type_e cluster_type = get_cluster_type();
118
send_plugin_text(int class, struct iovec *iov)
221
122
int buf_len = sizeof(cs_ipc_header_response_t);
225
const char *transport = "pcmk";
226
cs_ipc_header_response_t *header = NULL;
227
AIS_Message *ais_msg = NULL;
228
enum crm_ais_msg_types sender = text2msg_type(crm_system_name);
123
char *buf = malloc(buf_len);
124
AIS_Message *ais_msg = (AIS_Message*)iov[0].iov_base;
125
cs_ipc_header_response_t *header = (cs_ipc_header_response_t *) buf;
127
CRM_ASSERT(buf != NULL);
230
128
/* There are only 6 handlers registered to crm_lib_service in plugin.c */
231
129
CRM_CHECK(class < 6, crm_err("Invalid message class: %d", class);
238
if (local_pid == 0) {
239
local_pid = getpid();
242
if (sender == crm_msg_none) {
246
ais_msg = calloc(1, sizeof(AIS_Message));
248
ais_msg->id = msg_id++;
249
ais_msg->header.id = class;
250
ais_msg->header.error = CS_OK;
252
ais_msg->host.type = dest;
253
ais_msg->host.local = local;
257
ais_msg->host.size = strlen(node->uname);
258
memset(ais_msg->host.uname, 0, MAX_NAME);
259
memcpy(ais_msg->host.uname, node->uname, ais_msg->host.size);
261
ais_msg->host.id = node->id;
264
ais_msg->sender.id = 0;
265
ais_msg->sender.type = sender;
266
ais_msg->sender.pid = local_pid;
267
ais_msg->sender.size = pcmk_uname_len;
268
memset(ais_msg->sender.uname, 0, MAX_NAME);
269
memcpy(ais_msg->sender.uname, pcmk_uname, ais_msg->sender.size);
271
ais_msg->size = 1 + strlen(data);
273
if (ais_msg->size < CRM_BZ2_THRESHOLD) {
275
ais_msg = realloc(ais_msg, sizeof(AIS_Message) + ais_msg->size);
276
memcpy(ais_msg->data, data, ais_msg->size);
279
char *compressed = NULL;
280
char *uncompressed = strdup(data);
281
unsigned int len = (ais_msg->size * 1.1) + 600; /* recomended size */
283
crm_trace("Compressing message payload");
284
compressed = malloc(len);
286
rc = BZ2_bzBuffToBuffCompress(compressed, &len, uncompressed, ais_msg->size, CRM_BZ2_BLOCKS,
292
crm_err("Compression failed: %d", rc);
297
ais_msg = realloc(ais_msg, sizeof(AIS_Message) + len + 1);
298
memcpy(ais_msg->data, compressed, len);
299
ais_msg->data[len] = 0;
302
ais_msg->is_compressed = TRUE;
303
ais_msg->compressed_size = len;
305
crm_trace("Compression details: %d -> %d", ais_msg->size, ais_data_len(ais_msg));
308
ais_msg->header.size = sizeof(AIS_Message) + ais_data_len(ais_msg);
310
crm_trace("Sending%s message %d to %s.%s (data=%d, total=%d)",
311
ais_msg->is_compressed ? " compressed" : "",
312
ais_msg->id, ais_dest(&(ais_msg->host)), msg_type2text(dest),
313
ais_data_len(ais_msg), ais_msg->header.size);
315
iov.iov_base = ais_msg;
316
iov.iov_len = ais_msg->header.size;
317
buf = realloc(buf, buf_len);
320
133
if (rc == CS_ERR_TRY_AGAIN || rc == CS_ERR_QUEUE_FULL) {
328
switch (cluster_type) {
329
case pcmk_cluster_corosync:
330
CRM_ASSERT(FALSE /*Not supported here */ );
333
case pcmk_cluster_classic_ais:
334
rc = coroipcc_msg_send_reply_receive(ais_ipc_handle, &iov, 1, buf, buf_len);
335
header = (cs_ipc_header_response_t *) buf;
337
CRM_CHECK(header->size == sizeof(cs_ipc_header_response_t),
338
crm_err("Odd message: id=%d, size=%d, class=%d, error=%d",
339
header->id, header->size, class, header->error));
341
CRM_ASSERT(buf_len >= header->size);
342
CRM_CHECK(header->id == CRM_MESSAGE_IPC_ACK,
343
crm_err("Bad response id (%d) for request (%d)", header->id,
344
ais_msg->header.id));
345
CRM_CHECK(header->error == CS_OK, rc = header->error);
349
case pcmk_cluster_cman:
351
CRM_CHECK(dest != crm_msg_ais, rc = CS_ERR_MESSAGE_ERROR;
353
rc = cpg_mcast_joined(pcmk_cpg_handle, CPG_TYPE_AGREED, &iov, 1);
354
if (rc == CS_ERR_TRY_AGAIN || rc == CS_ERR_QUEUE_FULL) {
355
cpg_flow_control_state_t fc_state = CPG_FLOW_CONTROL_DISABLED;
356
int rc2 = cpg_flow_control_state_get(pcmk_cpg_handle, &fc_state);
358
if (rc2 == CS_OK && fc_state == CPG_FLOW_CONTROL_ENABLED) {
359
crm_warn("Connection overloaded, cannot send messages");
362
} else if (rc2 != CS_OK) {
363
crm_warn("Could not determin the connection state: %s (%d)",
364
ais_error2text(rc2), rc2);
370
case pcmk_cluster_unknown:
371
case pcmk_cluster_invalid:
372
case pcmk_cluster_heartbeat:
373
CRM_ASSERT(is_openais_cluster());
141
rc = coroipcc_msg_send_reply_receive(ais_ipc_handle, iov, 1, buf, buf_len);
377
143
} while ((rc == CS_ERR_TRY_AGAIN || rc == CS_ERR_QUEUE_FULL) && retries < 20);
381
crm_perror(LOG_ERR, "Sending message %d via %s: FAILED (rc=%d): %s",
382
ais_msg->id, transport, rc, ais_error2text(rc));
146
CRM_CHECK(header->size == sizeof(cs_ipc_header_response_t),
147
crm_err("Odd message: id=%d, size=%d, class=%d, error=%d",
148
header->id, header->size, class, header->error));
150
CRM_ASSERT(buf_len >= header->size);
151
CRM_CHECK(header->id == CRM_MESSAGE_IPC_ACK,
152
crm_err("Bad response id (%d) for request (%d)", header->id,
153
ais_msg->header.id));
154
CRM_CHECK(header->error == CS_OK, rc = header->error);
385
crm_trace("Message %d: sent", ais_msg->id);
157
crm_perror(LOG_ERR, "Sending plugin message %d FAILED: %s (%d)",
158
ais_msg->id, ais_error2text(rc), rc);
161
free(iov[0].iov_base);
390
165
return (rc == CS_OK);
394
send_ais_message(xmlNode * msg, gboolean local, crm_node_t * node, enum crm_ais_msg_types dest)
399
if (is_classic_ais_cluster()) {
400
if (ais_fd_async < 0) {
401
crm_err("Not connected to AIS: %d", ais_fd_async);
406
data = dump_xml_unformatted(msg);
407
rc = send_ais_text(crm_class_cluster, data, local, node, dest);
413
terminate_cs_connection(void)
169
terminate_cs_connection(crm_cluster_t *cluster)
415
171
crm_notice("Disconnecting from Corosync");
453
199
ais_fd_sync = -1;
457
crm_update_ais_node(xmlNode * member, long long seq)
203
plugin_handle_membership(AIS_Message *msg)
459
const char *id_s = crm_element_value(member, "id");
460
const char *addr = crm_element_value(member, "addr");
461
const char *uname = crm_element_value(member, "uname");
462
const char *state = crm_element_value(member, "state");
463
const char *born_s = crm_element_value(member, "born");
464
const char *seen_s = crm_element_value(member, "seen");
465
const char *votes_s = crm_element_value(member, "votes");
466
const char *procs_s = crm_element_value(member, "processes");
468
int votes = crm_int_helper(votes_s, NULL);
469
unsigned int id = crm_int_helper(id_s, NULL);
470
unsigned int procs = crm_int_helper(procs_s, NULL);
472
/* TODO: These values will contain garbage if version < 0.7.1 */
473
uint64_t born = crm_int_helper(born_s, NULL);
474
uint64_t seen = crm_int_helper(seen_s, NULL);
476
return crm_update_peer(__FUNCTION__, id, born, seen, votes, procs, uname, uname, addr, state);
205
if (msg->header.id == crm_class_members || msg->header.id == crm_class_quorum) {
206
xmlNode *member = NULL;
207
const char *value = NULL;
208
gboolean quorate = FALSE;
209
xmlNode *xml = string2xml(msg->data);
212
crm_err("Invalid membership update: %s", msg->data);
216
value = crm_element_value(xml, "quorate");
217
CRM_CHECK(value != NULL, crm_log_xml_err(xml, "No quorum value:"); return);
218
if (crm_is_true(value)) {
222
value = crm_element_value(xml, "id");
223
CRM_CHECK(value != NULL, crm_log_xml_err(xml, "No membership id"); return);
224
crm_peer_seq = crm_int_helper(value, NULL);
226
if (quorate != crm_have_quorum) {
227
crm_notice("Membership %s: quorum %s", value, quorate ? "acquired" : "lost");
228
crm_have_quorum = quorate;
231
crm_info("Membership %s: quorum %s", value, quorate ? "retained" : "still lost");
234
for (member = __xml_first_child(xml); member != NULL; member = __xml_next(member)) {
235
const char *id_s = crm_element_value(member, "id");
236
const char *addr = crm_element_value(member, "addr");
237
const char *uname = crm_element_value(member, "uname");
238
const char *state = crm_element_value(member, "state");
239
const char *born_s = crm_element_value(member, "born");
240
const char *seen_s = crm_element_value(member, "seen");
241
const char *votes_s = crm_element_value(member, "votes");
242
const char *procs_s = crm_element_value(member, "processes");
244
int votes = crm_int_helper(votes_s, NULL);
245
unsigned int id = crm_int_helper(id_s, NULL);
246
unsigned int procs = crm_int_helper(procs_s, NULL);
248
/* TODO: These values will contain garbage if version < 0.7.1 */
249
uint64_t born = crm_int_helper(born_s, NULL);
250
uint64_t seen = crm_int_helper(seen_s, NULL);
252
crm_update_peer(__FUNCTION__, id, born, seen, votes, procs, uname, uname, addr, state);
480
ais_dispatch_message(AIS_Message * msg,
481
gboolean(*dispatch) (int kind, const char *from, const char *data))
259
plugin_default_deliver_message(cpg_handle_t handle,
260
const struct cpg_name *groupName,
261
uint32_t nodeid, uint32_t pid, void *msg, size_t msg_len)
484
char *uncompressed = NULL;
488
CRM_ASSERT(msg != NULL);
490
crm_trace("Got new%s message (size=%d, %d, %d)",
491
msg->is_compressed ? " compressed" : "",
492
ais_data_len(msg), msg->size, msg->compressed_size);
495
if (msg->is_compressed && msg->size > 0) {
497
unsigned int new_size = msg->size + 1;
499
if (check_message_sanity(msg, NULL) == FALSE) {
503
crm_trace("Decompressing message data");
504
uncompressed = calloc(1, new_size);
505
rc = BZ2_bzBuffToBuffDecompress(uncompressed, &new_size, data, msg->compressed_size, 1, 0);
508
crm_err("Decompression failed: %d", rc);
512
CRM_ASSERT(rc == BZ_OK);
513
CRM_ASSERT(new_size == msg->size);
517
} else if (check_message_sanity(msg, data) == FALSE) {
520
} else if (safe_str_eq("identify", data)) {
522
char *pid_s = crm_itoa(pid);
524
send_ais_text(crm_class_cluster, pid_s, TRUE, NULL, crm_msg_ais);
529
if (msg->header.id != crm_class_members) {
530
crm_get_peer(msg->sender.id, msg->sender.uname);
533
if (msg->header.id == crm_class_rmpeer) {
534
uint32_t id = crm_int_helper(data, NULL);
536
crm_info("Removing peer %s/%u", data, id);
537
reap_crm_member(id, NULL);
540
} else if (is_classic_ais_cluster()) {
541
if (msg->header.id == crm_class_members || msg->header.id == crm_class_quorum) {
542
xmlNode *node = NULL;
543
const char *value = NULL;
544
gboolean quorate = FALSE;
546
xml = string2xml(data);
548
crm_err("Invalid membership update: %s", data);
552
value = crm_element_value(xml, "quorate");
553
CRM_CHECK(value != NULL, crm_log_xml_err(xml, "No quorum value:");
555
if (crm_is_true(value)) {
559
value = crm_element_value(xml, "id");
560
CRM_CHECK(value != NULL, crm_log_xml_err(xml, "No membership id");
562
crm_peer_seq = crm_int_helper(value, NULL);
564
if (quorate != crm_have_quorum) {
565
crm_notice("Membership %s: quorum %s", value, quorate ? "acquired" : "lost");
566
crm_have_quorum = quorate;
569
crm_info("Membership %s: quorum %s", value, quorate ? "retained" : "still lost");
572
for (node = __xml_first_child(xml); node != NULL; node = __xml_next(node)) {
573
crm_update_ais_node(node, crm_peer_seq);
578
crm_trace("Payload: %s", data);
579
if (dispatch != NULL) {
580
dispatch(msg->header.id, msg->sender.uname, data);
589
crm_err("Invalid message (id=%d, dest=%s:%s, from=%s:%s.%d):"
590
" min=%d, total=%d, size=%d, bz2_size=%d",
591
msg->id, ais_dest(&(msg->host)), msg_type2text(msg->host.type),
592
ais_dest(&(msg->sender)), msg_type2text(msg->sender.type),
593
msg->sender.pid, (int)sizeof(AIS_Message),
594
msg->header.size, msg->size, msg->compressed_size);
264
const char *from = NULL;
265
char *data = pcmk_message_common_cs(handle, nodeid, pid, msg, &kind, &from);
599
ais_dispatch(gpointer user_data)
271
plugin_dispatch(gpointer user_data)
602
gboolean good = TRUE;
604
gboolean(*dispatch) (int kind, const char *from, const char *data) = user_data;
274
crm_cluster_t *cluster = (crm_cluster_t *) user_data;
607
277
char *buffer = NULL;
774
451
crm_err("cman qorum is not supported in this build");
780
# ifdef SUPPORT_COROSYNC
781
gboolean(*pcmk_cpg_dispatch_fn) (int kind, const char *from, const char *data) = NULL;
782
static bool cpg_evicted = FALSE;
785
pcmk_cpg_dispatch(gpointer user_data)
789
pcmk_cpg_dispatch_fn = user_data;
790
rc = cpg_dispatch(pcmk_cpg_handle, CS_DISPATCH_ALL);
792
crm_err("Connection to the CPG API failed: %d", rc);
796
} else if(cpg_evicted) {
797
crm_err("Evicted from CPG membership");
804
pcmk_cpg_deliver(cpg_handle_t handle,
805
const struct cpg_name *groupName,
806
uint32_t nodeid, uint32_t pid, void *msg, size_t msg_len)
808
AIS_Message *ais_msg = (AIS_Message *) msg;
810
if (ais_msg->sender.id > 0 && ais_msg->sender.id != nodeid) {
811
crm_err("Nodeid mismatch from %d.%d: claimed nodeid=%u", nodeid, pid, ais_msg->sender.id);
814
} else if (ais_msg->host.size != 0 && safe_str_neq(ais_msg->host.uname, pcmk_uname)) {
817
} else if (ais_msg->host.id != 0 && (pcmk_nodeid != ais_msg->host.id)) {
822
ais_msg->sender.id = nodeid;
823
if (ais_msg->sender.size == 0) {
824
crm_node_t *peer = crm_get_peer(nodeid, NULL);
827
crm_err("Peer with nodeid=%u is unknown", nodeid);
829
} else if (peer->uname == NULL) {
830
crm_err("No uname for peer with nodeid=%u", nodeid);
833
crm_notice("Fixing uname for peer with nodeid=%u", nodeid);
834
ais_msg->sender.size = strlen(peer->uname);
835
memset(ais_msg->sender.uname, 0, MAX_NAME);
836
memcpy(ais_msg->sender.uname, peer->uname, ais_msg->sender.size);
840
ais_dispatch_message(ais_msg, pcmk_cpg_dispatch_fn);
844
pcmk_cpg_membership(cpg_handle_t handle,
845
const struct cpg_name *groupName,
846
const struct cpg_address *member_list, size_t member_list_entries,
847
const struct cpg_address *left_list, size_t left_list_entries,
848
const struct cpg_address *joined_list, size_t joined_list_entries)
851
gboolean found = FALSE;
852
static int counter = 0;
854
for (i = 0; i < left_list_entries; i++) {
855
crm_node_t *peer = crm_get_peer(left_list[i].nodeid, NULL);
857
crm_info("Left[%d.%d] %s.%u ", counter, i, groupName->value, left_list[i].nodeid);
858
crm_update_peer_proc(__FUNCTION__, peer, crm_proc_cpg, OFFLINESTATUS);
861
for (i = 0; i < joined_list_entries; i++) {
862
crm_info("Joined[%d.%d] %s.%u ", counter, i, groupName->value, joined_list[i].nodeid);
865
for (i = 0; i < member_list_entries; i++) {
866
crm_node_t *peer = crm_get_peer(member_list[i].nodeid, NULL);
868
crm_info("Member[%d.%d] %s.%u ", counter, i, groupName->value, member_list[i].nodeid);
869
crm_update_peer_proc(__FUNCTION__, peer, crm_proc_cpg, ONLINESTATUS);
870
if (pcmk_nodeid == member_list[i].nodeid) {
876
crm_err("We're not part of CPG group %s anymore!", groupName->value);
883
cpg_callbacks_t cpg_callbacks = {
884
.cpg_deliver_fn = pcmk_cpg_deliver,
885
.cpg_confchg_fn = pcmk_cpg_membership,
890
init_cpg_connection(crm_cluster_t * cluster)
892
# ifdef SUPPORT_COROSYNC
896
crm_node_t *peer = NULL;
898
struct mainloop_fd_callbacks cpg_fd_callbacks = {
899
.dispatch = pcmk_cpg_dispatch,
900
.destroy = cluster->destroy,
904
strcpy(pcmk_cpg_group.value, crm_system_name);
905
pcmk_cpg_group.length = strlen(crm_system_name) + 1;
907
cs_repeat(retries, 30, rc = cpg_initialize(&pcmk_cpg_handle, &cpg_callbacks));
909
crm_err("Could not connect to the Cluster Process Group API: %d\n", rc);
914
cs_repeat(retries, 30, rc = cpg_local_get(pcmk_cpg_handle, (unsigned int *)&cluster->nodeid));
916
crm_err("Could not get local node id from the CPG API");
921
cs_repeat(retries, 30, rc = cpg_join(pcmk_cpg_handle, &pcmk_cpg_group));
923
crm_err("Could not join the CPG group '%s': %d", crm_system_name, rc);
927
rc = cpg_fd_get(pcmk_cpg_handle, &fd);
929
crm_err("Could not obtain the CPG API connection: %d\n", rc);
933
mainloop_add_fd("corosync-cpg", G_PRIORITY_MEDIUM, fd, cluster->cs_dispatch, &cpg_fd_callbacks);
937
cpg_finalize(pcmk_cpg_handle);
941
peer = crm_get_peer(cluster->nodeid, pcmk_uname);
942
crm_update_peer_proc(__FUNCTION__, peer, crm_proc_cpg, ONLINESTATUS);
945
crm_err("The Corosync CPG API is not supported in this build");
452
crm_exit(DAEMON_RESPAWN_STOP);
457
# ifdef SUPPORT_COROSYNC
952
init_quorum_connection(gboolean(*dispatch) (unsigned long long, gboolean),
460
cluster_connect_quorum(gboolean(*dispatch) (unsigned long long, gboolean),
953
461
void (*destroy) (gpointer))
955
463
crm_err("The Corosync quorum API is not supported in this build");
464
crm_exit(DAEMON_RESPAWN_STOP);
997
507
if (ais_fd_callbacks.destroy == NULL) {
998
ais_fd_callbacks.destroy = ais_destroy;
508
ais_fd_callbacks.destroy = plugin_destroy;
1001
mainloop_add_fd("corosync-plugin", G_PRIORITY_MEDIUM, ais_fd_async, cluster->cs_dispatch,
511
mainloop_add_fd("corosync-plugin", G_PRIORITY_MEDIUM, ais_fd_async, cluster, &ais_fd_callbacks);
1003
512
crm_info("AIS connection established");
1006
515
pid_s = crm_itoa(pid);
1007
send_ais_text(crm_class_cluster, pid_s, TRUE, NULL, crm_msg_ais);
516
send_cluster_text(crm_class_cluster, pid_s, TRUE, NULL, crm_msg_ais);
1010
if (uname(&name) < 0) {
1011
crm_perror(LOG_ERR, "Could not determin the current host");
519
cluster->nodeid = get_local_nodeid(0);
1015
get_ais_nodeid(&pcmk_nodeid, &pcmk_uname);
1016
if (safe_str_neq(name.nodename, pcmk_uname)) {
1017
crm_crit("Node name mismatch! Corosync supplied %s, our lookup returned %s",
1018
pcmk_uname, name.nodename);
521
name = get_local_node_name();
522
plugin_get_details(NULL, &(cluster->uname));
523
if (safe_str_neq(name, cluster->uname)) {
524
crm_crit("Node name mismatch! Corosync supplied %s but our lookup returned %s",
525
cluster->uname, name);
1020
527
("Node name mismatches usually occur when assigned automatically by DHCP servers");
1021
crm_notice("If this node was part of the cluster with a different name,"
1022
" you will need to remove the old entry with crm_node --remove");
1025
cluster->nodeid = pcmk_nodeid;
531
proc = text2proc(crm_system_name);
532
peer = crm_get_peer(cluster->nodeid, cluster->uname);
533
crm_update_peer_proc(__FUNCTION__, peer, proc|crm_proc_plugin, ONLINESTATUS);