diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-17 15:39:21 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-17 15:39:21 +0200 |
commit | fb4a897fd97c07c493449a17fa56aa462ca30eb9 (patch) | |
tree | 5898ded6c3d5fa1b9a67df31641aa29fbe7297e9 | |
parent | 3c7718150d6f4d608d0e37575e3c0d3ea9c5c119 (diff) | |
download | mariadb-git-fb4a897fd97c07c493449a17fa56aa462ca30eb9.tar.gz |
MDEV-12353 preparation: Remove UNIV_LOG_LSN_DEBUG
The debug instrumentation with the MLOG_LSN pseudo-record has not been
used for debugging for years. Let us remove this code now.
It would have to be removed as part of MDEV-12353 or MDEV-14425 anyway,
when implementing a new redo log file format.
-rw-r--r-- | storage/innobase/include/log0log.ic | 46 | ||||
-rw-r--r-- | storage/innobase/include/mtr0types.h | 5 | ||||
-rw-r--r-- | storage/innobase/include/univ.i | 3 | ||||
-rw-r--r-- | storage/innobase/log/log0recv.cc | 41 | ||||
-rw-r--r-- | storage/innobase/srv/srv0start.cc | 8 |
5 files changed, 0 insertions, 103 deletions
diff --git a/storage/innobase/include/log0log.ic b/storage/innobase/include/log0log.ic index 0be1f2a8a8d..447ed647b9f 100644 --- a/storage/innobase/include/log0log.ic +++ b/storage/innobase/include/log0log.ic @@ -28,9 +28,6 @@ Created 12/9/1995 Heikki Tuuri #include "srv0mon.h" #include "ut0crc32.h" -#ifdef UNIV_LOG_LSN_DEBUG -#include "mtr0types.h" -#endif /* UNIV_LOG_LSN_DEBUG */ extern ulong srv_log_buffer_size; /************************************************************//** @@ -288,32 +285,7 @@ log_reserve_and_write_fast( ut_ad(log_mutex_own()); ut_ad(len > 0); -#ifdef UNIV_LOG_LSN_DEBUG - /* Append a MLOG_LSN record after mtr_commit(), except when - the last bytes could be a MLOG_CHECKPOINT marker. We have special - handling when the log consists of only a single MLOG_CHECKPOINT - record since the latest checkpoint, and appending the - MLOG_LSN would ruin that. - - Note that a longer redo log record could happen to end in what - looks like MLOG_CHECKPOINT, and we could be omitting MLOG_LSN - without reason. This is OK, because writing the MLOG_LSN is - just a 'best effort', aimed at finding log corruption due to - bugs in the redo log writing logic. */ - const ulint lsn_len - = len >= SIZE_OF_MLOG_CHECKPOINT - && MLOG_CHECKPOINT == static_cast<const char*>(str)[ - len - SIZE_OF_MLOG_CHECKPOINT] - ? 0 - : 1 - + mach_get_compressed_size(log_sys.lsn >> 32) - + mach_get_compressed_size(log_sys.lsn & 0xFFFFFFFFUL); -#endif /* UNIV_LOG_LSN_DEBUG */ - const ulint data_len = len -#ifdef UNIV_LOG_LSN_DEBUG - + lsn_len -#endif /* UNIV_LOG_LSN_DEBUG */ + log_sys.buf_free % OS_FILE_LOG_BLOCK_SIZE; if (data_len >= log_sys.trailer_offset()) { @@ -326,24 +298,6 @@ log_reserve_and_write_fast( *start_lsn = log_sys.lsn; -#ifdef UNIV_LOG_LSN_DEBUG - if (lsn_len) { - /* Write the LSN pseudo-record. */ - byte* b = &log_sys.buf[log_sys.buf_free]; - - *b++ = MLOG_LSN | (MLOG_SINGLE_REC_FLAG & *(const byte*) str); - - /* Write the LSN in two parts, - as a pseudo page number and space id. */ - b += mach_write_compressed(b, log_sys.lsn >> 32); - b += mach_write_compressed(b, log_sys.lsn & 0xFFFFFFFFUL); - ut_a(b - lsn_len == &log_sys.buf[log_sys.buf_free]); - - ::memcpy(b, str, len); - - len += lsn_len; - } else -#endif /* UNIV_LOG_LSN_DEBUG */ memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(log_sys.buf + log_sys.buf_free, str, len); diff --git a/storage/innobase/include/mtr0types.h b/storage/innobase/include/mtr0types.h index 06ac4a62e78..cf1ddbc7657 100644 --- a/storage/innobase/include/mtr0types.h +++ b/storage/innobase/include/mtr0types.h @@ -123,11 +123,6 @@ enum mlog_id_t { /** initialize an ibuf bitmap page (used in MariaDB 10.2 and 10.3) */ MLOG_IBUF_BITMAP_INIT = 27, -#ifdef UNIV_LOG_LSN_DEBUG - /** Current LSN */ - MLOG_LSN = 28, -#endif /* UNIV_LOG_LSN_DEBUG */ - /** write a string to a page */ MLOG_WRITE_STRING = 30, diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index ce87617fa8d..7ce2a092b9e 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -199,9 +199,6 @@ using the call command. */ assertions. */ #define UNIV_LRU_DEBUG /* debug the buffer pool LRU */ #define UNIV_HASH_DEBUG /* debug HASH_ macros */ -#define UNIV_LOG_LSN_DEBUG /* write LSN to the redo log; -this will break redo log file compatibility, but it may be useful when -debugging redo log application problems. */ #define UNIV_IBUF_DEBUG /* debug the insert buffer */ #define UNIV_PERF_DEBUG /* debug flag that enables light weight performance diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 8e3a55f4197..e77910af743 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -1369,11 +1369,6 @@ parse_log: const byte* old_ptr = ptr; switch (type) { -#ifdef UNIV_LOG_LSN_DEBUG - case MLOG_LSN: - /* The LSN is checked in recv_parse_log_rec(). */ - break; -#endif /* UNIV_LOG_LSN_DEBUG */ case MLOG_1BYTE: case MLOG_2BYTES: case MLOG_4BYTES: case MLOG_8BYTES: case MLOG_MEMSET: #ifdef UNIV_DEBUG @@ -2361,20 +2356,6 @@ recv_parse_log_rec( } switch (*ptr) { -#ifdef UNIV_LOG_LSN_DEBUG - case MLOG_LSN | MLOG_SINGLE_REC_FLAG: - case MLOG_LSN: - new_ptr = mlog_parse_initial_log_record( - ptr, end_ptr, type, space, page_no); - if (new_ptr != NULL) { - const lsn_t lsn = static_cast<lsn_t>( - *space) << 32 | *page_no; - ut_a(lsn == recv_sys.recovered_lsn); - } - - *type = MLOG_LSN; - return(new_ptr - ptr); -#endif /* UNIV_LOG_LSN_DEBUG */ case MLOG_MULTI_REC_END: case MLOG_DUMMY_RECORD: *type = static_cast<mlog_id_t>(*ptr); @@ -2560,9 +2541,6 @@ loop: switch (*ptr) { case MLOG_CHECKPOINT: -#ifdef UNIV_LOG_LSN_DEBUG - case MLOG_LSN: -#endif /* UNIV_LOG_LSN_DEBUG */ case MLOG_DUMMY_RECORD: single_rec = true; break; @@ -2650,13 +2628,6 @@ loop: return(true); } break; -#ifdef UNIV_LOG_LSN_DEBUG - case MLOG_LSN: - /* Do not add these records to the hash table. - The page number and space id fields are misused - for something else. */ - break; -#endif /* UNIV_LOG_LSN_DEBUG */ default: switch (store) { case STORE_NO: @@ -2822,13 +2793,6 @@ corrupted_log: case MLOG_MULTI_REC_END: /* Found the end mark for the records */ goto loop; -#ifdef UNIV_LOG_LSN_DEBUG - case MLOG_LSN: - /* Do not add these records to the hash table. - The page number and space id fields are misused - for something else. */ - break; -#endif /* UNIV_LOG_LSN_DEBUG */ case MLOG_INDEX_LOAD: recv_mlog_index_load(space, page_no, old_lsn); break; @@ -3834,11 +3798,6 @@ static const char* get_mlog_string(mlog_id_t type) case MLOG_IBUF_BITMAP_INIT: return("MLOG_IBUF_BITMAP_INIT"); -#ifdef UNIV_LOG_LSN_DEBUG - case MLOG_LSN: - return("MLOG_LSN"); -#endif /* UNIV_LOG_LSN_DEBUG */ - case MLOG_WRITE_STRING: return("MLOG_WRITE_STRING"); diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 3ea2f967b68..4d733f3f03c 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1226,14 +1226,6 @@ dberr_t srv_start(bool create_new_db) ib::info() << "!!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!"; #endif -#ifdef UNIV_LOG_LSN_DEBUG - ib::info() << "!!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!"; -#endif /* UNIV_LOG_LSN_DEBUG */ - -#if defined(COMPILER_HINTS_ENABLED) - ib::info() << "Compiler hints enabled."; -#endif /* defined(COMPILER_HINTS_ENABLED) */ - #ifdef _WIN32 ib::info() << "Mutexes and rw_locks use Windows interlocked functions"; #else |