diff options
author | Sachin Setiya <sachin.setiya@mariadb.com> | 2017-05-26 15:23:15 +0530 |
---|---|---|
committer | Sachin Setiya <sachin.setiya@mariadb.com> | 2017-05-26 15:23:15 +0530 |
commit | 945fb51812a9c9969d7a15e5fbf90ced9b14a23b (patch) | |
tree | 961765bee0e35c4e2859f7b17ca54e750468e94b /sql/rpl_mi.cc | |
parent | 6bc9949210806a5c9630d5af17c74c8f2c54a227 (diff) | |
download | mariadb-git-9544.tar.gz |
MDEV-9544 FLUSH [RELAY] LOGS does not rotate logs for a named slave9544
Problem:- In the case of multisource replication/named slave
when we run "FLUSH LOGS" , it does not flush logs.
Solution:- A new function Master_info_index->flush_all_relay_logs()
is created which will rotate relay logs for all named slave.
This will be called in reload_acl_and_cache function when
connection_name.length == 0
Diffstat (limited to 'sql/rpl_mi.cc')
-rw-r--r-- | sql/rpl_mi.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index c9dcf7b8fd7..3b32afb75bd 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -1980,4 +1980,21 @@ void prot_store_ids(THD *thd, DYNAMIC_ARRAY *ids) return; } +bool Master_info_index::flush_all_relay_logs() +{ + for (uint i=0; i < master_info_hash.records; i++) + { + Master_info *mi; + mi= (Master_info *)my_hash_element(&master_info_hash, i); + mysql_mutex_lock(&mi->data_lock); + if (rotate_relay_log(mi)) + { + mysql_mutex_unlock(&mi->data_lock); + return true; + } + mysql_mutex_unlock(&mi->data_lock); + } + return false; +} + #endif /* HAVE_REPLICATION */ |