diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-05-17 08:37:59 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-05-17 08:37:59 +0300 |
commit | a6cff02a2fc0d963c82c4a0e17b78be77562863a (patch) | |
tree | 4cd8cc20eb2b019e7dac5031fa073247cd7ea774 /storage | |
parent | cdbd04dde5895b9014616903922796eff8409f50 (diff) | |
download | mariadb-git-a6cff02a2fc0d963c82c4a0e17b78be77562863a.tar.gz |
MDEV-25687: Remove trx_active_transactions
MONITOR_TRX_ACTIVE: Remove. The count is not being updated consistently,
and it would also include read-only transactions that are otherwise
fully invisible to any other threads.
If it later turns out that a reliable count of active transactions
is needed, it can be exposed via a different interface.
trx_commit_for_mysql(): If the transaction was not started, return
immediately.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/include/srv0mon.h | 3 | ||||
-rw-r--r-- | storage/innobase/srv/srv0mon.cc | 5 | ||||
-rw-r--r-- | storage/innobase/trx/trx0roll.cc | 2 | ||||
-rw-r--r-- | storage/innobase/trx/trx0trx.cc | 9 | ||||
-rw-r--r-- | storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result | 1 |
5 files changed, 2 insertions, 18 deletions
diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index 569898cdd78..3faf4f7b7b0 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -2,7 +2,7 @@ Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2020, MariaDB Corporation. +Copyright (c) 2013, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -285,7 +285,6 @@ enum monitor_id_t { MONITOR_TRX_COMMIT_UNDO, MONITOR_TRX_ROLLBACK, MONITOR_TRX_ROLLBACK_SAVEPOINT, - MONITOR_TRX_ACTIVE, MONITOR_RSEG_HISTORY_LEN, MONITOR_NUM_UNDO_SLOT_USED, MONITOR_NUM_UNDO_SLOT_CACHED, diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index b10c07a192f..3a0338a0f71 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -723,11 +723,6 @@ static monitor_info_t innodb_counter_info[] = MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_TRX_ROLLBACK_SAVEPOINT}, - {"trx_active_transactions", "transaction", - "Number of active transactions", - MONITOR_NONE, - MONITOR_DEFAULT_START, MONITOR_TRX_ACTIVE}, - {"trx_rseg_history_len", "transaction", "Length of the TRX_RSEG_HISTORY list", static_cast<monitor_type_t>( diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index 2576ac340e3..0204502e8f5 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -141,8 +141,6 @@ inline void trx_t::rollback_low(trx_savept_t *savept) } mem_heap_free(heap); - - MONITOR_DEC(MONITOR_TRX_ACTIVE); } /** Initiate rollback. diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index f68ae049b0e..dd0b9cbfed8 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -993,8 +993,6 @@ trx_start_low( : microsecond_interval_timer(); ut_a(trx->error_state == DB_SUCCESS); - - MONITOR_INC(MONITOR_TRX_ACTIVE); } /** Set the serialisation number for a persistent committed transaction. @@ -1612,17 +1610,12 @@ trx_commit_for_mysql( switch (trx->state) { case TRX_STATE_NOT_STARTED: - ut_d(trx->start_file = __FILE__); - ut_d(trx->start_line = __LINE__); - - trx_start_low(trx, true); - /* fall through */ + return DB_SUCCESS; case TRX_STATE_ACTIVE: case TRX_STATE_PREPARED: case TRX_STATE_PREPARED_RECOVERED: trx->op_info = "committing"; trx->commit(); - MONITOR_DEC(MONITOR_TRX_ACTIVE); trx->op_info = ""; return(DB_SUCCESS); case TRX_STATE_COMMITTED_IN_MEMORY: diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result index ad0e7b31af7..5afb59327a9 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result @@ -149,7 +149,6 @@ trx_nl_ro_commits transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL N trx_commits_insert_update transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions committed with inserts and updates trx_rollbacks transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back trx_rollbacks_savepoint transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back to savepoint -trx_active_transactions transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of active transactions trx_rseg_history_len transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Length of the TRX_RSEG_HISTORY list trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots used trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots cached |