diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-25 17:26:23 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-25 17:26:23 +0300 |
commit | b2dbc781c7c7d5638c5e7b3640656cb63543deb6 (patch) | |
tree | 392dae82a10c896d5b33ef5b7ce4f5b3de897e5c /storage/innobase | |
parent | 6c5c1f0b2fc71ab7e90dc7798180135e7967a264 (diff) | |
download | mariadb-git-b2dbc781c7c7d5638c5e7b3640656cb63543deb6.tar.gz |
Implement --debug=d,ib_log_checkpoint_avoid
Normally, the InnoDB master thread executes InnoDB log checkpoints
so frequently that bugs in crash recovery or redo logging can be
hard to reproduce. This is because crash recovery would start replaying
the log only from the latest checkpoint. Because the InnoDB redo log
format only allows saving information for at most 2 latest checkpoints,
and because the log files are written in a circular fashion, it would
be challenging to implement a debug option that would start the redo
log apply from the very start of the redo log file.
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/srv/srv0srv.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 1adf1f137d6..58596175681 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -2244,6 +2244,16 @@ srv_master_do_active_tasks(void) MONITOR_SRV_DICT_LRU_MICROSECOND, counter_time); } + /* The periodic log_checkpoint() call here makes it harder to + reproduce bugs in crash recovery or mariabackup --prepare, or + in code that writes the redo log records. Omitting the call + here should not affect correctness, because log_free_check() + should still be invoking checkpoints when needed. In a + production server, those calls could cause "furious flushing" + and stall the server. Normally we want to perform checkpoints + early and often to avoid those situations. */ + DBUG_EXECUTE_IF("ib_log_checkpoint_avoid", return;); + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2323,6 +2333,16 @@ srv_master_do_idle_tasks(void) MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_LOG_FLUSH_MICROSECOND, counter_time); + /* The periodic log_checkpoint() call here makes it harder to + reproduce bugs in crash recovery or mariabackup --prepare, or + in code that writes the redo log records. Omitting the call + here should not affect correctness, because log_free_check() + should still be invoking checkpoints when needed. In a + production server, those calls could cause "furious flushing" + and stall the server. Normally we want to perform checkpoints + early and often to avoid those situations. */ + DBUG_EXECUTE_IF("ib_log_checkpoint_avoid", return;); + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } |