Skip to content

Commit

Permalink
Merge pull request #4613 from sysown/v2.x-4612
Browse files Browse the repository at this point in the history
Make logging of Galera nodes status conditional to 'mysql-hostgroup_manager_verbose' - Closes #4612
  • Loading branch information
renecannao authored Aug 21, 2024
2 parents 04aa3e4 + 096709e commit da0cec0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/MySQL_HostGroups_Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5062,7 +5062,13 @@ bool Galera_Info::update(int b, int r, int o, int mw, int mtb, bool _a, int _w,
return ret;
}

/**
* @brief Dumps to stderr the current info for the monitored Galera hosts ('Galera_Hosts_Map').
* @details No action if `mysql_thread___hostgroup_manager_verbose=0`.
*/
void print_galera_nodes_last_status() {
if (!mysql_thread___hostgroup_manager_verbose) return;

std::unique_ptr<SQLite3_result> result { new SQLite3_result(13) };

result->add_column_definition(SQLITE_TEXT,"hostname");
Expand Down
2 changes: 2 additions & 0 deletions src/SQLite3_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,10 +930,12 @@ void SQLite3_Server_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t *p
if (resultset->rows_count == 0) {
PROXY_TRACE();
}
#ifdef TEST_GALERA_RANDOM
if (rand() % 20 == 0) {
// randomly add some latency on 5% of the traffic
sleep(2);
}
#endif
}
#endif // TEST_GALERA
#ifdef TEST_GROUPREP
Expand Down

0 comments on commit da0cec0

Please sign in to comment.