diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-10-31 21:06:49 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-10-31 21:06:49 +0100 |
commit | 80c951ce2875aac521b82323b5b6ebf638593445 (patch) | |
tree | df22c24e1fbe48362bd0eed50ec0c164e6c7e674 /extra | |
parent | 1fddccf676e213f94923f5efaaa76d9793b19a89 (diff) | |
parent | 794f66513967891520ec432123dcff8270871b93 (diff) | |
download | mariadb-git-80c951ce2875aac521b82323b5b6ebf638593445.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'extra')
-rw-r--r-- | extra/mariabackup/backup_copy.cc | 2 | ||||
-rw-r--r-- | extra/mariabackup/backup_copy.h | 4 | ||||
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 11 |
3 files changed, 15 insertions, 2 deletions
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 525481d5e9e..c8ce5346bfb 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -1444,7 +1444,7 @@ out: void backup_fix_ddl(void); -static lsn_t get_current_lsn(MYSQL *connection) +lsn_t get_current_lsn(MYSQL *connection) { static const char lsn_prefix[] = "\nLog sequence number "; lsn_t lsn = 0; diff --git a/extra/mariabackup/backup_copy.h b/extra/mariabackup/backup_copy.h index fbc09eaded3..7c886719f37 100644 --- a/extra/mariabackup/backup_copy.h +++ b/extra/mariabackup/backup_copy.h @@ -3,6 +3,7 @@ #define XTRABACKUP_BACKUP_COPY_H #include <my_global.h> +#include <mysql.h> #include "datasink.h" /* special files */ @@ -48,4 +49,7 @@ is_path_separator(char); bool directory_exists(const char *dir, bool create); +lsn_t +get_current_lsn(MYSQL *connection); + #endif diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 15c9d0d0d8d..0a45b7c4f9d 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -2570,6 +2570,8 @@ static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n, return(FALSE); } + memset(&write_filt_ctxt, 0, sizeof(xb_write_filt_ctxt_t)); + bool was_dropped; pthread_mutex_lock(&backup_mutex); was_dropped = (ddl_tracker.drops.find(node->space->id) != ddl_tracker.drops.end()); @@ -2601,7 +2603,6 @@ static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n, sizeof dst_name - 1); dst_name[sizeof dst_name - 1] = '\0'; - memset(&write_filt_ctxt, 0, sizeof(xb_write_filt_ctxt_t)); ut_a(write_filter.process != NULL); if (write_filter.init != NULL && @@ -2941,8 +2942,14 @@ static void dbug_mariabackup_event(const char *event,const char *key) } #define DBUG_MARIABACKUP_EVENT(A, B) DBUG_EXECUTE_IF("mariabackup_events", dbug_mariabackup_event(A,B);); +#define DBUG_MB_INJECT_CODE(EVENT, KEY, CODE) \ + DBUG_EXECUTE_IF("mariabackup_inject_code", {\ + char *env = getenv(EVENT); \ + if (env && !strcmp(env, KEY)) { CODE } \ + }) #else #define DBUG_MARIABACKUP_EVENT(A,B) +#define DBUG_MB_INJECT_CODE(EVENT, KEY, CODE) #endif /************************************************************************** @@ -2967,6 +2974,8 @@ DECLARE_THREAD(data_copy_thread_func)( while ((node = datafiles_iter_next(ctxt->it)) != NULL) { DBUG_MARIABACKUP_EVENT("before_copy", node->space->name); + DBUG_MB_INJECT_CODE("wait_innodb_redo_before_copy", node->space->name, + backup_wait_for_lsn(get_current_lsn(mysql_connection));); /* copy the datafile */ if (xtrabackup_copy_datafile(node, num, NULL, xtrabackup_incremental ? wf_incremental : wf_write_through)) |