summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-05-06 18:07:40 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-05-06 18:07:40 +0200
commit633946fb63f6957b49554ce6f6d33862951d810e (patch)
tree75c9cc603540057d7e59df67ed26bb2893e07b97 /storage
parent54d0a55adf6fbfc92c5473bbcad2b459f14ef038 (diff)
parent0573744a83ad89958c4e48a9299cd9274db1b355 (diff)
downloadmariadb-git-633946fb63f6957b49554ce6f6d33862951d810e.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/log/log0log.cc6
-rw-r--r--storage/innobase/srv/srv0mon.cc28
-rw-r--r--storage/xtradb/log/log0log.cc21
-rw-r--r--storage/xtradb/srv/srv0mon.cc28
4 files changed, 50 insertions, 33 deletions
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index da301a3b4f1..316e337ec4e 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -885,8 +885,6 @@ log_group_file_header_flush(
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
srv_stats.os_log_pending_writes.inc();
const ulint page_no
@@ -1006,8 +1004,6 @@ loop:
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
srv_stats.os_log_pending_writes.inc();
ut_a(next_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
@@ -1053,7 +1049,6 @@ log_write_flush_to_disk_low()
fil_flush(SRV_LOG_SPACE_FIRST_ID);
}
- MONITOR_DEC(MONITOR_PENDING_LOG_FLUSH);
log_mutex_enter();
if (do_flush) {
@@ -1197,7 +1192,6 @@ loop:
if (flush_to_disk) {
log_sys->n_pending_flushes++;
log_sys->current_flush_lsn = log_sys->lsn;
- MONITOR_INC(MONITOR_PENDING_LOG_FLUSH);
os_event_reset(log_sys->flush_event);
if (log_sys->buf_free == log_sys->buf_next_to_write) {
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index de1c0d27efe..ff965989ce4 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -922,15 +922,18 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_DEFAULT_START, MONITOR_OVLD_MAX_AGE_SYNC},
{"log_pending_log_flushes", "recovery", "Pending log flushes",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_PENDING_LOG_FLUSH},
{"log_pending_checkpoint_writes", "recovery", "Pending checkpoints",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_PENDING_CHECKPOINT_WRITE},
{"log_num_log_io", "recovery", "Number of log I/Os",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_LOG_IO},
{"log_waits", "recovery",
@@ -2007,6 +2010,25 @@ srv_mon_process_existing_counter(
value = (mon_type_t) log_sys->lsn;
break;
+ case MONITOR_PENDING_LOG_FLUSH:
+ mutex_enter(&log_sys->mutex);
+ value = static_cast<mon_type_t>(log_sys->n_pending_flushes);
+ mutex_exit(&log_sys->mutex);
+ break;
+
+ case MONITOR_PENDING_CHECKPOINT_WRITE:
+ mutex_enter(&log_sys->mutex);
+ value = static_cast<mon_type_t>(
+ log_sys->n_pending_checkpoint_writes);
+ mutex_exit(&log_sys->mutex);
+ break;
+
+ case MONITOR_LOG_IO:
+ mutex_enter(&log_sys->mutex);
+ value = static_cast<mon_type_t>(log_sys->n_log_ios);
+ mutex_exit(&log_sys->mutex);
+ break;
+
case MONITOR_OVLD_BUF_OLDEST_LSN:
value = (mon_type_t) buf_pool_get_oldest_modification();
break;
diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc
index 19b4ac3732a..a89ad531871 100644
--- a/storage/xtradb/log/log0log.cc
+++ b/storage/xtradb/log/log0log.cc
@@ -1305,7 +1305,6 @@ log_io_complete(
group->n_pending_writes--;
log_sys->n_pending_writes--;
- MONITOR_DEC(MONITOR_PENDING_LOG_WRITE);
unlock = log_group_check_flush_completion(group);
unlock = unlock | log_sys_check_flush_completion();
@@ -1357,8 +1356,6 @@ log_group_file_header_flush(
if (log_do_write) {
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
srv_stats.os_log_pending_writes.inc();
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->space_id, 0,
@@ -1483,8 +1480,6 @@ loop:
if (log_do_write) {
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
srv_stats.os_log_pending_writes.inc();
ut_a(next_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
@@ -1632,7 +1627,6 @@ loop:
}
#endif /* UNIV_DEBUG */
log_sys->n_pending_writes++;
- MONITOR_INC(MONITOR_PENDING_LOG_WRITE);
group = UT_LIST_GET_FIRST(log_sys->log_groups);
group->n_pending_writes++; /*!< We assume here that we have only
@@ -1724,7 +1718,6 @@ loop:
group->n_pending_writes--;
log_sys->n_pending_writes--;
- MONITOR_DEC(MONITOR_PENDING_LOG_WRITE);
unlock = log_group_check_flush_completion(group);
unlock = unlock | log_sys_check_flush_completion();
@@ -1939,7 +1932,6 @@ log_io_complete_checkpoint(void)
ut_ad(log_sys->n_pending_checkpoint_writes > 0);
log_sys->n_pending_checkpoint_writes--;
- MONITOR_DEC(MONITOR_PENDING_CHECKPOINT_WRITE);
if (log_sys->n_pending_checkpoint_writes == 0) {
log_complete_checkpoint();
@@ -2086,12 +2078,9 @@ log_group_checkpoint(
}
log_sys->n_pending_checkpoint_writes++;
- MONITOR_INC(MONITOR_PENDING_CHECKPOINT_WRITE);
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
/* We send as the last parameter the group machine address
added with 1, as we want to distinguish between a normal log
file write and a checkpoint field write */
@@ -2178,8 +2167,6 @@ log_group_read_checkpoint_info(
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
fil_io(OS_FILE_READ | OS_FILE_LOG, true, group->space_id, 0,
field / UNIV_PAGE_SIZE, field % UNIV_PAGE_SIZE,
OS_FILE_LOG_BLOCK_SIZE, log_sys->checkpoint_buf, NULL, 0);
@@ -2564,8 +2551,6 @@ loop:
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
ut_a(source_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
if (release_mutex) {
@@ -2727,8 +2712,6 @@ log_group_archive_file_header_write(
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->archive_space_id,
0,
dest_offset / UNIV_PAGE_SIZE,
@@ -2763,8 +2746,6 @@ log_group_archive_completed_header_write(
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->archive_space_id,
0,
dest_offset / UNIV_PAGE_SIZE,
@@ -2895,8 +2876,6 @@ loop:
log_sys->n_log_ios++;
- MONITOR_INC(MONITOR_LOG_IO);
-
//TODO (jonaso): This must be dead code??
log_encrypt_before_write(log_sys->next_checkpoint_no,
buf, start_lsn, len);
diff --git a/storage/xtradb/srv/srv0mon.cc b/storage/xtradb/srv/srv0mon.cc
index 47abae66192..d95a243dd3c 100644
--- a/storage/xtradb/srv/srv0mon.cc
+++ b/storage/xtradb/srv/srv0mon.cc
@@ -873,15 +873,18 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_DEFAULT_START, MONITOR_OVLD_MAX_AGE_SYNC},
{"log_pending_log_writes", "recovery", "Pending log writes",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_PENDING_LOG_WRITE},
{"log_pending_checkpoint_writes", "recovery", "Pending checkpoints",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_PENDING_CHECKPOINT_WRITE},
{"log_num_log_io", "recovery", "Number of log I/Os",
- MONITOR_NONE,
+ static_cast<monitor_type_t>(
+ MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_LOG_IO},
{"log_waits", "recovery",
@@ -1970,6 +1973,25 @@ srv_mon_process_existing_counter(
value = (mon_type_t) log_sys->lsn;
break;
+ case MONITOR_PENDING_LOG_WRITE:
+ mutex_enter(&log_sys->mutex);
+ value = static_cast<mon_type_t>(log_sys->n_pending_writes);
+ mutex_exit(&log_sys->mutex);
+ break;
+
+ case MONITOR_PENDING_CHECKPOINT_WRITE:
+ mutex_enter(&log_sys->mutex);
+ value = static_cast<mon_type_t>(
+ log_sys->n_pending_checkpoint_writes);
+ mutex_exit(&log_sys->mutex);
+ break;
+
+ case MONITOR_LOG_IO:
+ mutex_enter(&log_sys->mutex);
+ value = static_cast<mon_type_t>(log_sys->n_log_ios);
+ mutex_exit(&log_sys->mutex);
+ break;
+
case MONITOR_OVLD_BUF_OLDEST_LSN:
value = (mon_type_t) buf_pool_get_oldest_modification();
break;