diff options
| author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-08-18 18:22:35 +0300 |
|---|---|---|
| committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-08-18 18:22:35 +0300 |
| commit | 4a2595727465648f2d4e794d1b2f182345f0bee8 (patch) | |
| tree | 8d4734e6c5b2795455416191ca50d5a0fbd23cd9 /sql/sql_repl.cc | |
| parent | da171182b7d79d21177d113d2bbaecbca21d8bbc (diff) | |
| parent | f84e28c119b495da77e197f7cd18af4048fc3126 (diff) | |
| download | mariadb-git-4a2595727465648f2d4e794d1b2f182345f0bee8.tar.gz | |
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_repl.cc')
| -rw-r--r-- | sql/sql_repl.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index ff2faca5ecf..c49ea7d5908 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -4375,6 +4375,7 @@ bool show_binlogs(THD* thd) Protocol *protocol= thd->protocol; uint retry_count= 0; size_t cur_dir_len; + uint64 expected_reset_masters; DBUG_ENTER("show_binlogs"); if (!mysql_bin_log.is_open()) @@ -4399,6 +4400,7 @@ retry: mysql_mutex_lock(mysql_bin_log.get_log_lock()); mysql_bin_log.lock_index(); mysql_bin_log.raw_get_current_log(&cur); + expected_reset_masters= mysql_bin_log.get_reset_master_count(); mysql_mutex_unlock(mysql_bin_log.get_log_lock()); /* The following call unlocks lock_index */ @@ -4419,6 +4421,16 @@ retry: cur_link->name.str+= dir_len; cur_link->name.length-= dir_len; + if (mysql_bin_log.get_reset_master_count() > expected_reset_masters) + { + /* + Reset master was called after we cached filenames. + Reinitialize the cache. + */ + free_root(&mem_root, MYF(MY_MARK_BLOCKS_FREE)); + goto retry; + } + if (!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length))) cur_link->size= cur.pos; /* The active log, use the active position */ else |
