Format MariaDBMonitor source

Some parts were manually edited for better results. No functional changes.
This commit is contained in:
Esa Korhonen
2018-09-25 16:03:03 +03:00
parent bfb1c3f1b3
commit c58041d4fb
5 changed files with 27 additions and 27 deletions

View File

@ -1475,19 +1475,19 @@ unique_ptr<ClusterOperation> MariaDBMonitor::failover_prepare(Log log_mode, json
// repeatedly since it is likely to change continuously. // repeatedly since it is likely to change continuously.
if (error_out || log_mode == Log::ON) if (error_out || log_mode == Log::ON)
{ {
string unproc_events = string_printf( const char unproc_fmt[] =
"The relay log of '%s' has %" PRIu64 " unprocessed events " "The relay log of '%s' has %" PRIu64
"(Gtid_IO_Pos: %s, Gtid_Current_Pos: %s).", " unprocessed events (Gtid_IO_Pos: %s, Gtid_Current_Pos: %s).";
promotion_target->name(), string unproc_events = string_printf(unproc_fmt, promotion_target->name(), events,
events,
slave_conn->gtid_io_pos.to_string().c_str(), slave_conn->gtid_io_pos.to_string().c_str(),
promotion_target->m_gtid_current_pos.to_string().c_str()); promotion_target->m_gtid_current_pos.to_string().c_str());
if (error_out) if (error_out)
{ {
// Print a bit more helpful error for the user, goes to log too. This should be a very rare /* Print a bit more helpful error for the user, goes to log too.
// occurrence: either the dba managed to start failover really fast, or the relay log is * This should be a very rare occurrence: either the dba managed to start failover
// massive. In the latter case it's ok that the monitor does not do the waiting since there * really fast, or the relay log is massive. In the latter case it's ok
// is no telling how long the wait will be. * that the monitor does not do the waiting since there is no telling how long
* the wait will be. */
const char wait_relay_log[] = const char wait_relay_log[] =
"%s To avoid data loss, failover should be postponed until " "%s To avoid data loss, failover should be postponed until "
"the log has been processed. Please try again later."; "the log has been processed. Please try again later.";

View File

@ -1272,8 +1272,8 @@ bool MariaDBServer::alter_event(const EventInfo& event, const string& target_sta
if (loc_at != string::npos) if (loc_at != string::npos)
{ {
auto host_begin = loc_at + 1; auto host_begin = loc_at + 1;
quoted_definer = event.definer.substr(0, loc_at + 1) + quoted_definer = event.definer.substr(0, loc_at + 1)
// host_begin may be the null-char if @ was the last char + // host_begin may be the null-char if @ was the last char
"'" + event.definer.substr(host_begin, string::npos) + "'"; "'" + event.definer.substr(host_begin, string::npos) + "'";
} }
else else