You already have SHOW MASTER STATUS values when write_galera_info() is called. It is executed from write_binlog_info() which is called before write_galera_info(). If Executed_Gtid_Set is defined, it will not change, since the server is read-only and thus, it can be re-used.
To be safe from future code changes, you can do something like:
if (!defined($con->{master_status}) {
get_mysql_master_status($con);
}
if ($con->{master_status}->{Executed_Gtid_Set}) {
mysql_query($con, "FLUSH BINARY LOGS");
...
}
You already have SHOW MASTER STATUS values when write_galera_info() is called. It is executed from write_binlog_info() which is called before write_galera_ info(). If Executed_Gtid_Set is defined, it will not change, since the server is read-only and thus, it can be re-used.
To be safe from future code changes, you can do something like:
if (!defined( $con->{ master_ status} ) { master_ status( $con);
get_mysql_
}
if ($con-> {master_ status} ->{Executed_ Gtid_Set} ) {
mysql_query($con, "FLUSH BINARY LOGS");
...
}