diff --git a/src/executables/master_heartbeat.c b/src/executables/master_heartbeat.c index 5a137fbdf9..15782ab335 100644 --- a/src/executables/master_heartbeat.c +++ b/src/executables/master_heartbeat.c @@ -3599,7 +3599,7 @@ hb_resource_job_confirm_start (HB_JOB_ARG * arg) /* shutdown working server processes to change its role to slave */ snprintf (hb_info_str, HB_INFO_STR_MAX, "%s The master node failed to restart the server process", HA_FAILBACK_DIAG_STRING); - MASTER_ER_SET (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_HB_PROCESS_EVENT, 1, hb_info_str); + MASTER_ER_SET (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_HB_NODE_EVENT, 1, hb_info_str); error = hb_resource_job_queue (HB_RJOB_DEMOTE_START_SHUTDOWN, NULL, HB_JOB_TIMER_IMMEDIATELY); assert (error == NO_ERROR); @@ -4154,11 +4154,10 @@ hb_cleanup_conn_and_start_process (CSS_CONN_ENTRY * conn, SOCKET sfd) /* demote the current node */ hb_Resource->state = HB_NSTATE_SLAVE; - snprintf (error_string, LINE_MAX, "(args:%s)", proc->args); snprintf (hb_info_str, HB_INFO_STR_MAX, - "%s Server process failure repeated within a short period of time. The current node will be demoted", - HA_FAILBACK_DIAG_STRING); - MASTER_ER_SET (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_HB_PROCESS_EVENT, 1, hb_info_str); + "%s The master node failed to restart the server process due to repeated failures within a short period of time. The current node will be demoted (args:%s)", + HA_FAILBACK_DIAG_STRING, proc->args); + MASTER_ER_SET (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_HB_NODE_EVENT, 1, hb_info_str); error = hb_resource_job_queue (HB_RJOB_DEMOTE_START_SHUTDOWN, NULL, HB_JOB_TIMER_IMMEDIATELY); assert (error == NO_ERROR); @@ -4844,13 +4843,17 @@ hb_thread_check_disk_failure (void *arg) { snprintf (hb_info_str, HB_INFO_STR_MAX, "%s The master node has lost its role due to server process problem, such as disk failure", - HA_FAILOVER_DIAG_STRING); - MASTER_ER_SET (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_HB_PROCESS_EVENT, 1, hb_info_str); + HA_FAILBACK_DIAG_STRING); + MASTER_ER_SET (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_HB_NODE_EVENT, 1, hb_info_str); /* be silent to avoid blocking write operation on disk */ hb_disable_er_log (HB_NOLOG_DEMOTE_ON_DISK_FAIL, NULL); hb_Resource->state = HB_NSTATE_SLAVE; + snprintf (hb_info_str, HB_INFO_STR_MAX, "%s Current node has been successfully demoted to slave", + HA_FAILBACK_SUCCESS_STRING); + MASTER_ER_SET (ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_HB_NODE_EVENT, 1, hb_info_str); + pthread_mutex_unlock (&hb_Resource->lock); pthread_mutex_unlock (&hb_Cluster->lock); #if !defined(WINDOWS)