summaryrefslogtreecommitdiff
path: root/extra/mariabackup/xtrabackup.cc
diff options
context:
space:
mode:
authorVlad Lesin <vlad_lesin@mail.ru>2020-10-27 20:03:41 +0300
committerOleksandr Byelkin <sanja@mariadb.com>2020-10-29 07:39:43 +0100
commit6cb88685c46e74e7b4644b0bc64d283c969468fe (patch)
tree60ba9e9e60158fab9331bfa9c68721a5a3646712 /extra/mariabackup/xtrabackup.cc
parent9e3e4c0e04509ebdac9017c334927fe7e2fbda5e (diff)
downloadmariadb-git-6cb88685c46e74e7b4644b0bc64d283c969468fe.tar.gz
MDEV-24026: InnoDB: Failing assertion: os_total_large_mem_allocated >= size upon incremental backup
mariabackup deallocated uninitialized write_filt_ctxt.u.wf_incremental_ctxt in xtrabackup_copy_datafile() when some table should be skipped due to parsed DDL redo log record.
Diffstat (limited to 'extra/mariabackup/xtrabackup.cc')
-rw-r--r--extra/mariabackup/xtrabackup.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 668a355f0fa..364d1242b29 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -2578,6 +2578,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());
@@ -2605,7 +2607,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 &&
@@ -2947,8 +2948,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
/**************************************************************************
@@ -2973,6 +2980,8 @@ 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))