summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-11-29 14:53:12 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-11-29 14:53:12 +0000
commitbf6d11c4d66f155ce84ba45541f0333493aa084e (patch)
tree5234e99e4fe82b10c716cfed1b2fe36aab4b0e1f /extra
parent40756c9151a564b57f351111d7486b4d18ef5e39 (diff)
downloadmariadb-git-bf6d11c4d66f155ce84ba45541f0333493aa084e.tar.gz
MDEV-14536 : In mariabackup, reread redo log blocks , if checksum mismatch
is detected. The checksum mismatch can be due to partial write, thus retry the read
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/xtrabackup.cc31
1 files changed, 22 insertions, 9 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index a50504be274..4d179961d1d 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -2555,8 +2555,9 @@ xtrabackup_scan_log_recs(
to this lsn */
lsn_t* group_scanned_lsn,/*!< out: scanning succeeded up to
this lsn */
- bool* finished) /*!< out: false if is not able to scan
+ bool* finished, /*!< out: false if is not able to scan
any more in this log group */
+ bool* must_reread_log) /*!< out: should re-read buffer from disk, incomplete read*/
{
lsn_t scanned_lsn;
ulint data_len;
@@ -2566,6 +2567,7 @@ xtrabackup_scan_log_recs(
ulint scanned_checkpoint_no = 0;
*finished = false;
+ *must_reread_log = false;
scanned_lsn = start_lsn;
log_block = log_sys->buf;
@@ -2622,8 +2624,10 @@ xtrabackup_scan_log_recs(
msg("mariabackup: warning: this is possible when the "
"log block has not been fully written by the "
"server, will retry later.\n");
- *finished = true;
- break;
+ *finished = false;
+ *must_reread_log = true;
+ my_sleep(1000);
+ return false;
}
if (log_block_get_flush_bit(log_block)) {
@@ -2735,14 +2739,23 @@ xtrabackup_copy_logfile(lsn_t from_lsn, my_bool is_last)
mutex_enter(&log_sys->mutex);
- log_group_read_log_seg(LOG_RECOVER, log_sys->buf,
- group, start_lsn, end_lsn, false);
+ bool scan_ok = false;
+ bool must_reread_log;
+ int retries = 0;
+ do {
+
+ log_group_read_log_seg(LOG_RECOVER, log_sys->buf,
+ group, start_lsn, end_lsn, false);
- if (!xtrabackup_scan_log_recs(group, is_last,
- start_lsn, &contiguous_lsn, &group_scanned_lsn,
- &finished)) {
+ scan_ok = xtrabackup_scan_log_recs(group, is_last,
+ start_lsn, &contiguous_lsn, &group_scanned_lsn,
+ &finished, &must_reread_log);
+
+ } while (!scan_ok && must_reread_log && retries++ < 100);
+
+ if (!scan_ok) {
goto error;
- }
+ }
mutex_exit(&log_sys->mutex);