summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-07-26 13:52:52 +0300
committerEugene Kosov <claprix@yandex.ru>2019-07-26 13:52:52 +0300
commit29df1003d9faf09b635eedf10a0e3196e71bb297 (patch)
tree51941131c887271b451e8d652016719fb8a47a2f /storage/innobase/srv
parent7db999322c004477df348003d7a00c143078143a (diff)
downloadmariadb-git-29df1003d9faf09b635eedf10a0e3196e71bb297.tar.gz
MDEV-20184 data race at global counter btr_cur_n_non_sea
Make all accesses to btr_cur_n_non_sea atomic.
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0mon.cc2
-rw-r--r--storage/innobase/srv/srv0srv.cc8
2 files changed, 5 insertions, 5 deletions
diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc
index da2db975c9c..b56ffe99624 100644
--- a/storage/innobase/srv/srv0mon.cc
+++ b/storage/innobase/srv/srv0mon.cc
@@ -2052,7 +2052,7 @@ srv_mon_process_existing_counter(
#endif /* BTR_CUR_HASH_ADAPT */
case MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREE:
- value = btr_cur_n_non_sea;
+ value = my_atomic_loadlint(&btr_cur_n_non_sea);
break;
case MONITOR_OVLD_PAGE_COMPRESS_SAVED:
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index d1e7735886b..ce2240d3256 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -1150,7 +1150,7 @@ srv_refresh_innodb_monitor_stats(void)
#ifdef BTR_CUR_HASH_ADAPT
btr_cur_n_sea_old = btr_cur_n_sea;
#endif /* BTR_CUR_HASH_ADAPT */
- btr_cur_n_non_sea_old = btr_cur_n_non_sea;
+ btr_cur_n_non_sea_old = my_atomic_loadlint(&btr_cur_n_non_sea);
log_refresh_stats();
@@ -1309,16 +1309,16 @@ srv_printf_innodb_monitor(
"%.2f hash searches/s, %.2f non-hash searches/s\n",
(btr_cur_n_sea - btr_cur_n_sea_old)
/ time_elapsed,
- (btr_cur_n_non_sea - btr_cur_n_non_sea_old)
+ (my_atomic_loadlint(&btr_cur_n_non_sea) - btr_cur_n_non_sea_old)
/ time_elapsed);
btr_cur_n_sea_old = btr_cur_n_sea;
#else /* BTR_CUR_HASH_ADAPT */
fprintf(file,
"%.2f non-hash searches/s\n",
- (btr_cur_n_non_sea - btr_cur_n_non_sea_old)
+ (my_atomic_loadlint(&btr_cur_n_non_sea) - btr_cur_n_non_sea_old)
/ time_elapsed);
#endif /* BTR_CUR_HASH_ADAPT */
- btr_cur_n_non_sea_old = btr_cur_n_non_sea;
+ btr_cur_n_non_sea_old = my_atomic_loadlint(&btr_cur_n_non_sea);
fputs("---\n"
"LOG\n"