Skip to content

Commit 078fc08

Browse files
author
Bin Su
committed
BUG#27211287 - MYSQL SCALABILITY IMPROVEMENT PATCH: OPTIMIZED AWAY EXCESSIVE CONDITION
trx_set_rw_mode() currently has an invalid checking for trx->read_only which has been already checked by the caller. And from customer's testing, this can give scalability improvement in OLTP index updates benchmark. RB: 19234 Reviewed-by: Sunny Bains <[email protected]>
1 parent e0bf863 commit 078fc08

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

storage/innobase/trx/trx0trx.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3201,6 +3201,7 @@ trx_set_rw_mode(
32013201
ut_ad(trx->rsegs.m_redo.rseg == 0);
32023202
ut_ad(!trx->in_rw_trx_list);
32033203
ut_ad(!trx_is_autocommit_non_locking(trx));
3204+
ut_ad(!trx->read_only);
32043205

32053206
if (srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO) {
32063207
return;
@@ -3240,11 +3241,9 @@ trx_set_rw_mode(
32403241
}
32413242
#endif /* UNIV_DEBUG */
32423243

3243-
if (!trx->read_only) {
3244-
UT_LIST_ADD_FIRST(trx_sys->rw_trx_list, trx);
3244+
UT_LIST_ADD_FIRST(trx_sys->rw_trx_list, trx);
32453245

3246-
ut_d(trx->in_rw_trx_list = true);
3247-
}
3246+
ut_d(trx->in_rw_trx_list = true);
32483247

32493248
mutex_exit(&trx_sys->mutex);
32503249
}

0 commit comments

Comments
 (0)