diff options
| author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-02 11:05:47 +0200 |
|---|---|---|
| committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-02 11:15:04 +0200 |
| commit | 9949ab93939369fd4dacab859428c1c4effd5cca (patch) | |
| tree | 86078a38df0744c89ffaa3af69889cf8436c3935 | |
| parent | 562c037b485b25f76fc7cb8e2c526d532450df7a (diff) | |
| download | mariadb-git-9949ab93939369fd4dacab859428c1c4effd5cca.tar.gz | |
MDEV-12353 preparation: Cleanup MLOG_FILE_NAME logging
mtr_t::commit_files(): Renamed from mtr_t::commit_checkpoint().
Remove the redundant bool parameter, and instead use checkpoint_lsn=0
to indicate that no checkpoint marker should be written.
| -rw-r--r-- | storage/innobase/fil/fil0fil.cc | 7 | ||||
| -rw-r--r-- | storage/innobase/include/mtr0mtr.h | 12 | ||||
| -rw-r--r-- | storage/innobase/mtr/mtr0mtr.cc | 19 |
3 files changed, 15 insertions, 23 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 64ff8a19c8b..e7c6f0a45aa 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2019, MariaDB Corporation. +Copyright (c) 2014, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -4701,6 +4701,7 @@ fil_names_clear( ); ut_ad(log_mutex_own()); + ut_ad(lsn); if (log_sys.append_on_checkpoint) { mtr_write_log(log_sys.append_on_checkpoint); @@ -4741,7 +4742,7 @@ fil_names_clear( if (mtr_log->size() > mtr_checkpoint_size) { ut_ad(mtr_log->size() < (RECV_PARSING_BUF_SIZE / 2)); - mtr.commit_checkpoint(lsn, false); + mtr.commit_files(); mtr.start(); } @@ -4749,7 +4750,7 @@ fil_names_clear( } if (do_write) { - mtr.commit_checkpoint(lsn, true); + mtr.commit_files(lsn); } else { ut_ad(!mtr.has_modifications()); } diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index 635270d8a11..a30af5fe809 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -2,7 +2,7 @@ Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -135,15 +135,11 @@ struct mtr_t { /** Commit a mini-transaction that did not modify any pages, but generated some redo log on a higher level, such as - MLOG_FILE_NAME records and a MLOG_CHECKPOINT marker. + MLOG_FILE_NAME records and an optional MLOG_CHECKPOINT marker. The caller must invoke log_mutex_enter() and log_mutex_exit(). This is to be used at log_checkpoint(). - @param[in] checkpoint_lsn the LSN of the log checkpoint - @param[in] write_mlog_checkpoint Write MLOG_CHECKPOINT marker - if it is enabled. */ - void commit_checkpoint( - lsn_t checkpoint_lsn, - bool write_mlog_checkpoint); + @param[in] checkpoint_lsn log checkpoint LSN, or 0 */ + void commit_files(lsn_t checkpoint_lsn = 0); /** Return current size of the buffer. @return savepoint */ diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 65fff8bb8e9..20e034e06b7 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -451,16 +451,11 @@ mtr_t::commit() /** Commit a mini-transaction that did not modify any pages, but generated some redo log on a higher level, such as -MLOG_FILE_NAME records and a MLOG_CHECKPOINT marker. +MLOG_FILE_NAME records and an optional MLOG_CHECKPOINT marker. The caller must invoke log_mutex_enter() and log_mutex_exit(). This is to be used at log_checkpoint(). -@param[in] checkpoint_lsn the LSN of the log checkpoint -@param[in] write_mlog_checkpoint Write MLOG_CHECKPOINT marker - if it is enabled. */ -void -mtr_t::commit_checkpoint( - lsn_t checkpoint_lsn, - bool write_mlog_checkpoint) +@param[in] checkpoint_lsn log checkpoint LSN, or 0 */ +void mtr_t::commit_files(lsn_t checkpoint_lsn) { ut_ad(log_mutex_own()); ut_ad(is_active()); @@ -469,7 +464,7 @@ mtr_t::commit_checkpoint( ut_ad(!m_made_dirty); ut_ad(m_memo.size() == 0); ut_ad(!srv_read_only_mode); - ut_ad(write_mlog_checkpoint || m_n_log_recs > 1); + ut_ad(checkpoint_lsn || m_n_log_recs > 1); switch (m_n_log_recs) { case 0: @@ -481,7 +476,7 @@ mtr_t::commit_checkpoint( mlog_catenate_ulint(&m_log, MLOG_MULTI_REC_END, MLOG_1BYTE); } - if (write_mlog_checkpoint) { + if (checkpoint_lsn) { byte* ptr = m_log.push<byte*>(SIZE_OF_MLOG_CHECKPOINT); compile_time_assert(SIZE_OF_MLOG_CHECKPOINT == 1 + 8); *ptr = MLOG_CHECKPOINT; @@ -491,7 +486,7 @@ mtr_t::commit_checkpoint( finish_write(m_log.size()); release_resources(); - if (write_mlog_checkpoint) { + if (checkpoint_lsn) { DBUG_PRINT("ib_log", ("MLOG_CHECKPOINT(" LSN_PF ") written at " LSN_PF, checkpoint_lsn, log_sys.lsn)); |
