Commit e01d7884 authored by Sergey Vojtovich's avatar Sergey Vojtovich

Optimized away excessive condition

trx_set_rw_mode() is never called for read-only transactions, this is guarded
by callers.

Removing this condition from critical section immediately gives 5% scalability
improvement in OLTP index updates benchmark.
parent 7cb3520c
...@@ -3039,6 +3039,7 @@ trx_set_rw_mode( ...@@ -3039,6 +3039,7 @@ trx_set_rw_mode(
ut_ad(trx->rsegs.m_redo.rseg == 0); ut_ad(trx->rsegs.m_redo.rseg == 0);
ut_ad(!trx->in_rw_trx_list); ut_ad(!trx->in_rw_trx_list);
ut_ad(!trx_is_autocommit_non_locking(trx)); ut_ad(!trx_is_autocommit_non_locking(trx));
ut_ad(!trx->read_only);
if (high_level_read_only) { if (high_level_read_only) {
return; return;
...@@ -3075,11 +3076,9 @@ trx_set_rw_mode( ...@@ -3075,11 +3076,9 @@ trx_set_rw_mode(
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
if (!trx->read_only) { UT_LIST_ADD_FIRST(trx_sys->rw_trx_list, trx);
UT_LIST_ADD_FIRST(trx_sys->rw_trx_list, trx);
ut_d(trx->in_rw_trx_list = true); ut_d(trx->in_rw_trx_list = true);
}
mutex_exit(&trx_sys->mutex); mutex_exit(&trx_sys->mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment