summaryrefslogtreecommitdiff
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
parent54d0a55adf6fbfc92c5473bbcad2b459f14ef038 (diff)
parent0573744a83ad89958c4e48a9299cd9274db1b355 (diff)
downloadmariadb-git-633946fb63f6957b49554ce6f6d33862951d810e.tar.gz
Merge branch '10.1' into 10.2
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result6
-rw-r--r--sql/sql_base.cc9
-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
-rw-r--r--support-files/rpm/server-postin.sh3
7 files changed, 61 insertions, 40 deletions
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index 5bac43badb3..6ce63a5744b 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -204,9 +204,9 @@ log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL
log_lsn_buf_pool_oldest recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled 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 disabled value Maximum LSN difference; when exceeded, start asynchronous preflush
log_max_modified_age_sync recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Maximum LSN difference; when exceeded, start synchronous preflush
-log_pending_log_flushes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Pending log flushes
-log_pending_checkpoint_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Pending checkpoints
-log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of log I/Os
+log_pending_log_flushes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Pending log flushes
+log_pending_checkpoint_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Pending checkpoints
+log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Number of log I/Os
log_waits recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled 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 disabled 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 disabled status_counter Number of log writes (innodb_log_writes)
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index dc4c390a719..cb817e83fd7 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3779,10 +3779,10 @@ lock_table_names(THD *thd, const DDL_options_st &options,
mdl_requests.push_front(&global_request);
if (create_table)
- #ifdef WITH_WSREP
- if (thd->lex->sql_command != SQLCOM_CREATE_TABLE &&
- thd->wsrep_exec_mode != REPL_RECV)
- #endif
+#ifdef WITH_WSREP
+ if (!(thd->lex->sql_command == SQLCOM_CREATE_TABLE &&
+ thd->wsrep_exec_mode == REPL_RECV))
+#endif
lock_wait_timeout= 0; // Don't wait for timeout
}
@@ -3793,6 +3793,7 @@ lock_table_names(THD *thd, const DDL_options_st &options,
bool res= thd->mdl_context.acquire_locks(&mdl_requests, lock_wait_timeout);
if (create_table)
thd->pop_internal_handler();
+
if (!res)
DBUG_RETURN(FALSE); // Got locks
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;
diff --git a/support-files/rpm/server-postin.sh b/support-files/rpm/server-postin.sh
index 57db9fd5d90..0a5bac73f0b 100644
--- a/support-files/rpm/server-postin.sh
+++ b/support-files/rpm/server-postin.sh
@@ -53,6 +53,9 @@ if [ $1 = 1 ] ; then
chown -R %{mysqld_user}:%{mysqld_group} $datadir
if [ ! -e $datadir/mysql ]; then
+ # Create data directory
+ mkdir -p $datadir
+
# Initiate databases
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
fi