summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/conn/conn_capacity.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2019-02-15 13:22:17 +1100
committerLuke Chen <luke.chen@mongodb.com>2019-02-15 13:22:17 +1100
commit534703070f379fff56efd1a600d18395816ed703 (patch)
treeb2ee282ded53aa0ca020549a9bbf132fec53234b /src/third_party/wiredtiger/src/conn/conn_capacity.c
parent9d402c82594ad179d2b177027aec462422a4b4fa (diff)
downloadmongo-534703070f379fff56efd1a600d18395816ed703.tar.gz
Import wiredtiger: 94c514c558b60a2e00d4926c7535d062fce5a901 from branch mongodb-4.2
ref: 0c6ba8d8be..94c514c558 for: 4.1.9 WT-4577 Fix LSM deadlock detected by test/format WT-4583 Collect read/write stats in throttling even if not using capacity
Diffstat (limited to 'src/third_party/wiredtiger/src/conn/conn_capacity.c')
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_capacity.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/src/conn/conn_capacity.c b/src/third_party/wiredtiger/src/conn/conn_capacity.c
index 0dd6a8c3c6d..3a6f02a5d02 100644
--- a/src/third_party/wiredtiger/src/conn/conn_capacity.c
+++ b/src/third_party/wiredtiger/src/conn/conn_capacity.c
@@ -306,10 +306,6 @@ __wt_capacity_throttle(WT_SESSION_IMPL *session, uint64_t bytes,
conn = S2C(session);
cap = &conn->capacity;
- /* If not using capacity there's nothing to do. */
- if (cap->total == 0)
- return;
-
capacity = steal_capacity = 0;
reservation = steal = NULL;
switch (type) {
@@ -317,16 +313,19 @@ __wt_capacity_throttle(WT_SESSION_IMPL *session, uint64_t bytes,
capacity = cap->ckpt;
reservation = &cap->reservation_ckpt;
WT_STAT_CONN_INCRV(session, capacity_bytes_ckpt, bytes);
+ WT_STAT_CONN_INCRV(session, capacity_bytes_written, bytes);
break;
case WT_THROTTLE_EVICT:
capacity = cap->evict;
reservation = &cap->reservation_evict;
WT_STAT_CONN_INCRV(session, capacity_bytes_evict, bytes);
+ WT_STAT_CONN_INCRV(session, capacity_bytes_written, bytes);
break;
case WT_THROTTLE_LOG:
capacity = cap->log;
reservation = &cap->reservation_log;
WT_STAT_CONN_INCRV(session, capacity_bytes_log, bytes);
+ WT_STAT_CONN_INCRV(session, capacity_bytes_written, bytes);
break;
case WT_THROTTLE_READ:
capacity = cap->read;
@@ -342,7 +341,8 @@ __wt_capacity_throttle(WT_SESSION_IMPL *session, uint64_t bytes,
* at some point in the future. If this subsystem is not throttled
* there's nothing to do.
*/
- if (capacity == 0 || F_ISSET(conn, WT_CONN_RECOVERING))
+ if (cap->total == 0 || capacity == 0 ||
+ F_ISSET(conn, WT_CONN_RECOVERING))
return;
/*
@@ -352,7 +352,6 @@ __wt_capacity_throttle(WT_SESSION_IMPL *session, uint64_t bytes,
*/
if (type != WT_THROTTLE_READ) {
(void)__wt_atomic_addv64(&cap->written, bytes);
- WT_STAT_CONN_INCRV(session, capacity_bytes_written, bytes);
__capacity_signal(session);
}