summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-05-24 16:19:38 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-05-24 16:19:38 +0300
commit5d2619b6931a967df52acb6cb650c0619dcc70d2 (patch)
treeb93976ad053fcca30d8282b8e596be0715633910 /extra
parent592fe954ef82be1bc08b29a8e54f7729eb1e1343 (diff)
downloadmariadb-git-5d2619b6931a967df52acb6cb650c0619dcc70d2.tar.gz
MDEV-19584 Allocate recv_sys statically
There is only one InnoDB crash recovery subsystem. Allocating recv_sys statically removes one level of pointer indirection and makes code more readable, and removes the awkward initialization of recv_sys->dblwr. recv_sys_t::create(): Replaces recv_sys_init(). recv_sys_t::debug_free(): Replaces recv_sys_debug_free(). recv_sys_t::close(): Replaces recv_sys_close(). recv_sys_t::add(): Replaces recv_add_to_hash_table(). recv_sys_t::empty(): Replaces recv_sys_empty_hash().
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/xtrabackup.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index eda4be956dc..56653a192d3 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -2667,7 +2667,7 @@ static lsn_t xtrabackup_copy_log(lsn_t start_lsn, lsn_t end_lsn, bool last)
log_block,
scanned_lsn + data_len);
- recv_sys->scanned_lsn = scanned_lsn + data_len;
+ recv_sys.scanned_lsn = scanned_lsn + data_len;
if (data_len == OS_FILE_LOG_BLOCK_SIZE) {
/* We got a full log block. */
@@ -2719,13 +2719,13 @@ static lsn_t xtrabackup_copy_log(lsn_t start_lsn, lsn_t end_lsn, bool last)
static bool xtrabackup_copy_logfile(bool last = false)
{
ut_a(dst_log_file != NULL);
- ut_ad(recv_sys != NULL);
+ ut_ad(recv_sys.is_initialised());
lsn_t start_lsn;
lsn_t end_lsn;
- recv_sys->parse_start_lsn = log_copy_scanned_lsn;
- recv_sys->scanned_lsn = log_copy_scanned_lsn;
+ recv_sys.parse_start_lsn = log_copy_scanned_lsn;
+ recv_sys.scanned_lsn = log_copy_scanned_lsn;
start_lsn = ut_uint64_align_down(log_copy_scanned_lsn,
OS_FILE_LOG_BLOCK_SIZE);
@@ -2748,15 +2748,15 @@ static bool xtrabackup_copy_logfile(bool last = false)
if (lsn == start_lsn) {
start_lsn = 0;
} else {
- mutex_enter(&recv_sys->mutex);
+ mutex_enter(&recv_sys.mutex);
start_lsn = xtrabackup_copy_log(start_lsn, lsn, last);
- mutex_exit(&recv_sys->mutex);
+ mutex_exit(&recv_sys.mutex);
}
log_mutex_exit();
if (!start_lsn) {
- msg(recv_sys->found_corrupt_log
+ msg(recv_sys.found_corrupt_log
? "xtrabackup_copy_logfile() failed: corrupt log."
: "xtrabackup_copy_logfile() failed.");
return true;
@@ -4071,7 +4071,7 @@ fail:
ut_crc32_init();
crc_init();
- recv_sys_init();
+ recv_sys.create();
#ifdef WITH_INNODB_DISALLOW_WRITES
srv_allow_writes_event = os_event_create(0);
@@ -4231,7 +4231,7 @@ fail_before_log_copying_thread_start:
/* copy log file by current position */
log_copy_scanned_lsn = checkpoint_lsn_start;
- recv_sys->recovered_lsn = log_copy_scanned_lsn;
+ recv_sys.recovered_lsn = log_copy_scanned_lsn;
log_optimized_ddl_op = backup_optimized_ddl_op;
if (xtrabackup_copy_logfile())
@@ -5471,7 +5471,7 @@ static bool xtrabackup_prepare_func(char** argv)
sync_check_init();
ut_d(sync_check_enable());
ut_crc32_init();
- recv_sys_init();
+ recv_sys.create();
log_sys.create();
recv_recovery_on = true;