Skip to content

Commit

Permalink
MDEV-27917 Some redo log diagnostics is always reported as 0
Browse files Browse the repository at this point in the history
The InnoDB monitor counter log_sys.n_log_ios was almost removed
in commit 685d958 (MDEV-14425).
This counter was rather meaningless already since
commit 30ea63b
introduced a redo log group commit mechanism, and on the persistent
memory interface there are no file system calls that could be counted.

The only case when log_sys.n_log_ios was updated is when the log file
was being read during crash recovery.

Some related output in log_print() as well as the
information_schema.innodb_metrics counter log_num_log_io are best removed.
  • Loading branch information
dr-m committed Feb 22, 2022
1 parent 30b036d commit 934b2d6
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ log_lsn_current recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0
log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current LSN value minus LSN at last checkpoint
log_lsn_buf_pool_oldest recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value The oldest modified block LSN in the buffer pool
log_max_modified_age_async recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Maximum LSN difference; when exceeded, start asynchronous preflush
log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of log I/Os
log_waits recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log waits due to small log buffer (innodb_log_waits)
log_write_requests recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log write requests (innodb_log_write_requests)
log_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log writes (innodb_log_writes)
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/innodb/r/monitor.result
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ log_lsn_current disabled
log_lsn_checkpoint_age disabled
log_lsn_buf_pool_oldest disabled
log_max_modified_age_async disabled
log_num_log_io disabled
log_waits disabled
log_write_requests disabled
log_writes disabled
Expand Down
15 changes: 0 additions & 15 deletions storage/innobase/include/log0log.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ void
log_print(
/*======*/
FILE* file); /*!< in: file where to print */
/**********************************************************************//**
Refreshes the statistics used to print per-second averages. */
void
log_refresh_stats(void);
/*===================*/

/** Offsets of a log file header */
/* @{ */
Expand Down Expand Up @@ -240,16 +235,6 @@ struct log_t
/** Log file */
log_file_t log;

/** The fields involved in the log buffer flush @{ */

ulint n_log_ios; /*!< number of log i/os initiated thus
far */
ulint n_log_ios_old; /*!< number of log i/o's at the
previous printout */
time_t last_printout_time;/*!< when log_print was last time
called */
/* @} */

/** Fields involved in checkpoints @{ */
lsn_t log_capacity; /*!< capacity of the log; if
the checkpoint age exceeds this, it is
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/include/srv0mon.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ enum monitor_id_t {
MONITOR_LSN_CHECKPOINT_AGE,
MONITOR_OVLD_BUF_OLDEST_LSN,
MONITOR_OVLD_MAX_AGE_ASYNC,
MONITOR_LOG_IO,
MONITOR_OVLD_LOG_WAITS,
MONITOR_OVLD_LOG_WRITE_REQUEST,
MONITOR_OVLD_LOG_WRITES,
Expand Down
39 changes: 0 additions & 39 deletions storage/innobase/log/log0log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,7 @@ void log_t::create()
max_buf_free= buf_size / LOG_BUF_FLUSH_RATIO - LOG_BUF_FLUSH_MARGIN;
set_check_flush_or_checkpoint();

n_log_ios_old= n_log_ios;
last_printout_time= time(NULL);

last_checkpoint_lsn= FIRST_LSN;
n_log_ios= 0;
n_log_ios_old= 0;
log_capacity= 0;
max_modified_age_async= 0;
max_checkpoint_age= 0;
Expand Down Expand Up @@ -1007,9 +1002,6 @@ log_print(
/*======*/
FILE* file) /*!< in: file where to print */
{
double time_elapsed;
time_t current_time;

log_sys.latch.rd_lock(SRW_LOCK_CALL);

const lsn_t lsn= log_sys.get_lsn();
Expand All @@ -1027,40 +1019,9 @@ log_print(
pages_flushed,
lsn_t{log_sys.last_checkpoint_lsn});

current_time = time(NULL);

time_elapsed = difftime(current_time,
log_sys.last_printout_time);

if (time_elapsed <= 0) {
time_elapsed = 1;
}

fprintf(file,
ULINTPF " pending chkp writes\n"
ULINTPF " log i/o's done, %.2f log i/o's/second\n",
log_sys.n_pending_checkpoint_writes,
log_sys.n_log_ios,
static_cast<double>(
log_sys.n_log_ios - log_sys.n_log_ios_old)
/ time_elapsed);

log_sys.n_log_ios_old = log_sys.n_log_ios;
log_sys.last_printout_time = current_time;

log_sys.latch.rd_unlock();
}

/**********************************************************************//**
Refreshes the statistics used to print per-second averages. */
void
log_refresh_stats(void)
/*===================*/
{
log_sys.n_log_ios_old = log_sys.n_log_ios;
log_sys.last_printout_time = time(NULL);
}

/** Shut down the redo log subsystem. */
void log_t::close()
{
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/log/log0recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3546,7 +3546,6 @@ static bool recv_scan_log(bool last_phase)
if (source_offset + size > log_sys.file_size)
size= static_cast<size_t>(log_sys.file_size - source_offset);

log_sys.n_log_ios++;
if (dberr_t err= log_sys.log.read(source_offset,
{log_sys.buf + recv_sys.len, size}))
{
Expand Down
9 changes: 0 additions & 9 deletions storage/innobase/srv/srv0mon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,6 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_MAX_AGE_ASYNC},

{"log_num_log_io", "recovery", "Number of log I/Os",
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_LOG_IO},

{"log_waits", "recovery",
"Number of log waits due to small log buffer (innodb_log_waits)",
static_cast<monitor_type_t>(
Expand Down Expand Up @@ -1706,10 +1701,6 @@ srv_mon_process_existing_counter(
value = log_sys.get_lsn();
break;

case MONITOR_LOG_IO:
value = log_sys.n_log_ios;
break;

case MONITOR_OVLD_CHECKPOINTS:
value = log_sys.next_checkpoint_no;
break;
Expand Down
2 changes: 0 additions & 2 deletions storage/innobase/srv/srv0srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,6 @@ static void srv_refresh_innodb_monitor_stats(time_t current_time)
btr_cur_n_non_sea_old = btr_cur_n_non_sea;
#endif /* BTR_CUR_HASH_ADAPT */

log_refresh_stats();

buf_refresh_io_stats();

srv_n_rows_inserted_old = srv_stats.n_rows_inserted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ log_lsn_current recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0
log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current LSN value minus LSN at last checkpoint
log_lsn_buf_pool_oldest recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value The oldest modified block LSN in the buffer pool
log_max_modified_age_async recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Maximum LSN difference; when exceeded, start asynchronous preflush
log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of log I/Os
log_waits recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log waits due to small log buffer (innodb_log_waits)
log_write_requests recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log write requests (innodb_log_write_requests)
log_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of log writes (innodb_log_writes)
Expand Down

0 comments on commit 934b2d6

Please sign in to comment.