summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-01-30 21:58:23 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-01-30 22:17:01 +0200
commit7e0481086c39421d165126c45060315b9bc70b11 (patch)
treebdc618f35e1db0dfc7bef9c541bc428591f152f5
parente76d106101c836639c95fa57dd9bc8df3e38e58e (diff)
downloadmariadb-git-bb-10.3-armed.tar.gz
MDEV-15132 Avoid accessing the TRX_SYS pagebb-10.3-armed
trx_write_serialisation_history(): Only invoke trx_sysf_get() to exclusively lock the TRX_SYS page if some change really has to be written to the page. On transaction commit, we will still write some binlog and Galera WSREP XID information. FIXME: If this information has to be written, it should be partitioned into the rollback segment pages.
-rw-r--r--storage/innobase/trx/trx0trx.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 6dfefec8e21..26b857a75f3 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1336,20 +1336,28 @@ trx_write_serialisation_history(
MONITOR_INC(MONITOR_TRX_COMMIT_UNDO);
+#ifdef WITH_WSREP
+ const bool update_wsrep = wsrep_is_wsrep_xid(trx->xid);
+#endif
+ const bool update_binlog_pos = trx->mysql_log_file_name
+ && *trx->mysql_log_file_name;
+ if (!update_binlog_pos
+#ifdef WITH_WSREP
+ && !update_wsrep
+#endif
+ ) return true;
+
buf_block_t* block = trx_sysf_get(mtr);
#ifdef WITH_WSREP
- /* Update latest MySQL wsrep XID in trx sys header. */
- if (wsrep_is_wsrep_xid(trx->xid)) {
+ if (update_wsrep)
trx_sys_update_wsrep_checkpoint(trx->xid, block, mtr);
- }
#endif /* WITH_WSREP */
/* Update the latest MySQL binlog name and offset info
in trx sys header if MySQL binlogging is on or the database
server is a MySQL replication slave */
- if (trx->mysql_log_file_name != NULL
- && trx->mysql_log_file_name[0] != '\0') {
+ if (update_binlog_pos) {
trx_sys_update_mysql_binlog_offset(
trx->mysql_log_file_name,