Comment 2 for bug 1570560

Revision history for this message
Andrew Garner (muzazzi) wrote :

With this PR, I see the FLUSH ENGINE LOGS being executed now, but xtrabackup-v2 based SST still fails under MariaDB 10.1.13 with a similar rate - failing about 99% of the time if I have sysbench write workload running in the background on some other node.

However, additionally moving the "FLUSH ENGINE LOGS" to occur *before* the galera_info bits get run gives me a 100% pass rate over 1000 SST attempts. That change looks like this (based off the gl-sergei/2.3-xb-bug1570560 branch):

diff --git a/storage/innobase/xtrabackup/src/backup_copy.cc b/storage/innobase/xtrabackup/src/backup_copy.cc
index 22f28ec..2014835 100644
--- a/storage/innobase/xtrabackup/src/backup_copy.cc
+++ b/storage/innobase/xtrabackup/src/backup_copy.cc
@@ -1258,6 +1258,12 @@ backup_start()
   }
  }

+ if (have_flush_engine_logs) {
+ msg_ts("Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...\n");
+ xb_mysql_query(mysql_connection,
+ "FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS", false);
+ }
+
  /* The only reason why Galera/binlog info is written before
  wait_for_ibbackup_log_copy_finish() is that after that call the xtrabackup
  binary will start streamig a temporary copy of REDO log to stdout and
@@ -1277,11 +1283,6 @@ backup_start()
   write_binlog_info(mysql_connection);
  }

- if (have_flush_engine_logs) {
- msg_ts("Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...\n");
- xb_mysql_query(mysql_connection,
- "FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS", false);
- }

  return(true);
 }
diff --git a/storage/innobase/xtrabackup/src/backup_mysql.cc b/storage/innobase/xtrabackup/src/backup_mysql.cc
index 26a0870..3d43551 100644
--- a/storage/innobase/xtrabackup/src/backup_mysql.cc
+++ b/storage/innobase/xtrabackup/src/backup_mysql.cc
@@ -374,7 +374,7 @@ get_mysql_vars(MYSQL *connection)
   have_galera_enabled = true;
  }

- if (strcmp(version_var, "5.5") >= 0) {
+ if (fnmatch("5.[123].*", version_var, FNM_PATHNAME) != 0) {
   have_flush_engine_logs = true;
  }