diff options
Diffstat (limited to 'src')
66 files changed, 770 insertions, 701 deletions
diff --git a/src/async/async_api.c b/src/async/async_api.c index 0a855514a07..bac4dc01bae 100644 --- a/src/async/async_api.c +++ b/src/async/async_api.c @@ -113,7 +113,7 @@ __async_new_op_alloc(WT_SESSION_IMPL *session, const char *uri, conn = S2C(session); async = conn->async; - WT_STAT_FAST_CONN_INCR(session, async_op_alloc); + WT_STAT_CONN_INCR(session, async_op_alloc); *opp = NULL; retry: @@ -143,7 +143,7 @@ retry: * We still haven't found one. Return an error. */ if (op == NULL || op->state != WT_ASYNCOP_FREE) { - WT_STAT_FAST_CONN_INCR(session, async_full); + WT_STAT_CONN_INCR(session, async_full); WT_RET(EBUSY); } /* @@ -152,10 +152,10 @@ retry: * Start the next search at the next entry after this one. */ if (!__wt_atomic_cas32(&op->state, WT_ASYNCOP_FREE, WT_ASYNCOP_READY)) { - WT_STAT_FAST_CONN_INCR(session, async_alloc_race); + WT_STAT_CONN_INCR(session, async_alloc_race); goto retry; } - WT_STAT_FAST_CONN_INCRV(session, async_alloc_view, view); + WT_STAT_CONN_INCRV(session, async_alloc_view, view); WT_RET(__async_get_format(conn, uri, config, op)); op->unique_id = __wt_atomic_add64(&async->op_id, 1); op->optype = WT_AOP_NONE; @@ -507,7 +507,7 @@ __wt_async_flush(WT_SESSION_IMPL *session) if (workers == 0) return (0); - WT_STAT_FAST_CONN_INCR(session, async_flush); + WT_STAT_CONN_INCR(session, async_flush); /* * We have to do several things. First we have to prevent * other callers from racing with us so that only one diff --git a/src/async/async_op.c b/src/async/async_op.c index 2bdc9e4ec8e..8c074e503d9 100644 --- a/src/async/async_op.c +++ b/src/async/async_op.c @@ -104,7 +104,7 @@ __async_search(WT_ASYNC_OP *asyncop) op = (WT_ASYNC_OP_IMPL *)asyncop; ASYNCOP_API_CALL(O2C(op), session, search); - WT_STAT_FAST_CONN_INCR(O2S(op), async_op_search); + WT_STAT_CONN_INCR(O2S(op), async_op_search); WT_ERR(__async_op_wrap(op, WT_AOP_SEARCH)); err: API_END_RET(session, ret); } @@ -122,7 +122,7 @@ __async_insert(WT_ASYNC_OP *asyncop) op = (WT_ASYNC_OP_IMPL *)asyncop; ASYNCOP_API_CALL(O2C(op), session, insert); - WT_STAT_FAST_CONN_INCR(O2S(op), async_op_insert); + WT_STAT_CONN_INCR(O2S(op), async_op_insert); WT_ERR(__async_op_wrap(op, WT_AOP_INSERT)); err: API_END_RET(session, ret); } @@ -140,7 +140,7 @@ __async_update(WT_ASYNC_OP *asyncop) op = (WT_ASYNC_OP_IMPL *)asyncop; ASYNCOP_API_CALL(O2C(op), session, update); - WT_STAT_FAST_CONN_INCR(O2S(op), async_op_update); + WT_STAT_CONN_INCR(O2S(op), async_op_update); WT_ERR(__async_op_wrap(op, WT_AOP_UPDATE)); err: API_END_RET(session, ret); } @@ -158,7 +158,7 @@ __async_remove(WT_ASYNC_OP *asyncop) op = (WT_ASYNC_OP_IMPL *)asyncop; ASYNCOP_API_CALL(O2C(op), session, remove); - WT_STAT_FAST_CONN_INCR(O2S(op), async_op_remove); + WT_STAT_CONN_INCR(O2S(op), async_op_remove); WT_ERR(__async_op_wrap(op, WT_AOP_REMOVE)); err: API_END_RET(session, ret); } @@ -176,7 +176,7 @@ __async_compact(WT_ASYNC_OP *asyncop) op = (WT_ASYNC_OP_IMPL *)asyncop; ASYNCOP_API_CALL(O2C(op), session, compact); - WT_STAT_FAST_CONN_INCR(O2S(op), async_op_compact); + WT_STAT_CONN_INCR(O2S(op), async_op_compact); WT_ERR(__async_op_wrap(op, WT_AOP_COMPACT)); err: API_END_RET(session, ret); } diff --git a/src/async/async_worker.c b/src/async/async_worker.c index cf83d797738..401d0616eab 100644 --- a/src/async/async_worker.c +++ b/src/async/async_worker.c @@ -37,7 +37,7 @@ retry: */ while (last_consume == async->head && async->flush_state != WT_ASYNC_FLUSHING) { - WT_STAT_FAST_CONN_INCR(session, async_nowork); + WT_STAT_CONN_INCR(session, async_nowork); if (++tries < MAX_ASYNC_YIELD) /* * Initially when we find no work, allow other diff --git a/src/block/block_ext.c b/src/block/block_ext.c index 8a4d2b08bef..b02fea8707d 100644 --- a/src/block/block_ext.c +++ b/src/block/block_ext.c @@ -485,7 +485,7 @@ __block_extend( *offp = block->size; block->size += size; - WT_STAT_FAST_DATA_INCR(session, block_extension); + WT_STAT_DATA_INCR(session, block_extension); __wt_verbose(session, WT_VERB_BLOCK, "file extend %" PRIdMAX "B @ %" PRIdMAX, (intmax_t)size, (intmax_t)*offp); @@ -507,7 +507,7 @@ __wt_block_alloc( /* Assert we're maintaining the by-size skiplist. */ WT_ASSERT(session, block->live.avail.track_size != 0); - WT_STAT_FAST_DATA_INCR(session, block_alloc); + WT_STAT_DATA_INCR(session, block_alloc); if (size % block->allocsize != 0) WT_RET_MSG(session, EINVAL, "cannot allocate a block size %" PRIdMAX " that is not " @@ -590,7 +590,7 @@ __wt_block_free(WT_SESSION_IMPL *session, uint32_t checksum, size; WT_UNUSED(addr_size); - WT_STAT_FAST_DATA_INCR(session, block_free); + WT_STAT_DATA_INCR(session, block_free); /* Crack the cookie. */ WT_RET( diff --git a/src/block/block_open.c b/src/block/block_open.c index e369d013437..4d15942709a 100644 --- a/src/block/block_open.c +++ b/src/block/block_open.c @@ -382,21 +382,19 @@ err: __wt_scr_free(session, &buf); void __wt_block_stat(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_DSRC_STATS *stats) { - WT_UNUSED(session); - /* * Reading from the live system's structure normally requires locking, * but it's an 8B statistics read, there's no need. */ - WT_STAT_WRITE(stats, allocation_size, block->allocsize); - WT_STAT_WRITE( + WT_STAT_WRITE(session, stats, allocation_size, block->allocsize); + WT_STAT_WRITE(session, stats, block_checkpoint_size, (int64_t)block->live.ckpt_size); - WT_STAT_WRITE(stats, block_magic, WT_BLOCK_MAGIC); - WT_STAT_WRITE(stats, block_major, WT_BLOCK_MAJOR_VERSION); - WT_STAT_WRITE(stats, block_minor, WT_BLOCK_MINOR_VERSION); - WT_STAT_WRITE( + WT_STAT_WRITE(session, stats, block_magic, WT_BLOCK_MAGIC); + WT_STAT_WRITE(session, stats, block_major, WT_BLOCK_MAJOR_VERSION); + WT_STAT_WRITE(session, stats, block_minor, WT_BLOCK_MINOR_VERSION); + WT_STAT_WRITE(session, stats, block_reuse_bytes, (int64_t)block->live.avail.bytes); - WT_STAT_WRITE(stats, block_size, block->size); + WT_STAT_WRITE(session, stats, block_size, block->size); } /* diff --git a/src/block/block_read.c b/src/block/block_read.c index c6005b1f60a..1eeabd63d92 100644 --- a/src/block/block_read.c +++ b/src/block/block_read.c @@ -28,7 +28,7 @@ __wt_bm_preload( block = bm->block; - WT_STAT_FAST_CONN_INCR(session, block_preload); + WT_STAT_CONN_INCR(session, block_preload); /* Crack the cookie. */ WT_RET( @@ -86,8 +86,8 @@ __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, ret = handle->fh_map_preload(handle, (WT_SESSION *)session, buf->data, buf->size,bm->mapped_cookie); - WT_STAT_FAST_CONN_INCR(session, block_map_read); - WT_STAT_FAST_CONN_INCRV(session, block_byte_map_read, size); + WT_STAT_CONN_INCR(session, block_map_read); + WT_STAT_CONN_INCRV(session, block_byte_map_read, size); return (ret); } @@ -164,8 +164,8 @@ __wt_block_read_off(WT_SESSION_IMPL *session, WT_BLOCK *block, "off %" PRIuMAX ", size %" PRIu32 ", checksum %" PRIu32, (uintmax_t)offset, size, checksum); - WT_STAT_FAST_CONN_INCR(session, block_read); - WT_STAT_FAST_CONN_INCRV(session, block_byte_read, size); + WT_STAT_CONN_INCR(session, block_read); + WT_STAT_CONN_INCRV(session, block_byte_read, size); /* * Grow the buffer as necessary and read the block. Buffers should be diff --git a/src/block/block_vrfy.c b/src/block/block_vrfy.c index 58b62247044..94824ad19f8 100644 --- a/src/block/block_vrfy.c +++ b/src/block/block_vrfy.c @@ -352,7 +352,7 @@ __wt_block_verify_addr(WT_SESSION_IMPL *session, WT_RET( __wt_block_buffer_to_addr(block, addr, &offset, &size, &checksum)); - /* Add to the per-file list. */ + /* Add to the per-file list. */ WT_RET( __verify_filefrag_add(session, block, NULL, offset, size, false)); diff --git a/src/block/block_write.c b/src/block/block_write.c index 032f72d551b..d08aba45920 100644 --- a/src/block/block_write.c +++ b/src/block/block_write.c @@ -236,6 +236,10 @@ __block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, uint32_t checksum; bool local_locked; + *offsetp = 0; /* -Werror=maybe-uninitialized */ + *sizep = 0; /* -Werror=maybe-uninitialized */ + *checksump = 0; /* -Werror=maybe-uninitialized */ + fh = block->fh; /* @@ -363,10 +367,10 @@ __block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, /* Optionally discard blocks from the buffer cache. */ WT_RET(__wt_block_discard(session, block, align_size)); - WT_STAT_FAST_CONN_INCR(session, block_write); - WT_STAT_FAST_CONN_INCRV(session, block_byte_write, align_size); + WT_STAT_CONN_INCR(session, block_write); + WT_STAT_CONN_INCRV(session, block_byte_write, align_size); if (checkpoint_io) - WT_STAT_FAST_CONN_INCRV( + WT_STAT_CONN_INCRV( session, block_byte_write_checkpoint, align_size); __wt_verbose(session, WT_VERB_WRITE, diff --git a/src/btree/bt_compact.c b/src/btree/bt_compact.c index bb1261d94b0..7ba45f29b76 100644 --- a/src/btree/bt_compact.c +++ b/src/btree/bt_compact.c @@ -104,7 +104,7 @@ __wt_compact(WT_SESSION_IMPL *session, const char *cfg[]) bm = btree->bm; ref = NULL; - WT_STAT_FAST_DATA_INCR(session, session_compact); + WT_STAT_DATA_INCR(session, session_compact); /* * Check if compaction might be useful -- the API layer will quit trying @@ -151,7 +151,7 @@ __wt_compact(WT_SESSION_IMPL *session, const char *cfg[]) WT_ERR(__wt_page_modify_init(session, ref->page)); __wt_page_modify_set(session, ref->page); - WT_STAT_FAST_DATA_INCR(session, btree_compact_rewrite); + WT_STAT_DATA_INCR(session, btree_compact_rewrite); } err: if (ref != NULL) diff --git a/src/btree/bt_curnext.c b/src/btree/bt_curnext.c index c6955dd9ed6..4d3976f9647 100644 --- a/src/btree/bt_curnext.c +++ b/src/btree/bt_curnext.c @@ -587,8 +587,8 @@ __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating) session = (WT_SESSION_IMPL *)cbt->iface.session; - WT_STAT_FAST_CONN_INCR(session, cursor_next); - WT_STAT_FAST_DATA_INCR(session, cursor_next); + WT_STAT_CONN_INCR(session, cursor_next); + WT_STAT_DATA_INCR(session, cursor_next); flags = WT_READ_SKIP_INTL; /* Tree walk flags. */ if (truncating) diff --git a/src/btree/bt_curprev.c b/src/btree/bt_curprev.c index 79fd067ac7b..2dd443ffac1 100644 --- a/src/btree/bt_curprev.c +++ b/src/btree/bt_curprev.c @@ -543,8 +543,8 @@ __wt_btcur_prev(WT_CURSOR_BTREE *cbt, bool truncating) session = (WT_SESSION_IMPL *)cbt->iface.session; - WT_STAT_FAST_CONN_INCR(session, cursor_prev); - WT_STAT_FAST_DATA_INCR(session, cursor_prev); + WT_STAT_CONN_INCR(session, cursor_prev); + WT_STAT_DATA_INCR(session, cursor_prev); flags = WT_READ_PREV | WT_READ_SKIP_INTL; /* Tree walk flags. */ if (truncating) diff --git a/src/btree/bt_cursor.c b/src/btree/bt_cursor.c index 982226f589f..3690b41ead4 100644 --- a/src/btree/bt_cursor.c +++ b/src/btree/bt_cursor.c @@ -235,7 +235,7 @@ __cursor_col_search( { WT_DECL_RET; - WT_WITH_PAGE_INDEX(session, + WT_WITH_PAGE_INDEX(session, ret = __wt_col_search(session, cbt->iface.recno, leaf, cbt)); return (ret); } @@ -250,7 +250,7 @@ __cursor_row_search( { WT_DECL_RET; - WT_WITH_PAGE_INDEX(session, + WT_WITH_PAGE_INDEX(session, ret = __wt_row_search(session, &cbt->iface.key, leaf, cbt, insert)); return (ret); } @@ -290,8 +290,8 @@ __wt_btcur_reset(WT_CURSOR_BTREE *cbt) session = (WT_SESSION_IMPL *)cbt->iface.session; - WT_STAT_FAST_CONN_INCR(session, cursor_reset); - WT_STAT_FAST_DATA_INCR(session, cursor_reset); + WT_STAT_CONN_INCR(session, cursor_reset); + WT_STAT_DATA_INCR(session, cursor_reset); return (__cursor_reset(cbt)); } @@ -315,8 +315,8 @@ __wt_btcur_search(WT_CURSOR_BTREE *cbt) session = (WT_SESSION_IMPL *)cursor->session; upd = NULL; /* -Wuninitialized */ - WT_STAT_FAST_CONN_INCR(session, cursor_search); - WT_STAT_FAST_DATA_INCR(session, cursor_search); + WT_STAT_CONN_INCR(session, cursor_search); + WT_STAT_DATA_INCR(session, cursor_search); /* * If we have a page pinned, search it; if we don't have a page pinned, @@ -387,8 +387,8 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp) upd = NULL; /* -Wuninitialized */ exact = 0; - WT_STAT_FAST_CONN_INCR(session, cursor_search_near); - WT_STAT_FAST_DATA_INCR(session, cursor_search_near); + WT_STAT_CONN_INCR(session, cursor_search_near); + WT_STAT_DATA_INCR(session, cursor_search_near); /* * If we have a row-store page pinned, search it; if we don't have a @@ -499,9 +499,9 @@ __wt_btcur_insert(WT_CURSOR_BTREE *cbt) cursor = &cbt->iface; session = (WT_SESSION_IMPL *)cursor->session; - WT_STAT_FAST_CONN_INCR(session, cursor_insert); - WT_STAT_FAST_DATA_INCR(session, cursor_insert); - WT_STAT_FAST_DATA_INCRV(session, + WT_STAT_CONN_INCR(session, cursor_insert); + WT_STAT_DATA_INCR(session, cursor_insert); + WT_STAT_DATA_INCRV(session, cursor_insert_bytes, cursor->key.size + cursor->value.size); if (btree->type == BTREE_ROW) @@ -562,8 +562,8 @@ retry: WT_RET(__cursor_func_init(cbt, true)); } err: if (ret == WT_RESTART) { - WT_STAT_FAST_CONN_INCR(session, cursor_restart); - WT_STAT_FAST_DATA_INCR(session, cursor_restart); + WT_STAT_CONN_INCR(session, cursor_restart); + WT_STAT_DATA_INCR(session, cursor_restart); goto retry; } /* Insert doesn't maintain a position across calls, clear resources. */ @@ -644,8 +644,8 @@ retry: WT_RET(__cursor_func_init(cbt, true)); } err: if (ret == WT_RESTART) { - WT_STAT_FAST_CONN_INCR(session, cursor_restart); - WT_STAT_FAST_DATA_INCR(session, cursor_restart); + WT_STAT_CONN_INCR(session, cursor_restart); + WT_STAT_DATA_INCR(session, cursor_restart); goto retry; } WT_TRET(__curfile_leave(cbt)); @@ -670,9 +670,9 @@ __wt_btcur_remove(WT_CURSOR_BTREE *cbt) cursor = &cbt->iface; session = (WT_SESSION_IMPL *)cursor->session; - WT_STAT_FAST_CONN_INCR(session, cursor_remove); - WT_STAT_FAST_DATA_INCR(session, cursor_remove); - WT_STAT_FAST_DATA_INCRV(session, cursor_remove_bytes, cursor->key.size); + WT_STAT_CONN_INCR(session, cursor_remove); + WT_STAT_DATA_INCR(session, cursor_remove); + WT_STAT_DATA_INCRV(session, cursor_remove_bytes, cursor->key.size); retry: WT_RET(__cursor_func_init(cbt, true)); @@ -721,8 +721,8 @@ retry: WT_RET(__cursor_func_init(cbt, true)); } err: if (ret == WT_RESTART) { - WT_STAT_FAST_CONN_INCR(session, cursor_restart); - WT_STAT_FAST_DATA_INCR(session, cursor_restart); + WT_STAT_CONN_INCR(session, cursor_restart); + WT_STAT_DATA_INCR(session, cursor_restart); goto retry; } /* @@ -754,10 +754,9 @@ __wt_btcur_update(WT_CURSOR_BTREE *cbt) cursor = &cbt->iface; session = (WT_SESSION_IMPL *)cursor->session; - WT_STAT_FAST_CONN_INCR(session, cursor_update); - WT_STAT_FAST_DATA_INCR(session, cursor_update); - WT_STAT_FAST_DATA_INCRV( - session, cursor_update_bytes, cursor->value.size); + WT_STAT_CONN_INCR(session, cursor_update); + WT_STAT_DATA_INCR(session, cursor_update); + WT_STAT_DATA_INCRV(session, cursor_update_bytes, cursor->value.size); if (btree->type == BTREE_ROW) WT_RET(__cursor_size_chk(session, &cursor->key)); @@ -811,8 +810,8 @@ retry: WT_RET(__cursor_func_init(cbt, true)); } err: if (ret == WT_RESTART) { - WT_STAT_FAST_CONN_INCR(session, cursor_restart); - WT_STAT_FAST_DATA_INCR(session, cursor_restart); + WT_STAT_CONN_INCR(session, cursor_restart); + WT_STAT_DATA_INCR(session, cursor_restart); goto retry; } @@ -861,8 +860,8 @@ __wt_btcur_next_random(WT_CURSOR_BTREE *cbt) if (btree->type != BTREE_ROW) WT_RET(ENOTSUP); - WT_STAT_FAST_CONN_INCR(session, cursor_next); - WT_STAT_FAST_DATA_INCR(session, cursor_next); + WT_STAT_CONN_INCR(session, cursor_next); + WT_STAT_DATA_INCR(session, cursor_next); /* * If retrieving random values without sampling, or we don't have a @@ -1093,8 +1092,8 @@ retry: WT_RET(__wt_btcur_remove(start)); } if (ret == WT_RESTART) { - WT_STAT_FAST_CONN_INCR(session, cursor_restart); - WT_STAT_FAST_DATA_INCR(session, cursor_restart); + WT_STAT_CONN_INCR(session, cursor_restart); + WT_STAT_DATA_INCR(session, cursor_restart); goto retry; } @@ -1148,8 +1147,8 @@ retry: WT_RET(__wt_btcur_remove(start)); } if (ret == WT_RESTART) { - WT_STAT_FAST_CONN_INCR(session, cursor_restart); - WT_STAT_FAST_DATA_INCR(session, cursor_restart); + WT_STAT_CONN_INCR(session, cursor_restart); + WT_STAT_DATA_INCR(session, cursor_restart); goto retry; } @@ -1170,7 +1169,7 @@ __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop) session = (WT_SESSION_IMPL *)start->iface.session; btree = start->btree; - WT_STAT_FAST_DATA_INCR(session, cursor_truncate); + WT_STAT_DATA_INCR(session, cursor_truncate); /* * For recovery, log the start and stop keys for a truncate operation, diff --git a/src/btree/bt_delete.c b/src/btree/bt_delete.c index 54b7fedb31d..00e41475de9 100644 --- a/src/btree/bt_delete.c +++ b/src/btree/bt_delete.c @@ -131,8 +131,8 @@ __wt_delete_page(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) WT_ERR(__wt_txn_modify_ref(session, ref)); *skipp = true; - WT_STAT_FAST_CONN_INCR(session, rec_page_delete_fast); - WT_STAT_FAST_DATA_INCR(session, rec_page_delete_fast); + WT_STAT_CONN_INCR(session, rec_page_delete_fast); + WT_STAT_DATA_INCR(session, rec_page_delete_fast); WT_PUBLISH(ref->state, WT_REF_DELETED); return (0); diff --git a/src/btree/bt_io.c b/src/btree/bt_io.c index 8053417f838..42c3a849a88 100644 --- a/src/btree/bt_io.c +++ b/src/btree/bt_io.c @@ -139,12 +139,12 @@ __wt_bt_read(WT_SESSION_IMPL *session, WT_ERR(__wt_verify_dsk(session, tmp->data, buf)); } - WT_STAT_FAST_CONN_INCR(session, cache_read); - WT_STAT_FAST_DATA_INCR(session, cache_read); + WT_STAT_CONN_INCR(session, cache_read); + WT_STAT_DATA_INCR(session, cache_read); if (F_ISSET(dsk, WT_PAGE_COMPRESSED)) - WT_STAT_FAST_DATA_INCR(session, compress_read); - WT_STAT_FAST_CONN_INCRV(session, cache_bytes_read, dsk->mem_size); - WT_STAT_FAST_DATA_INCRV(session, cache_bytes_read, dsk->mem_size); + WT_STAT_DATA_INCR(session, compress_read); + WT_STAT_CONN_INCRV(session, cache_bytes_read, dsk->mem_size); + WT_STAT_DATA_INCRV(session, cache_bytes_read, dsk->mem_size); if (0) { corrupt: if (ret == 0) @@ -234,7 +234,7 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf, ip = buf; else if (buf->size <= btree->allocsize) { ip = buf; - WT_STAT_FAST_DATA_INCR(session, compress_write_too_small); + WT_STAT_DATA_INCR(session, compress_write_too_small); } else { /* Skip the header bytes of the source data. */ src = (uint8_t *)buf->mem + WT_BLOCK_COMPRESS_SKIP; @@ -283,10 +283,10 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf, buf->size / btree->allocsize <= result_len / btree->allocsize) { ip = buf; - WT_STAT_FAST_DATA_INCR(session, compress_write_fail); + WT_STAT_DATA_INCR(session, compress_write_fail); } else { compressed = true; - WT_STAT_FAST_DATA_INCR(session, compress_write); + WT_STAT_DATA_INCR(session, compress_write); /* * Copy in the skipped header bytes, set the final data @@ -363,11 +363,11 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf, bm->write( bm, session, ip, addr, addr_sizep, data_checksum, checkpoint_io)); - WT_STAT_FAST_CONN_INCR(session, cache_write); - WT_STAT_FAST_DATA_INCR(session, cache_write); + WT_STAT_CONN_INCR(session, cache_write); + WT_STAT_DATA_INCR(session, cache_write); S2C(session)->cache->bytes_written += dsk->mem_size; - WT_STAT_FAST_CONN_INCRV(session, cache_bytes_write, dsk->mem_size); - WT_STAT_FAST_DATA_INCRV(session, cache_bytes_write, dsk->mem_size); + WT_STAT_CONN_INCRV(session, cache_bytes_write, dsk->mem_size); + WT_STAT_DATA_INCRV(session, cache_bytes_write, dsk->mem_size); err: __wt_scr_free(session, &ctmp); __wt_scr_free(session, &etmp); diff --git a/src/btree/bt_ovfl.c b/src/btree/bt_ovfl.c index feb78df75e2..29ea561db3a 100644 --- a/src/btree/bt_ovfl.c +++ b/src/btree/bt_ovfl.c @@ -33,8 +33,8 @@ __ovfl_read(WT_SESSION_IMPL *session, store->data = WT_PAGE_HEADER_BYTE(btree, dsk); store->size = dsk->u.datalen; - WT_STAT_FAST_CONN_INCR(session, cache_read_overflow); - WT_STAT_FAST_DATA_INCR(session, cache_read_overflow); + WT_STAT_CONN_INCR(session, cache_read_overflow); + WT_STAT_DATA_INCR(session, cache_read_overflow); return (0); } @@ -209,8 +209,8 @@ __wt_ovfl_cache(WT_SESSION_IMPL *session, */ if (!visible) { WT_RET(__ovfl_cache(session, page, vpack)); - WT_STAT_FAST_CONN_INCR(session, cache_overflow_value); - WT_STAT_FAST_DATA_INCR(session, cache_overflow_value); + WT_STAT_CONN_INCR(session, cache_overflow_value); + WT_STAT_DATA_INCR(session, cache_overflow_value); } /* diff --git a/src/btree/bt_read.c b/src/btree/bt_read.c index a23ab0f091f..c54eaa69c43 100644 --- a/src/btree/bt_read.c +++ b/src/btree/bt_read.c @@ -431,8 +431,8 @@ __page_read(WT_SESSION_IMPL *session, WT_REF *ref) */ dsk = tmp.data; if (F_ISSET(dsk, WT_PAGE_LAS_UPDATE) && __wt_las_is_written(session)) { - WT_STAT_FAST_CONN_INCR(session, cache_read_lookaside); - WT_STAT_FAST_DATA_INCR(session, cache_read_lookaside); + WT_STAT_CONN_INCR(session, cache_read_lookaside); + WT_STAT_DATA_INCR(session, cache_read_lookaside); WT_ERR(__las_page_instantiate( session, ref, btree->id, addr, addr_size)); @@ -481,8 +481,8 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags * eviction server can dominate these statistics. */ if (!LF_ISSET(WT_READ_CACHE)) { - WT_STAT_FAST_CONN_INCR(session, cache_pages_requested); - WT_STAT_FAST_DATA_INCR(session, cache_pages_requested); + WT_STAT_CONN_INCR(session, cache_pages_requested); + WT_STAT_DATA_INCR(session, cache_pages_requested); } for (evict_soon = stalled = false, @@ -525,7 +525,7 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags return (WT_NOTFOUND); /* Waiting on another thread's read, stall. */ - WT_STAT_FAST_CONN_INCR(session, page_read_blocked); + WT_STAT_CONN_INCR(session, page_read_blocked); stalled = true; break; case WT_REF_LOCKED: @@ -533,7 +533,7 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags return (WT_NOTFOUND); /* Waiting on eviction, stall. */ - WT_STAT_FAST_CONN_INCR(session, page_locked_blocked); + WT_STAT_CONN_INCR(session, page_locked_blocked); stalled = true; break; case WT_REF_SPLIT: @@ -560,8 +560,7 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags WT_RET(__wt_hazard_set(session, ref, &busy)); #endif if (busy) { - WT_STAT_FAST_CONN_INCR( - session, page_busy_blocked); + WT_STAT_CONN_INCR(session, page_busy_blocked); break; } @@ -590,7 +589,7 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags /* If forced eviction fails, stall. */ if (ret == EBUSY) { ret = 0; - WT_STAT_FAST_CONN_INCR(session, + WT_STAT_CONN_INCR(session, page_forcible_evict_blocked); stalled = true; break; @@ -661,7 +660,7 @@ skip_evict: continue; } sleep_cnt = WT_MIN(sleep_cnt + WT_THOUSAND, 10000); - WT_STAT_FAST_CONN_INCRV(session, page_sleep, sleep_cnt); + WT_STAT_CONN_INCRV(session, page_sleep, sleep_cnt); __wt_sleep(0, sleep_cnt); } } diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c index e05f3746052..ea667460966 100644 --- a/src/btree/bt_split.c +++ b/src/btree/bt_split.c @@ -542,10 +542,10 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root) uint32_t slots; void *p; - WT_STAT_FAST_CONN_INCR(session, cache_eviction_deepen); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_deepen); - WT_STAT_FAST_CONN_INCR(session, cache_eviction_split_internal); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_split_internal); + WT_STAT_CONN_INCR(session, cache_eviction_deepen); + WT_STAT_DATA_INCR(session, cache_eviction_deepen); + WT_STAT_CONN_INCR(session, cache_eviction_split_internal); + WT_STAT_DATA_INCR(session, cache_eviction_split_internal); btree = S2BT(session); alloc_index = NULL; @@ -1028,8 +1028,8 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page) uint32_t slots; void *p; - WT_STAT_FAST_CONN_INCR(session, cache_eviction_split_internal); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_split_internal); + WT_STAT_CONN_INCR(session, cache_eviction_split_internal); + WT_STAT_DATA_INCR(session, cache_eviction_split_internal); /* The page will be marked dirty, make sure that will succeed. */ WT_RET(__wt_page_modify_init(session, page)); @@ -1742,8 +1742,8 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref) uint8_t type; int i; - WT_STAT_FAST_CONN_INCR(session, cache_inmem_split); - WT_STAT_FAST_DATA_INCR(session, cache_inmem_split); + WT_STAT_CONN_INCR(session, cache_inmem_split); + WT_STAT_DATA_INCR(session, cache_inmem_split); page = ref->page; right = NULL; @@ -2110,8 +2110,8 @@ __split_multi(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) size_t parent_incr; uint32_t i, new_entries; - WT_STAT_FAST_CONN_INCR(session, cache_eviction_split_leaf); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_split_leaf); + WT_STAT_CONN_INCR(session, cache_eviction_split_leaf); + WT_STAT_DATA_INCR(session, cache_eviction_split_leaf); page = ref->page; mod = page->modify; diff --git a/src/btree/col_srch.c b/src/btree/col_srch.c index 6c96181d3bf..64ee9e94f4c 100644 --- a/src/btree/col_srch.c +++ b/src/btree/col_srch.c @@ -210,7 +210,7 @@ leaf_only: page = current->page; cbt->ref = current; - /* + /* * Don't bother searching if the caller is appending a new record where * we'll allocate the record number; we're not going to find a match by * definition, and we figure out the record number and position when we diff --git a/src/checksum/arm64/crc32-arm64.c b/src/checksum/arm64/crc32-arm64.c index 5d6c5f69c58..38b4f623044 100644 --- a/src/checksum/arm64/crc32-arm64.c +++ b/src/checksum/arm64/crc32-arm64.c @@ -32,14 +32,18 @@ #include <asm/hwcap.h> #include <sys/auxv.h> +#ifndef __GNUC__ +#define __asm__ asm +#endif + #define CRC32CX(crc,value) \ - asm("crc32cx %w[c], %w[c], %x[v]" : [c]"+r"(*&crc) : [v]"r"(+value)) + __asm__("crc32cx %w[c], %w[c], %x[v]" : [c]"+r"(*&crc) : [v]"r"(+value)) #define CRC32CW(crc,value) \ - asm("crc32cw %w[c], %w[c], %w[v]" : [c]"+r"(*&crc) : [v]"r"(+value)) + __asm__("crc32cw %w[c], %w[c], %w[v]" : [c]"+r"(*&crc) : [v]"r"(+value)) #define CRC32CH(crc,value) \ - asm("crc32ch %w[c], %w[c], %w[v]" : [c]"+r"(*&crc) : [v]"r"(+value)) + __asm__("crc32ch %w[c], %w[c], %w[v]" : [c]"+r"(*&crc) : [v]"r"(+value)) #define CRC32CB(crc,value) \ - asm("crc32cb %w[c], %w[c], %w[v]" : [c]"+r"(*&crc) : [v]"r"(+value)) + __asm__("crc32cb %w[c], %w[c], %w[v]" : [c]"+r"(*&crc) : [v]"r"(+value)) /* * __wt_checksum_hw -- diff --git a/src/config/config_api.c b/src/config/config_api.c index 8655057e94d..8820b81a410 100644 --- a/src/config/config_api.c +++ b/src/config/config_api.c @@ -113,7 +113,7 @@ wiredtiger_config_validate(WT_SESSION *wt_session, session = (WT_SESSION_IMPL *)wt_session; - /* + /* * It's a logic error to specify both a session and an event handler. */ if (session != NULL && handler != NULL) diff --git a/src/config/config_def.c b/src/config/config_def.c index f231d7fc5d9..7bad5f12a9f 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -1005,7 +1005,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { "async=(enabled=false,ops_max=1024,threads=2),cache_overhead=8," "cache_size=100MB,checkpoint=(log_size=0,wait=0),error_prefix=," "eviction=(threads_max=1,threads_min=1)," - "eviction_checkpoint_target=15,eviction_dirty_target=5," + "eviction_checkpoint_target=5,eviction_dirty_target=5," "eviction_dirty_trigger=20,eviction_target=80,eviction_trigger=95" ",file_manager=(close_handle_minimum=250,close_idle_time=30," "close_scan_interval=10),log=(archive=true,prealloc=true," @@ -1207,7 +1207,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { "wait=0),checkpoint_sync=true,config_base=true,create=false," "direct_io=,encryption=(keyid=,name=,secretkey=),error_prefix=," "eviction=(threads_max=1,threads_min=1)," - "eviction_checkpoint_target=15,eviction_dirty_target=5," + "eviction_checkpoint_target=5,eviction_dirty_target=5," "eviction_dirty_trigger=20,eviction_target=80,eviction_trigger=95" ",exclusive=false,extensions=,file_extend=," "file_manager=(close_handle_minimum=250,close_idle_time=30," @@ -1230,7 +1230,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { "wait=0),checkpoint_sync=true,config_base=true,create=false," "direct_io=,encryption=(keyid=,name=,secretkey=),error_prefix=," "eviction=(threads_max=1,threads_min=1)," - "eviction_checkpoint_target=15,eviction_dirty_target=5," + "eviction_checkpoint_target=5,eviction_dirty_target=5," "eviction_dirty_trigger=20,eviction_target=80,eviction_trigger=95" ",exclusive=false,extensions=,file_extend=," "file_manager=(close_handle_minimum=250,close_idle_time=30," @@ -1252,7 +1252,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { ",cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0," "wait=0),checkpoint_sync=true,direct_io=,encryption=(keyid=,name=" ",secretkey=),error_prefix=,eviction=(threads_max=1," - "threads_min=1),eviction_checkpoint_target=15," + "threads_min=1),eviction_checkpoint_target=5," "eviction_dirty_target=5,eviction_dirty_trigger=20," "eviction_target=80,eviction_trigger=95,extensions=,file_extend=," "file_manager=(close_handle_minimum=250,close_idle_time=30," @@ -1273,7 +1273,7 @@ static const WT_CONFIG_ENTRY config_entries[] = { ",cache_overhead=8,cache_size=100MB,checkpoint=(log_size=0," "wait=0),checkpoint_sync=true,direct_io=,encryption=(keyid=,name=" ",secretkey=),error_prefix=,eviction=(threads_max=1," - "threads_min=1),eviction_checkpoint_target=15," + "threads_min=1),eviction_checkpoint_target=5," "eviction_dirty_target=5,eviction_dirty_trigger=20," "eviction_target=80,eviction_trigger=95,extensions=,file_extend=," "file_manager=(close_handle_minimum=250,close_idle_time=30," @@ -1323,7 +1323,7 @@ __wt_conn_config_discard(WT_SESSION_IMPL *session) __wt_free(session, conn->config_entries); } -/* +/* * __wt_conn_config_match -- * Return the static configuration entry for a method. */ diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c index 61683f3394e..faec72a4ac0 100644 --- a/src/conn/conn_api.c +++ b/src/conn/conn_api.c @@ -1657,7 +1657,7 @@ __conn_statistics_config(WT_SESSION_IMPL *session, const char *cfg[]) set = 0; if ((ret = __wt_config_subgets( session, &cval, "none", &sval)) == 0 && sval.val != 0) { - LF_SET(WT_CONN_STAT_NONE); + flags = 0; ++set; } WT_RET_NOTFOUND_OK(ret); @@ -1677,8 +1677,13 @@ __conn_statistics_config(WT_SESSION_IMPL *session, const char *cfg[]) WT_RET_NOTFOUND_OK(ret); if ((ret = __wt_config_subgets( - session, &cval, "clear", &sval)) == 0 && sval.val != 0) + session, &cval, "clear", &sval)) == 0 && sval.val != 0) { + if (!LF_ISSET(WT_CONN_STAT_FAST | WT_CONN_STAT_ALL)) + WT_RET_MSG(session, EINVAL, + "the value \"clear\" can be specified only if " + "either \"all\" or \"fast\" is specified"); LF_SET(WT_CONN_STAT_CLEAR); + } WT_RET_NOTFOUND_OK(ret); if (set > 1) diff --git a/src/conn/conn_cache.c b/src/conn/conn_cache.c index 7e94e9e87dc..6788b1f7f47 100644 --- a/src/conn/conn_cache.c +++ b/src/conn/conn_cache.c @@ -56,6 +56,13 @@ __cache_config_local(WT_SESSION_IMPL *session, bool shared, const char *cfg[]) cache->eviction_dirty_target = (u_int)cval.val; /* + * Don't allow the dirty target to be larger than the overall + * target. + */ + if (cache->eviction_dirty_target > cache->eviction_target) + cache->eviction_dirty_target = cache->eviction_target; + + /* * Sanity check the checkpoint target: don't allow a value * lower than the dirty target. */ @@ -68,6 +75,13 @@ __cache_config_local(WT_SESSION_IMPL *session, bool shared, const char *cfg[]) WT_RET(__wt_config_gets( session, cfg, "eviction_dirty_trigger", &cval)); cache->eviction_dirty_trigger = (u_int)cval.val; + + /* + * Don't allow the dirty trigger to be larger than the overall + * trigger or we can get stuck with a cache full of dirty data. + */ + if (cache->eviction_dirty_trigger > cache->eviction_trigger) + cache->eviction_dirty_trigger = cache->eviction_trigger; } WT_RET(__wt_config_gets(session, cfg, "eviction.threads_max", &cval)); diff --git a/src/conn/conn_log.c b/src/conn/conn_log.c index a8f0fe4810b..2786526c2fa 100644 --- a/src/conn/conn_log.c +++ b/src/conn/conn_log.c @@ -137,7 +137,7 @@ __logmgr_config( if (!reconfig) { WT_RET(__wt_config_gets(session, cfg, "log.file_max", &cval)); conn->log_file_max = (wt_off_t)cval.val; - WT_STAT_FAST_CONN_SET(session, + WT_STAT_CONN_SET(session, log_max_filesize, conn->log_file_max); } @@ -299,14 +299,14 @@ __log_prealloc_once(WT_SESSION_IMPL *session) "Missed %" PRIu32 ". Now pre-allocating up to %" PRIu32, log->prep_missed, conn->log_prealloc); } - WT_STAT_FAST_CONN_SET(session, log_prealloc_max, conn->log_prealloc); + WT_STAT_CONN_SET(session, log_prealloc_max, conn->log_prealloc); /* * Allocate up to the maximum number that we just computed and detected. */ for (i = reccount; i < (u_int)conn->log_prealloc; i++) { WT_ERR(__wt_log_allocfile( session, ++log->prep_fileid, WT_LOG_PREPNAME)); - WT_STAT_FAST_CONN_INCR(session, log_prealloc_files); + WT_STAT_CONN_INCR(session, log_prealloc_files); } /* * Reset the missed count now. If we missed during pre-allocating @@ -632,8 +632,7 @@ restart: coalescing->slot_last_offset = slot->slot_last_offset; coalescing->slot_end_lsn = slot->slot_end_lsn; - WT_STAT_FAST_CONN_INCR( - session, log_slot_coalesced); + WT_STAT_CONN_INCR(session, log_slot_coalesced); /* * Copy the flag for later closing. */ @@ -674,7 +673,7 @@ restart: log->write_start_lsn = slot->slot_start_lsn; log->write_lsn = slot->slot_end_lsn; __wt_cond_signal(session, log->log_write_cond); - WT_STAT_FAST_CONN_INCR(session, log_write_lsn); + WT_STAT_CONN_INCR(session, log_write_lsn); /* * Signal the close thread if needed. */ @@ -720,7 +719,7 @@ __log_wrlsn_server(void *arg) __wt_log_cmp(&log->write_lsn, &log->alloc_lsn) != 0) __wt_log_wrlsn(session, &yield); else - WT_STAT_FAST_CONN_INCR(session, log_write_lsn_skip); + WT_STAT_CONN_INCR(session, log_write_lsn_skip); prev = log->alloc_lsn; did_work = yield == 0; @@ -926,7 +925,7 @@ __wt_logmgr_open(WT_SESSION_IMPL *session) conn = S2C(session); - /* If no log thread services are configured, we're done. */ + /* If no log thread services are configured, we're done. */ if (!FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED)) return (0); diff --git a/src/conn/conn_stat.c b/src/conn/conn_stat.c index 530bbfcd2db..66979dfd023 100644 --- a/src/conn/conn_stat.c +++ b/src/conn/conn_stat.c @@ -530,7 +530,7 @@ __statlog_server(void *arg) /* Wait until the next event. */ __wt_cond_wait(session, conn->stat_cond, conn->stat_usecs); - if (!FLD_ISSET(conn->stat_flags, WT_CONN_STAT_NONE)) + if (WT_STAT_ENABLED(session)) WT_ERR(__statlog_log_one(session, &path, &tmp)); } diff --git a/src/conn/conn_sweep.c b/src/conn/conn_sweep.c index 25057d73564..03593f8951a 100644 --- a/src/conn/conn_sweep.c +++ b/src/conn/conn_sweep.c @@ -48,7 +48,7 @@ __sweep_mark(WT_SESSION_IMPL *session, time_t now) continue; dhandle->timeofdeath = now; - WT_STAT_FAST_CONN_INCR(session, dh_sweep_tod); + WT_STAT_CONN_INCR(session, dh_sweep_tod); } } @@ -167,10 +167,10 @@ __sweep_discard_trees(WT_SESSION_IMPL *session, u_int *dead_handlesp) /* We closed the btree handle. */ if (ret == 0) { - WT_STAT_FAST_CONN_INCR(session, dh_sweep_close); + WT_STAT_CONN_INCR(session, dh_sweep_close); ++*dead_handlesp; } else - WT_STAT_FAST_CONN_INCR(session, dh_sweep_ref); + WT_STAT_CONN_INCR(session, dh_sweep_ref); WT_RET_BUSY_OK(ret); } @@ -236,9 +236,9 @@ __sweep_remove_handles(WT_SESSION_IMPL *session) WT_WITH_HANDLE_LIST_LOCK(session, ret = __sweep_remove_one(session, dhandle)); if (ret == 0) - WT_STAT_FAST_CONN_INCR(session, dh_sweep_remove); + WT_STAT_CONN_INCR(session, dh_sweep_remove); else - WT_STAT_FAST_CONN_INCR(session, dh_sweep_ref); + WT_STAT_CONN_INCR(session, dh_sweep_ref); WT_RET_BUSY_OK(ret); } @@ -273,7 +273,7 @@ __sweep_server(void *arg) conn->sweep_cond, conn->sweep_interval * WT_MILLION); WT_ERR(__wt_seconds(session, &now)); - WT_STAT_FAST_CONN_INCR(session, dh_sweeps); + WT_STAT_CONN_INCR(session, dh_sweeps); /* * Sweep the lookaside table. If the lookaside table hasn't yet diff --git a/src/cursor/cur_bulk.c b/src/cursor/cur_bulk.c index d1a53057650..68611e30ff1 100644 --- a/src/cursor/cur_bulk.c +++ b/src/cursor/cur_bulk.c @@ -49,7 +49,7 @@ __curbulk_insert_fix(WT_CURSOR *cursor) * until the bulk cursor is closed. */ CURSOR_API_CALL(cursor, session, insert, btree); - WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk); + WT_STAT_DATA_INCR(session, cursor_insert_bulk); /* * If the "append" flag was configured, the application doesn't have to @@ -99,7 +99,7 @@ __curbulk_insert_fix_bitmap(WT_CURSOR *cursor) * until the bulk cursor is closed. */ CURSOR_API_CALL(cursor, session, insert, btree); - WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk); + WT_STAT_DATA_INCR(session, cursor_insert_bulk); WT_CURSOR_CHECKVALUE(cursor); @@ -131,7 +131,7 @@ __curbulk_insert_var(WT_CURSOR *cursor) * until the bulk cursor is closed. */ CURSOR_API_CALL(cursor, session, insert, btree); - WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk); + WT_STAT_DATA_INCR(session, cursor_insert_bulk); /* * If the "append" flag was configured, the application doesn't have to @@ -239,7 +239,7 @@ __curbulk_insert_row(WT_CURSOR *cursor) * until the bulk cursor is closed. */ CURSOR_API_CALL(cursor, session, insert, btree); - WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk); + WT_STAT_DATA_INCR(session, cursor_insert_bulk); WT_CURSOR_CHECKKEY(cursor); WT_CURSOR_CHECKVALUE(cursor); @@ -286,7 +286,7 @@ __curbulk_insert_row_skip_check(WT_CURSOR *cursor) * until the bulk cursor is closed. */ CURSOR_API_CALL(cursor, session, insert, btree); - WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk); + WT_STAT_DATA_INCR(session, cursor_insert_bulk); WT_CURSOR_CHECKKEY(cursor); WT_CURSOR_CHECKVALUE(cursor); diff --git a/src/cursor/cur_ds.c b/src/cursor/cur_ds.c index 8d4b7a9384b..458e0f1b1f0 100644 --- a/src/cursor/cur_ds.c +++ b/src/cursor/cur_ds.c @@ -184,12 +184,12 @@ __curds_next(WT_CURSOR *cursor) CURSOR_API_CALL(cursor, session, next, NULL); - WT_STAT_FAST_CONN_INCR(session, cursor_next); - WT_STAT_FAST_DATA_INCR(session, cursor_next); + WT_STAT_CONN_INCR(session, cursor_next); + WT_STAT_DATA_INCR(session, cursor_next); WT_ERR(__curds_txn_enter(session)); - F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET); + F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET); ret = __curds_cursor_resolve(cursor, source->next(source)); err: __curds_txn_leave(session); @@ -212,12 +212,12 @@ __curds_prev(WT_CURSOR *cursor) CURSOR_API_CALL(cursor, session, prev, NULL); - WT_STAT_FAST_CONN_INCR(session, cursor_prev); - WT_STAT_FAST_DATA_INCR(session, cursor_prev); + WT_STAT_CONN_INCR(session, cursor_prev); + WT_STAT_DATA_INCR(session, cursor_prev); WT_ERR(__curds_txn_enter(session)); - F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET); + F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET); ret = __curds_cursor_resolve(cursor, source->prev(source)); err: __curds_txn_leave(session); @@ -239,8 +239,8 @@ __curds_reset(WT_CURSOR *cursor) CURSOR_API_CALL(cursor, session, reset, NULL); - WT_STAT_FAST_CONN_INCR(session, cursor_reset); - WT_STAT_FAST_DATA_INCR(session, cursor_reset); + WT_STAT_CONN_INCR(session, cursor_reset); + WT_STAT_DATA_INCR(session, cursor_reset); WT_ERR(source->reset(source)); @@ -264,8 +264,8 @@ __curds_search(WT_CURSOR *cursor) CURSOR_API_CALL(cursor, session, search, NULL); - WT_STAT_FAST_CONN_INCR(session, cursor_search); - WT_STAT_FAST_DATA_INCR(session, cursor_search); + WT_STAT_CONN_INCR(session, cursor_search); + WT_STAT_DATA_INCR(session, cursor_search); WT_ERR(__curds_txn_enter(session)); @@ -292,8 +292,8 @@ __curds_search_near(WT_CURSOR *cursor, int *exact) CURSOR_API_CALL(cursor, session, search_near, NULL); - WT_STAT_FAST_CONN_INCR(session, cursor_search_near); - WT_STAT_FAST_DATA_INCR(session, cursor_search_near); + WT_STAT_CONN_INCR(session, cursor_search_near); + WT_STAT_DATA_INCR(session, cursor_search_near); WT_ERR(__curds_txn_enter(session)); @@ -323,9 +323,9 @@ __curds_insert(WT_CURSOR *cursor) WT_ERR(__curds_txn_enter(session)); - WT_STAT_FAST_CONN_INCR(session, cursor_insert); - WT_STAT_FAST_DATA_INCR(session, cursor_insert); - WT_STAT_FAST_DATA_INCRV(session, + WT_STAT_CONN_INCR(session, cursor_insert); + WT_STAT_DATA_INCR(session, cursor_insert); + WT_STAT_DATA_INCRV(session, cursor_insert_bytes, cursor->key.size + cursor->value.size); if (!F_ISSET(cursor, WT_CURSTD_APPEND)) @@ -354,10 +354,9 @@ __curds_update(WT_CURSOR *cursor) CURSOR_UPDATE_API_CALL(cursor, session, update, NULL); - WT_STAT_FAST_CONN_INCR(session, cursor_update); - WT_STAT_FAST_DATA_INCR(session, cursor_update); - WT_STAT_FAST_DATA_INCRV( - session, cursor_update_bytes, cursor->value.size); + WT_STAT_CONN_INCR(session, cursor_update); + WT_STAT_DATA_INCR(session, cursor_update); + WT_STAT_DATA_INCRV(session, cursor_update_bytes, cursor->value.size); WT_ERR(__curds_txn_enter(session)); @@ -386,9 +385,9 @@ __curds_remove(WT_CURSOR *cursor) CURSOR_REMOVE_API_CALL(cursor, session, NULL); - WT_STAT_FAST_CONN_INCR(session, cursor_remove); - WT_STAT_FAST_DATA_INCR(session, cursor_remove); - WT_STAT_FAST_DATA_INCRV(session, cursor_remove_bytes, cursor->key.size); + WT_STAT_CONN_INCR(session, cursor_remove); + WT_STAT_DATA_INCR(session, cursor_remove); + WT_STAT_DATA_INCRV(session, cursor_remove_bytes, cursor->key.size); WT_ERR(__curds_txn_enter(session)); diff --git a/src/cursor/cur_file.c b/src/cursor/cur_file.c index 8e7bd4bbea5..e304cf7b775 100644 --- a/src/cursor/cur_file.c +++ b/src/cursor/cur_file.c @@ -488,8 +488,8 @@ __curfile_create(WT_SESSION_IMPL *session, WT_ERR(__wt_cursor_init( cursor, cursor->internal_uri, owner, cfg, cursorp)); - WT_STAT_FAST_CONN_INCR(session, cursor_create); - WT_STAT_FAST_DATA_INCR(session, cursor_create); + WT_STAT_CONN_INCR(session, cursor_create); + WT_STAT_DATA_INCR(session, cursor_create); if (0) { err: WT_TRET(__curfile_close(cursor)); diff --git a/src/cursor/cur_log.c b/src/cursor/cur_log.c index 76f31b417a6..21a7f674c68 100644 --- a/src/cursor/cur_log.c +++ b/src/cursor/cur_log.c @@ -246,8 +246,8 @@ __curlog_next(WT_CURSOR *cursor) } WT_ASSERT(session, cl->logrec->data != NULL); WT_ERR(__curlog_kv(session, cursor)); - WT_STAT_FAST_CONN_INCR(session, cursor_next); - WT_STAT_FAST_DATA_INCR(session, cursor_next); + WT_STAT_CONN_INCR(session, cursor_next); + WT_STAT_DATA_INCR(session, cursor_next); err: API_END_RET(session, ret); @@ -282,8 +282,8 @@ __curlog_search(WT_CURSOR *cursor) ret = WT_NOTFOUND; WT_ERR(ret); WT_ERR(__curlog_kv(session, cursor)); - WT_STAT_FAST_CONN_INCR(session, cursor_search); - WT_STAT_FAST_DATA_INCR(session, cursor_search); + WT_STAT_CONN_INCR(session, cursor_search); + WT_STAT_DATA_INCR(session, cursor_search); err: API_END_RET(session, ret); } diff --git a/src/cursor/cur_stat.c b/src/cursor/cur_stat.c index 5c9159a4c0b..700cc366ff0 100644 --- a/src/cursor/cur_stat.c +++ b/src/cursor/cur_stat.c @@ -599,7 +599,7 @@ __wt_curstat_open(WT_SESSION_IMPL *session, * Statistics cursor configuration: must match (and defaults to), the * database configuration. */ - if (FLD_ISSET(conn->stat_flags, WT_CONN_STAT_NONE)) + if (!WT_STAT_ENABLED(session)) goto config_err; if ((ret = __wt_config_gets(session, cfg, "statistics", &cval)) == 0) { if ((ret = __wt_config_subgets( diff --git a/src/cursor/cur_std.c b/src/cursor/cur_std.c index bf7280f796b..6264de89df9 100644 --- a/src/cursor/cur_std.c +++ b/src/cursor/cur_std.c @@ -547,7 +547,7 @@ __wt_cursor_close(WT_CURSOR *cursor) TAILQ_REMOVE(&session->cursors, cursor, q); (void)__wt_atomic_sub32(&S2C(session)->open_cursor_count, 1); - WT_STAT_FAST_DATA_DECR(session, session_cursor_open); + WT_STAT_DATA_DECR(session, session_cursor_open); } __wt_buf_free(session, &cursor->key); @@ -763,7 +763,7 @@ __wt_cursor_init(WT_CURSOR *cursor, F_SET(cursor, WT_CURSTD_OPEN); (void)__wt_atomic_add32(&S2C(session)->open_cursor_count, 1); - WT_STAT_FAST_DATA_INCR(session, session_cursor_open); + WT_STAT_DATA_INCR(session, session_cursor_open); *cursorp = (cdump != NULL) ? cdump : cursor; return (0); diff --git a/src/cursor/cur_table.c b/src/cursor/cur_table.c index 0498c89fcbe..1b93b27f564 100644 --- a/src/cursor/cur_table.c +++ b/src/cursor/cur_table.c @@ -646,7 +646,7 @@ __wt_table_range_truncate(WT_CURSOR_TABLE *start, WT_CURSOR_TABLE *stop) /* Open any indices. */ WT_RET(__curtable_open_indices(ctable)); WT_RET(__wt_scr_alloc(session, 128, &key)); - WT_STAT_FAST_DATA_INCR(session, cursor_truncate); + WT_STAT_DATA_INCR(session, cursor_truncate); /* * Step through the cursor range, removing the index entries. diff --git a/src/docs/upgrading.dox b/src/docs/upgrading.dox index 3a448818230..caa6b036892 100644 --- a/src/docs/upgrading.dox +++ b/src/docs/upgrading.dox @@ -566,7 +566,7 @@ statistics will be logged to the file; if the database is configured with "all" or "fast", the corresponding statistics will be logged to the file. -In previous releases, the WT_SESSION::cursor method took +In previous releases, the WT_SESSION::cursor method took \c statistics_clear and a \c statistics_fast configurations. The \c statistics_clear configuration defaulted to false; when set to true, statistics counters were reset after they were gathered by the cursor. diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c index 69fff96fef5..35c057c9767 100644 --- a/src/evict/evict_lru.c +++ b/src/evict/evict_lru.c @@ -17,24 +17,24 @@ static int __evict_pass(WT_SESSION_IMPL *); static int __evict_server(WT_SESSION_IMPL *, bool *); static int __evict_walk(WT_SESSION_IMPL *, WT_EVICT_QUEUE *); static int __evict_walk_file( - WT_SESSION_IMPL *, WT_EVICT_QUEUE *, u_int, u_int *, bool *); + WT_SESSION_IMPL *, WT_EVICT_QUEUE *, u_int, u_int *); #define WT_EVICT_HAS_WORKERS(s) \ (S2C(s)->evict_threads.current_threads > 1) /* - * __evict_read_gen -- + * __evict_entry_priority -- * Get the adjusted read generation for an eviction entry. */ static inline uint64_t -__evict_read_gen(const WT_EVICT_ENTRY *entry) +__evict_entry_priority(WT_SESSION_IMPL *session, WT_REF *ref) { WT_BTREE *btree; WT_PAGE *page; uint64_t read_gen; - btree = entry->btree; - page = entry->ref->page; + btree = S2BT(session); + page = ref->page; /* Any page set to the oldest generation should be discarded. */ if (page->read_gen == WT_READGEN_OLDEST) @@ -60,7 +60,14 @@ __evict_read_gen(const WT_EVICT_ENTRY *entry) * The base read-generation is skewed by the eviction priority. * Internal pages are also adjusted, we prefer to evict leaf pages. */ - read_gen = page->read_gen + btree->evict_priority; + if (page->modify != NULL && + F_ISSET(S2C(session)->cache, WT_CACHE_EVICT_DIRTY) && + !F_ISSET(S2C(session)->cache, WT_CACHE_EVICT_CLEAN)) + read_gen = page->modify->update_txn; + else + read_gen = page->read_gen; + + read_gen += btree->evict_priority; if (WT_PAGE_IS_INTERNAL(page)) read_gen += WT_EVICT_INT_SKEW; @@ -327,8 +334,6 @@ __evict_server(WT_SESSION_IMPL *session, bool *did_work) __wt_spin_unlock(session, &conn->dhandle_lock); WT_RET(ret); - /* Next time we wake up, reverse the sweep direction. */ - cache->flags ^= WT_CACHE_WALK_REVERSE; cache->pages_evicted = 0; } else if (cache->pages_evicted != cache->pages_evict) { cache->pages_evicted = cache->pages_evict; @@ -371,7 +376,7 @@ __wt_evict_create(WT_SESSION_IMPL *session) conn->evict_threads_max, WT_THREAD_CAN_WAIT | WT_THREAD_PANIC_FAIL, __wt_evict_thread_run)); - /* + /* * Allow queues to be populated now that the eviction threads * are running. */ @@ -463,6 +468,14 @@ __evict_update_work(WT_SESSION_IMPL *session) F_SET(cache, WT_CACHE_EVICT_DIRTY_HARD); /* + * If application threads are blocked by the total volume of data in + * cache, try dirty pages as well. + */ + if (__wt_cache_aggressive(session) && + F_ISSET(cache, WT_CACHE_EVICT_CLEAN_HARD)) + F_SET(cache, WT_CACHE_EVICT_DIRTY); + + /* * Scrub dirty pages and keep them in cache if we are less than half * way to the clean or dirty trigger. */ @@ -472,7 +485,19 @@ __evict_update_work(WT_SESSION_IMPL *session) bytes_max) / 200) F_SET(cache, WT_CACHE_EVICT_SCRUB); - WT_STAT_FAST_CONN_SET(session, cache_eviction_state, + /* + * With an in-memory cache, we only do dirty eviction in order to scrub + * pages. + */ + if (F_ISSET(conn, WT_CONN_IN_MEMORY)) { + if (F_ISSET(cache, WT_CACHE_EVICT_CLEAN)) + F_SET(cache, WT_CACHE_EVICT_DIRTY); + if (F_ISSET(cache, WT_CACHE_EVICT_CLEAN_HARD)) + F_SET(cache, WT_CACHE_EVICT_DIRTY_HARD); + F_CLR(cache, WT_CACHE_EVICT_CLEAN | WT_CACHE_EVICT_CLEAN_HARD); + } + + WT_STAT_CONN_SET(session, cache_eviction_state, F_MASK(cache, WT_CACHE_EVICT_MASK)); return (F_ISSET(cache, WT_CACHE_EVICT_ALL | WT_CACHE_EVICT_URGENT)); @@ -589,7 +614,7 @@ __evict_pass(WT_SESSION_IMPL *session) txn_global->current != oldest_id && cache->evict_aggressive_score < 100) ++cache->evict_aggressive_score; - WT_STAT_FAST_CONN_SET(session, + WT_STAT_CONN_SET(session, cache_eviction_aggressive_set, cache->evict_aggressive_score); prev = now; @@ -611,21 +636,21 @@ __evict_pass(WT_SESSION_IMPL *session) * checkpoint completes): make sure we wait for * a non-zero number of microseconds). */ - WT_STAT_FAST_CONN_INCR(session, + WT_STAT_CONN_INCR(session, cache_eviction_server_slept); __wt_cond_wait( session, cache->evict_cond, WT_THOUSAND); continue; } - WT_STAT_FAST_CONN_INCR(session, cache_eviction_slow); + WT_STAT_CONN_INCR(session, cache_eviction_slow); __wt_verbose(session, WT_VERB_EVICTSERVER, "unable to reach eviction goal"); break; } else { if (cache->evict_aggressive_score > 0) { --cache->evict_aggressive_score; - WT_STAT_FAST_CONN_SET(session, + WT_STAT_CONN_SET(session, cache_eviction_aggressive_set, cache->evict_aggressive_score); } @@ -641,7 +666,7 @@ __evict_pass(WT_SESSION_IMPL *session) * Clear a single walk point. */ static int -__evict_clear_walk(WT_SESSION_IMPL *session) +__evict_clear_walk(WT_SESSION_IMPL *session, bool count_stat) { WT_BTREE *btree; WT_CACHE *cache; @@ -658,6 +683,9 @@ __evict_clear_walk(WT_SESSION_IMPL *session) if ((ref = btree->evict_ref) == NULL) return (0); + if (count_stat) + WT_STAT_CONN_INCR(session, cache_eviction_walks_abandoned); + /* * Clear evict_ref first, in case releasing it forces eviction (we * assert we never try to evict the current eviction walk point). @@ -684,8 +712,8 @@ __evict_clear_all_walks(WT_SESSION_IMPL *session) TAILQ_FOREACH(dhandle, &conn->dhqh, q) if (WT_PREFIX_MATCH(dhandle->name, "file:")) - WT_WITH_DHANDLE(session, - dhandle, WT_TRET(__evict_clear_walk(session))); + WT_WITH_DHANDLE(session, dhandle, + WT_TRET(__evict_clear_walk(session, true))); return (ret); } @@ -730,7 +758,7 @@ __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session) /* Clear any existing LRU eviction walk for the file. */ WT_WITH_PASS_LOCK(session, ret, - ret = __evict_clear_walk(session)); + ret = __evict_clear_walk(session, true)); (void)__wt_atomic_subv32(&cache->pass_intr, 1); WT_ERR(ret); @@ -843,8 +871,11 @@ __evict_lru_walk(WT_SESSION_IMPL *session) cache = S2C(session)->cache; /* Age out the score of how much the queue has been empty recently. */ - if (cache->evict_empty_score > 0) + if (cache->evict_empty_score > 0) { --cache->evict_empty_score; + WT_STAT_CONN_SET(session, cache_eviction_empty_score, + cache->evict_empty_score); + } /* Fill the next queue (that isn't the urgent queue). */ queue = cache->evict_fill_queue; @@ -865,27 +896,25 @@ __evict_lru_walk(WT_SESSION_IMPL *session) return (0); /* Get some more pages to consider for eviction. */ - switch (ret = __evict_walk(cache->walk_session, queue)) { - case 0: - break; - case EBUSY: - return (0); - case WT_NOTFOUND: - /* - * If we found no pages at all during the walk, something is - * wrong. Be more aggressive next time. - */ + if ((ret = __evict_walk(cache->walk_session, queue)) == EBUSY) + return (0); /* An interrupt was requested, give up. */ + WT_RET_NOTFOUND_OK(ret); + + /* + * If we found no pages at all during the walk, something is wrong. + * Be more aggressive next time. + * + * Continue on to sort the queue, in case there are pages left from a + * previous walk. + */ + if (ret == WT_NOTFOUND) { if (F_ISSET(cache, WT_CACHE_EVICT_CLEAN_HARD | WT_CACHE_EVICT_DIRTY_HARD)) cache->evict_aggressive_score = WT_MIN( cache->evict_aggressive_score + WT_EVICT_SCORE_BUMP, WT_EVICT_SCORE_MAX); - WT_STAT_FAST_CONN_SET(session, - cache_eviction_aggressive_set, + WT_STAT_CONN_SET(session, cache_eviction_aggressive_set, cache->evict_aggressive_score); - return (0); - default: - return (ret); } /* @@ -894,13 +923,17 @@ __evict_lru_walk(WT_SESSION_IMPL *session) */ if (__evict_queue_empty(queue)) { if (F_ISSET(cache, - WT_CACHE_EVICT_CLEAN_HARD | WT_CACHE_EVICT_DIRTY_HARD)) + WT_CACHE_EVICT_CLEAN_HARD | WT_CACHE_EVICT_DIRTY_HARD)) { cache->evict_empty_score = WT_MIN( cache->evict_empty_score + WT_EVICT_SCORE_BUMP, WT_EVICT_SCORE_MAX); - WT_STAT_FAST_CONN_INCR(session, cache_eviction_queue_empty); + WT_STAT_CONN_SET(session, + cache_eviction_empty_score, + cache->evict_empty_score); + } + WT_STAT_CONN_INCR(session, cache_eviction_queue_empty); } else - WT_STAT_FAST_CONN_INCR(session, cache_eviction_queue_not_empty); + WT_STAT_CONN_INCR(session, cache_eviction_queue_not_empty); /* Sort the list into LRU order and restart. */ __wt_spin_lock(session, &queue->evict_lock); @@ -917,6 +950,7 @@ __evict_lru_walk(WT_SESSION_IMPL *session) qsort(queue->evict_queue, entries, sizeof(WT_EVICT_ENTRY), __evict_lru_cmp); + /* Trim empty entries from the end. */ while (entries > 0 && queue->evict_queue[entries - 1].ref == NULL) --entries; @@ -926,8 +960,7 @@ __evict_lru_walk(WT_SESSION_IMPL *session) * candidates so we never end up with more candidates than entries. */ while (entries > WT_EVICT_WALK_BASE) - __evict_list_clear(session, - &queue->evict_queue[--entries]); + __evict_list_clear(session, &queue->evict_queue[--entries]); queue->evict_entries = entries; @@ -948,14 +981,14 @@ __evict_lru_walk(WT_SESSION_IMPL *session) queue->evict_candidates = entries; else { /* - * Find the oldest read generation we have in the queue, used - * to set the initial value for pages read into the system. - * The queue is sorted, find the first "normal" generation. + * Find the oldest read generation apart that we have in the + * queue, used to set the initial value for pages read into the + * system. The queue is sorted, find the first "normal" + * generation. */ read_gen_oldest = WT_READGEN_OLDEST; for (candidates = 0; candidates < entries; ++candidates) { - read_gen_oldest = - queue->evict_queue[candidates].score; + read_gen_oldest = queue->evict_queue[candidates].score; if (read_gen_oldest != WT_READGEN_OLDEST) break; } @@ -1014,8 +1047,8 @@ __evict_walk(WT_SESSION_IMPL *session, WT_EVICT_QUEUE *queue) WT_CONNECTION_IMPL *conn; WT_DATA_HANDLE *dhandle; WT_DECL_RET; - u_int max_entries, prev_slot, retries, slot, start_slot, spins; - bool dhandle_locked, incr, progress; + u_int max_entries, retries, slot, start_slot, spins; + bool dhandle_locked, incr; conn = S2C(session); cache = S2C(session)->cache; @@ -1121,8 +1154,6 @@ retry: while (slot < max_entries) { btree->evict_walk_skips++ < btree->evict_walk_period) continue; btree->evict_walk_skips = 0; - prev_slot = slot; - progress = false; (void)__wt_atomic_addi32(&dhandle->session_inuse, 1); incr = true; @@ -1145,22 +1176,12 @@ retry: while (slot < max_entries) { cache->evict_file_next = dhandle; WT_WITH_DHANDLE(session, dhandle, ret = __evict_walk_file(session, queue, - max_entries, &slot, &progress)); + max_entries, &slot)); WT_ASSERT(session, session->split_gen == 0); } __wt_spin_unlock(session, &cache->evict_walk_lock); WT_ERR(ret); } - - /* - * If we didn't find any candidates in the file, skip it next - * time. - */ - if (slot == prev_slot && !progress) - btree->evict_walk_period = WT_MIN( - WT_MAX(1, 2 * btree->evict_walk_period), 100); - else - btree->evict_walk_period = 0; } if (incr) { @@ -1229,7 +1250,7 @@ __evict_push_candidate(WT_SESSION_IMPL *session, evict->btree = S2BT(session); evict->ref = ref; - evict->score = __evict_read_gen(evict); + evict->score = __evict_entry_priority(session, ref); /* Adjust for size when doing dirty eviction. */ if (F_ISSET(S2C(session)->cache, WT_CACHE_EVICT_DIRTY) && @@ -1247,7 +1268,7 @@ __evict_push_candidate(WT_SESSION_IMPL *session, */ static int __evict_walk_file(WT_SESSION_IMPL *session, - WT_EVICT_QUEUE *queue, u_int max_entries, u_int *slotp, bool *progressp) + WT_EVICT_QUEUE *queue, u_int max_entries, u_int *slotp) { WT_BTREE *btree; WT_CACHE *cache; @@ -1259,17 +1280,18 @@ __evict_walk_file(WT_SESSION_IMPL *session, WT_REF *ref; WT_TXN_GLOBAL *txn_global; uint64_t btree_inuse, bytes_per_slot, cache_inuse; - uint64_t pages_seen, refs_walked; + uint64_t pages_seen, pages_queued, refs_walked; uint32_t remaining_slots, total_slots, walk_flags; uint32_t target_pages_clean, target_pages_dirty, target_pages; int internal_pages, restarts; - bool modified; + bool give_up, modified, urgent_queued; conn = S2C(session); btree = S2BT(session); cache = conn->cache; - internal_pages = restarts = 0; txn_global = &conn->txn_global; + internal_pages = restarts = 0; + give_up = urgent_queued = false; /* * Figure out how many slots to fill from this tree. @@ -1324,8 +1346,10 @@ __evict_walk_file(WT_SESSION_IMPL *session, walk_flags = WT_READ_CACHE | WT_READ_NO_EVICT | WT_READ_NO_GEN | WT_READ_NO_WAIT; - if (F_ISSET(cache, WT_CACHE_WALK_REVERSE)) - walk_flags |= WT_READ_PREV; + + /* Randomize the walk direction. */ + if (btree->evict_walk_reverse) + FLD_SET(walk_flags, WT_READ_PREV); /* * Get some more eviction candidate pages. @@ -1339,14 +1363,26 @@ __evict_walk_file(WT_SESSION_IMPL *session, * Once we hit the page limit, do one more step through the walk in * case we are appending and only the last page in the file is live. */ - for (evict = start, pages_seen = refs_walked = 0; + for (evict = start, pages_queued = pages_seen = refs_walked = 0; evict < end && (ret == 0 || ret == WT_NOTFOUND); ret = __wt_tree_walk_count( session, &btree->evict_ref, &refs_walked, walk_flags)) { + /* + * Check whether we're finding a good ratio of candidates vs + * pages seen. Some workloads create "deserts" in trees where + * no good eviction candidates can be found. Abandon the walk + * if we get into that situation. + */ + give_up = !__wt_cache_aggressive(session) && pages_seen > 100 && + (pages_queued == 0 || (pages_seen / pages_queued) > + (10 * total_slots / target_pages)); + if (give_up) + break; + if ((ref = btree->evict_ref) == NULL) { if (++restarts == 2) break; - WT_STAT_FAST_CONN_INCR( + WT_STAT_CONN_INCR( session, cache_eviction_walks_started); continue; } @@ -1379,27 +1415,30 @@ __evict_walk_file(WT_SESSION_IMPL *session, /* Pages we no longer need (clean or dirty), are found money. */ if (page->read_gen == WT_READGEN_OLDEST || page->memory_footprint >= btree->splitmempage) { - WT_STAT_FAST_CONN_INCR( + WT_STAT_CONN_INCR( session, cache_eviction_pages_queued_oldest); if (__wt_page_evict_urgent(session, ref)) - *progressp = true; + urgent_queued = true; continue; } + /* Pages that are empty or from dead trees are also good. */ if (__wt_page_is_empty(page) || - F_ISSET(session->dhandle, WT_DHANDLE_DEAD) || - __wt_cache_aggressive(session)) + F_ISSET(session->dhandle, WT_DHANDLE_DEAD)) goto fast; /* Skip clean pages if appropriate. */ - if (!modified && (F_ISSET(conn, WT_CONN_IN_MEMORY) || - !F_ISSET(cache, WT_CACHE_EVICT_CLEAN))) + if (!modified && !F_ISSET(cache, WT_CACHE_EVICT_CLEAN)) continue; /* Skip dirty pages if appropriate. */ if (modified && !F_ISSET(cache, WT_CACHE_EVICT_DIRTY)) continue; + /* If eviction gets aggressive, anything else is fair game. */ + if (__wt_cache_aggressive(session)) + goto fast; + /* Limit internal pages to 50% of the total. */ if (WT_PAGE_IS_INTERNAL(page) && internal_pages >= (int)(evict - start) / 2) @@ -1426,6 +1465,7 @@ fast: /* If the page can't be evicted, give up. */ if (!__evict_push_candidate(session, queue, evict, ref)) continue; ++evict; + ++pages_queued; if (WT_PAGE_IS_INTERNAL(page)) ++internal_pages; @@ -1437,10 +1477,22 @@ fast: /* If the page can't be evicted, give up. */ WT_RET_NOTFOUND_OK(ret); *slotp += (u_int)(evict - start); - WT_STAT_FAST_CONN_INCRV( + WT_STAT_CONN_INCRV( session, cache_eviction_pages_queued, (u_int)(evict - start)); /* + * If we didn't find any candidates in the file, reverse the direction + * of the walk and skip it next time. + */ + if (give_up) + btree->evict_walk_reverse = !btree->evict_walk_reverse; + if (give_up && !urgent_queued) + btree->evict_walk_period = WT_MIN( + WT_MAX(1, 2 * btree->evict_walk_period), 100); + else if (pages_queued == target_pages) + btree->evict_walk_period = 0; + + /* * If we happen to end up on the root page, clear it. We have to track * hazard pointers, and the root page complicates that calculation. * @@ -1452,16 +1504,17 @@ fast: /* If the page can't be evicted, give up. */ * page: we want this page evicted as quickly as possible. */ if ((ref = btree->evict_ref) != NULL) { - if (__wt_ref_is_root(ref) || evict == start) - WT_RET(__evict_clear_walk(session)); + /* Give up the walk occasionally. */ + if (__wt_ref_is_root(ref) || evict == start || give_up) + WT_RET(__evict_clear_walk(session, restarts == 0)); else if (ref->page->read_gen == WT_READGEN_OLDEST) WT_RET_NOTFOUND_OK(__wt_tree_walk_count( session, &btree->evict_ref, &refs_walked, walk_flags)); } - WT_STAT_FAST_CONN_INCRV(session, cache_eviction_walk, refs_walked); - WT_STAT_FAST_CONN_INCRV(session, cache_eviction_pages_seen, pages_seen); + WT_STAT_CONN_INCRV(session, cache_eviction_walk, refs_walked); + WT_STAT_CONN_INCRV(session, cache_eviction_pages_seen, pages_seen); return (0); } @@ -1490,13 +1543,13 @@ __evict_get_ref( *btreep = NULL; *refp = NULL; - WT_STAT_FAST_CONN_INCR(session, cache_eviction_get_ref); + WT_STAT_CONN_INCR(session, cache_eviction_get_ref); /* Avoid the LRU lock if no pages are available. */ if (__evict_queue_empty(cache->evict_current_queue) && __evict_queue_empty(cache->evict_other_queue) && __evict_queue_empty(urgent_queue)) { - WT_STAT_FAST_CONN_INCR(session, cache_eviction_get_ref_empty); + WT_STAT_CONN_INCR(session, cache_eviction_get_ref_empty); return (WT_NOTFOUND); } @@ -1557,7 +1610,7 @@ __evict_get_ref( /* Verify there are still pages available. */ if (__evict_queue_empty(queue) || (uint32_t) (queue->evict_current - queue->evict_queue) >= candidates) { - WT_STAT_FAST_CONN_INCR( + WT_STAT_CONN_INCR( session, cache_eviction_get_ref_empty2); return (WT_NOTFOUND); } @@ -1587,8 +1640,8 @@ __evict_get_ref( * Don't force application threads to evict dirty pages if they * aren't stalled by the amount of dirty data in cache. */ - if (!urgent_ok && (is_server || (is_app && - !F_ISSET(cache, WT_CACHE_EVICT_DIRTY_HARD))) && + if (!urgent_ok && (is_server || + !F_ISSET(cache, WT_CACHE_EVICT_DIRTY_HARD)) && __wt_page_is_modified(evict->ref->page)) { --evict; break; @@ -1655,18 +1708,15 @@ __evict_page(WT_SESSION_IMPL *session, bool is_server) * worker thread. */ if (is_server) { - WT_STAT_FAST_CONN_INCR( - session, cache_eviction_server_evicting); + WT_STAT_CONN_INCR(session, cache_eviction_server_evicting); cache->server_evicts++; } else if (F_ISSET(session, WT_SESSION_INTERNAL)) { - WT_STAT_FAST_CONN_INCR( - session, cache_eviction_worker_evicting); + WT_STAT_CONN_INCR(session, cache_eviction_worker_evicting); cache->worker_evicts++; } else { if (__wt_page_is_modified(ref->page)) - WT_STAT_FAST_CONN_INCR( - session, cache_eviction_app_dirty); - WT_STAT_FAST_CONN_INCR(session, cache_eviction_app); + WT_STAT_CONN_INCR(session, cache_eviction_app_dirty); + WT_STAT_CONN_INCR(session, cache_eviction_app); cache->app_evicts++; } @@ -1745,7 +1795,7 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full) */ if (__wt_cache_stuck(session) && __wt_txn_am_oldest(session)) { --cache->evict_aggressive_score; - WT_STAT_FAST_CONN_INCR(session, txn_fail_cache); + WT_STAT_CONN_INCR(session, txn_fail_cache); return (WT_ROLLBACK); } @@ -1833,8 +1883,7 @@ __wt_page_evict_urgent(WT_SESSION_IMPL *session, WT_REF *ref) done: __wt_spin_unlock(session, &cache->evict_queue_lock); if (queued) { - WT_STAT_FAST_CONN_INCR( - session, cache_eviction_pages_queued_urgent); + WT_STAT_CONN_INCR(session, cache_eviction_pages_queued_urgent); if (WT_EVICT_HAS_WORKERS(session)) __wt_cond_signal(session, S2C(session)->evict_threads.wait_cond); diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c index 5ddf787c1f5..092f80cc000 100644 --- a/src/evict/evict_page.c +++ b/src/evict/evict_page.c @@ -49,8 +49,8 @@ __evict_exclusive(WT_SESSION_IMPL *session, WT_REF *ref) __wt_sleep(0, WT_THOUSAND); } - WT_STAT_FAST_DATA_INCR(session, cache_eviction_hazard); - WT_STAT_FAST_CONN_INCR(session, cache_eviction_hazard); + WT_STAT_DATA_INCR(session, cache_eviction_hazard); + WT_STAT_CONN_INCR(session, cache_eviction_hazard); return (EBUSY); } @@ -86,17 +86,17 @@ __wt_page_release_evict(WT_SESSION_IMPL *session, WT_REF *ref) too_big = page->memory_footprint >= btree->splitmempage; if ((ret = __wt_evict(session, ref, false)) == 0) { if (too_big) - WT_STAT_FAST_CONN_INCR(session, cache_eviction_force); + WT_STAT_CONN_INCR(session, cache_eviction_force); else /* * If the page isn't too big, we are evicting it because * it had a chain of deleted entries that make traversal * expensive. */ - WT_STAT_FAST_CONN_INCR( + WT_STAT_CONN_INCR( session, cache_eviction_force_delete); } else - WT_STAT_FAST_CONN_INCR(session, cache_eviction_force_fail); + WT_STAT_CONN_INCR(session, cache_eviction_force_fail); (void)__wt_atomic_subv32(&btree->evict_busy, 1); @@ -146,8 +146,8 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) /* Count evictions of internal pages during normal operation. */ if (!closing && WT_PAGE_IS_INTERNAL(page)) { - WT_STAT_FAST_CONN_INCR(session, cache_eviction_internal); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_internal); + WT_STAT_CONN_INCR(session, cache_eviction_internal); + WT_STAT_DATA_INCR(session, cache_eviction_internal); } /* @@ -176,19 +176,19 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) WT_ERR(__evict_page_dirty_update(session, ref, closing)); if (clean_page) { - WT_STAT_FAST_CONN_INCR(session, cache_eviction_clean); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_clean); + WT_STAT_CONN_INCR(session, cache_eviction_clean); + WT_STAT_DATA_INCR(session, cache_eviction_clean); } else { - WT_STAT_FAST_CONN_INCR(session, cache_eviction_dirty); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_dirty); + WT_STAT_CONN_INCR(session, cache_eviction_dirty); + WT_STAT_DATA_INCR(session, cache_eviction_dirty); } if (0) { err: if (!closing) __evict_exclusive_clear(session, ref); - WT_STAT_FAST_CONN_INCR(session, cache_eviction_fail); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_fail); + WT_STAT_CONN_INCR(session, cache_eviction_fail); + WT_STAT_DATA_INCR(session, cache_eviction_fail); } return (ret); diff --git a/src/include/btree.h b/src/include/btree.h index f1365c6c933..cfaf59e70e1 100644 --- a/src/include/btree.h +++ b/src/include/btree.h @@ -140,6 +140,7 @@ struct __wt_btree { u_int evict_walk_skips; /* Number of walks skipped */ u_int evict_disabled; /* Eviction disabled count */ volatile uint32_t evict_busy; /* Count of threads in eviction */ + bool evict_walk_reverse; /* Walk direction */ enum { WT_CKPT_OFF, WT_CKPT_PREPARE, WT_CKPT_RUNNING diff --git a/src/include/btree.i b/src/include/btree.i index c07966a4453..6e32c1bc195 100644 --- a/src/include/btree.i +++ b/src/include/btree.i @@ -1183,8 +1183,8 @@ __wt_leaf_page_can_split(WT_SESSION_IMPL *session, WT_PAGE *page) (WT_INSERT_KEY_SIZE(ins) + WT_UPDATE_MEMSIZE(ins->upd)); if (count > WT_MIN_SPLIT_COUNT && size > (size_t)btree->maxleafpage) { - WT_STAT_FAST_CONN_INCR(session, cache_inmem_splittable); - WT_STAT_FAST_DATA_INCR(session, cache_inmem_splittable); + WT_STAT_CONN_INCR(session, cache_inmem_splittable); + WT_STAT_DATA_INCR(session, cache_inmem_splittable); return (true); } } @@ -1233,8 +1233,8 @@ __wt_page_can_evict( * been written in the checkpoint, leaving the checkpoint inconsistent. */ if (modified && btree->checkpointing != WT_CKPT_OFF) { - WT_STAT_FAST_CONN_INCR(session, cache_eviction_checkpoint); - WT_STAT_FAST_DATA_INCR(session, cache_eviction_checkpoint); + WT_STAT_CONN_INCR(session, cache_eviction_checkpoint); + WT_STAT_DATA_INCR(session, cache_eviction_checkpoint); return (false); } @@ -1411,7 +1411,7 @@ __wt_page_hazard_check(WT_SESSION_IMPL *session, WT_PAGE *page) * come or go, we'll check the slots for all of the sessions that could * have been active when we started our check. */ - WT_STAT_FAST_CONN_INCR(session, cache_hazard_checks); + WT_STAT_CONN_INCR(session, cache_hazard_checks); WT_ORDERED_READ(session_cnt, conn->session_cnt); for (s = conn->sessions, i = 0, j = 0, max = 0; i < session_cnt; ++s, ++i) { @@ -1420,19 +1420,19 @@ __wt_page_hazard_check(WT_SESSION_IMPL *session, WT_PAGE *page) WT_ORDERED_READ(hazard_size, s->hazard_size); if (s->hazard_size > max) { max = s->hazard_size; - WT_STAT_FAST_CONN_SET(session, + WT_STAT_CONN_SET(session, cache_hazard_max, max); } for (hp = s->hazard; hp < s->hazard + hazard_size; ++hp) { ++j; if (hp->page == page) { - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, cache_hazard_walks, j); return (hp); } } } - WT_STAT_FAST_CONN_INCRV(session, cache_hazard_walks, j); + WT_STAT_CONN_INCRV(session, cache_hazard_walks, j); return (NULL); } diff --git a/src/include/cache.h b/src/include/cache.h index 0cb61f01435..515135f26ab 100644 --- a/src/include/cache.h +++ b/src/include/cache.h @@ -181,7 +181,6 @@ struct __wt_cache { #define WT_CACHE_EVICT_MASK 0x0FF #define WT_CACHE_POOL_MANAGER 0x100 /* The active cache pool manager */ #define WT_CACHE_POOL_RUN 0x200 /* Cache pool thread running */ -#define WT_CACHE_WALK_REVERSE 0x400 /* Scan backwards for candidates */ uint32_t flags; }; diff --git a/src/include/connection.h b/src/include/connection.h index 77dbc87b114..e19ad684b24 100644 --- a/src/include/connection.h +++ b/src/include/connection.h @@ -289,9 +289,8 @@ struct __wt_connection_impl { #define WT_CONN_STAT_CLEAR 0x02 /* clear after gathering */ #define WT_CONN_STAT_FAST 0x04 /* "fast" statistics configured */ #define WT_CONN_STAT_JSON 0x08 /* output JSON format */ -#define WT_CONN_STAT_NONE 0x10 /* don't gather statistics */ -#define WT_CONN_STAT_ON_CLOSE 0x20 /* output statistics on close */ -#define WT_CONN_STAT_SIZE 0x40 /* "size" statistics configured */ +#define WT_CONN_STAT_ON_CLOSE 0x10 /* output statistics on close */ +#define WT_CONN_STAT_SIZE 0x20 /* "size" statistics configured */ uint32_t stat_flags; /* Connection statistics */ diff --git a/src/include/lsm.h b/src/include/lsm.h index 444073087df..2550ca444c1 100644 --- a/src/include/lsm.h +++ b/src/include/lsm.h @@ -228,11 +228,11 @@ struct __wt_lsm_tree { * area, copying them into place when a statistics cursor is created. */ #define WT_LSM_TREE_STAT_INCR(session, fld) do { \ - if (FLD_ISSET(S2C(session)->stat_flags, WT_CONN_STAT_FAST)) \ + if (WT_STAT_ENABLED(session)) \ ++(fld); \ } while (0) #define WT_LSM_TREE_STAT_INCRV(session, fld, v) do { \ - if (FLD_ISSET(S2C(session)->stat_flags, WT_CONN_STAT_FAST)) \ + if (WT_STAT_ENABLED(session)) \ (fld) += (int64_t)(v); \ } while (0) int64_t bloom_false_positive; diff --git a/src/include/os_fhandle.i b/src/include/os_fhandle.i index a9150279a85..428b14556d9 100644 --- a/src/include/os_fhandle.i +++ b/src/include/os_fhandle.i @@ -26,15 +26,15 @@ __wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh, bool block) * There is no way to check when the non-blocking sync-file-range is * complete, but we track the time taken in the call for completeness. */ - WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_fsync_active); - WT_STAT_FAST_CONN_INCR(session, fsync_io); + WT_STAT_CONN_INCR_ATOMIC(session, thread_fsync_active); + WT_STAT_CONN_INCR(session, fsync_io); if (block) ret = (handle->fh_sync == NULL ? 0 : handle->fh_sync(handle, (WT_SESSION *)session)); else ret = (handle->fh_sync_nowait == NULL ? 0 : handle->fh_sync_nowait(handle, (WT_SESSION *)session)); - WT_STAT_FAST_CONN_DECR_ATOMIC(session, thread_fsync_active); + WT_STAT_CONN_DECR_ATOMIC(session, thread_fsync_active); return (ret); } @@ -99,13 +99,13 @@ __wt_read( "%s: handle-read: %" WT_SIZET_FMT " at %" PRIuMAX, fh->handle->name, len, (uintmax_t)offset); - WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_read_active); - WT_STAT_FAST_CONN_INCR(session, read_io); + WT_STAT_CONN_INCR_ATOMIC(session, thread_read_active); + WT_STAT_CONN_INCR(session, read_io); ret = fh->handle->fh_read( fh->handle, (WT_SESSION *)session, offset, len, buf); - WT_STAT_FAST_CONN_DECR_ATOMIC(session, thread_read_active); + WT_STAT_CONN_DECR_ATOMIC(session, thread_read_active); return (ret); } @@ -173,12 +173,12 @@ __wt_write(WT_SESSION_IMPL *session, */ WT_RET(WT_SESSION_CHECK_PANIC(session)); - WT_STAT_FAST_CONN_INCR(session, write_io); - WT_STAT_FAST_CONN_INCR_ATOMIC(session, thread_write_active); + WT_STAT_CONN_INCR(session, write_io); + WT_STAT_CONN_INCR_ATOMIC(session, thread_write_active); ret = fh->handle->fh_write( fh->handle, (WT_SESSION *)session, offset, len, buf); - WT_STAT_FAST_CONN_DECR_ATOMIC(session, thread_write_active); + WT_STAT_CONN_DECR_ATOMIC(session, thread_write_active); return (ret); } diff --git a/src/include/stat.h b/src/include/stat.h index b61c568783b..cd0cae16826 100644 --- a/src/include/stat.h +++ b/src/include/stat.h @@ -133,105 +133,92 @@ __wt_stats_clear(void *stats_arg, int slot) } /* - * Read/write statistics without any test for statistics configuration. Reading - * and writing the field requires different actions: reading sums the values + * Read/write statistics if statistics gathering is enabled. Reading and + * writing the field requires different actions: reading sums the values * across the array of structures, writing updates a single structure's value. */ +#define WT_STAT_ENABLED(session) (S2C(session)->stat_flags != 0) + #define WT_STAT_READ(stats, fld) \ __wt_stats_aggregate(stats, WT_STATS_FIELD_TO_SLOT(stats, fld)) -#define WT_STAT_WRITE(stats, fld, v) \ - (stats)->fld = (int64_t)(v) - -#define WT_STAT_DECRV(session, stats, fld, value) \ - (stats)[WT_STATS_SLOT_ID(session)]->fld -= (int64_t)(value) -#define WT_STAT_DECRV_ATOMIC(session, stats, fld, value) \ - __wt_atomic_subi64( \ - &(stats)[WT_STATS_SLOT_ID(session)]->fld, (int64_t)(value)) -#define WT_STAT_DECR(session, stats, fld) \ - WT_STAT_DECRV(session, stats, fld, 1) -#define WT_STAT_INCRV(session, stats, fld, value) \ - (stats)[WT_STATS_SLOT_ID(session)]->fld += (int64_t)(value) -#define WT_STAT_INCRV_ATOMIC(session, stats, fld, value) \ - __wt_atomic_addi64( \ - &(stats)[WT_STATS_SLOT_ID(session)]->fld, (int64_t)(value)) -#define WT_STAT_INCR(session, stats, fld) \ - WT_STAT_INCRV(session, stats, fld, 1) -#define WT_STAT_SET(session, stats, fld, value) do { \ - __wt_stats_clear(stats, WT_STATS_FIELD_TO_SLOT(stats, fld)); \ - (stats)[0]->fld = (int64_t)(value); \ +#define WT_STAT_WRITE(session, stats, fld, v) do { \ + if (WT_STAT_ENABLED(session)) \ + (stats)->fld = (int64_t)(v); \ } while (0) -/* - * Update statistics if "fast" statistics are configured. - */ -#define WT_STAT_FAST_DECRV(session, stats, fld, value) do { \ - if (FLD_ISSET(S2C(session)->stat_flags, WT_CONN_STAT_FAST)) \ - WT_STAT_DECRV(session, stats, fld, value); \ +#define WT_STAT_DECRV(session, stats, fld, value) do { \ + if (WT_STAT_ENABLED(session)) \ + (stats)[WT_STATS_SLOT_ID(session)]->fld -= (int64_t)(value); \ } while (0) -#define WT_STAT_FAST_DECR(session, stats, fld) \ - WT_STAT_FAST_DECRV(session, stats, fld, 1) -#define WT_STAT_FAST_DECRV_ATOMIC(session, stats, fld, value) do { \ - if (FLD_ISSET(S2C(session)->stat_flags, WT_CONN_STAT_FAST)) \ - WT_STAT_DECRV_ATOMIC(session, stats, fld, value); \ +#define WT_STAT_DECRV_ATOMIC(session, stats, fld, value) do { \ + if (WT_STAT_ENABLED(session)) \ + __wt_atomic_subi64(&(stats)[WT_STATS_SLOT_ID(session)]->fld, \ + (int64_t)(value)); \ } while (0) -#define WT_STAT_FAST_INCRV(session, stats, fld, value) do { \ - if (FLD_ISSET(S2C(session)->stat_flags, WT_CONN_STAT_FAST)) \ - WT_STAT_INCRV(session, stats, fld, value); \ +#define WT_STAT_DECR(session, stats, fld) \ + WT_STAT_DECRV(session, stats, fld, 1) +#define WT_STAT_INCRV(session, stats, fld, value) do { \ + if (WT_STAT_ENABLED(session)) \ + (stats)[WT_STATS_SLOT_ID(session)]->fld += (int64_t)(value); \ } while (0) -#define WT_STAT_FAST_INCR(session, stats, fld) \ - WT_STAT_FAST_INCRV(session, stats, fld, 1) -#define WT_STAT_FAST_INCRV_ATOMIC(session, stats, fld, value) do { \ - if (FLD_ISSET(S2C(session)->stat_flags, WT_CONN_STAT_FAST)) \ - WT_STAT_INCRV_ATOMIC(session, stats, fld, value); \ +#define WT_STAT_INCRV_ATOMIC(session, stats, fld, value) do { \ + if (WT_STAT_ENABLED(session)) \ + __wt_atomic_addi64(&(stats)[WT_STATS_SLOT_ID(session)]->fld, \ + (int64_t)(value)); \ } while (0) -#define WT_STAT_FAST_SET(session, stats, fld, value) do { \ - if (FLD_ISSET(S2C(session)->stat_flags, WT_CONN_STAT_FAST)) \ - WT_STAT_SET(session, stats, fld, value); \ +#define WT_STAT_INCR(session, stats, fld) \ + WT_STAT_INCRV(session, stats, fld, 1) +#define WT_STAT_SET(session, stats, fld, value) do { \ + if (WT_STAT_ENABLED(session)) { \ + __wt_stats_clear(stats, \ + WT_STATS_FIELD_TO_SLOT(stats, fld)); \ + (stats)[0]->fld = (int64_t)(value); \ + } \ } while (0) /* - * Update connection handle statistics if "fast" statistics are configured. + * Update connection handle statistics if statistics gathering is enabled. */ -#define WT_STAT_FAST_CONN_DECR(session, fld) \ - WT_STAT_FAST_DECR(session, S2C(session)->stats, fld) -#define WT_STAT_FAST_CONN_DECR_ATOMIC(session, fld) \ - WT_STAT_FAST_DECRV_ATOMIC(session, S2C(session)->stats, fld, 1) -#define WT_STAT_FAST_CONN_DECRV(session, fld, value) \ - WT_STAT_FAST_DECRV(session, S2C(session)->stats, fld, value) -#define WT_STAT_FAST_CONN_INCR(session, fld) \ - WT_STAT_FAST_INCR(session, S2C(session)->stats, fld) -#define WT_STAT_FAST_CONN_INCR_ATOMIC(session, fld) \ - WT_STAT_FAST_INCRV_ATOMIC(session, S2C(session)->stats, fld, 1) -#define WT_STAT_FAST_CONN_INCRV(session, fld, value) \ - WT_STAT_FAST_INCRV(session, S2C(session)->stats, fld, value) -#define WT_STAT_FAST_CONN_SET(session, fld, value) \ - WT_STAT_FAST_SET(session, S2C(session)->stats, fld, value) +#define WT_STAT_CONN_DECR(session, fld) \ + WT_STAT_DECR(session, S2C(session)->stats, fld) +#define WT_STAT_CONN_DECR_ATOMIC(session, fld) \ + WT_STAT_DECRV_ATOMIC(session, S2C(session)->stats, fld, 1) +#define WT_STAT_CONN_DECRV(session, fld, value) \ + WT_STAT_DECRV(session, S2C(session)->stats, fld, value) +#define WT_STAT_CONN_INCR(session, fld) \ + WT_STAT_INCR(session, S2C(session)->stats, fld) +#define WT_STAT_CONN_INCR_ATOMIC(session, fld) \ + WT_STAT_INCRV_ATOMIC(session, S2C(session)->stats, fld, 1) +#define WT_STAT_CONN_INCRV(session, fld, value) \ + WT_STAT_INCRV(session, S2C(session)->stats, fld, value) +#define WT_STAT_CONN_SET(session, fld, value) \ + WT_STAT_SET(session, S2C(session)->stats, fld, value) /* - * Update data-source handle statistics if "fast" statistics are configured + * Update data-source handle statistics if statistics gathering is enabled * and the data-source handle is set. * * XXX * We shouldn't have to check if the data-source handle is NULL, but it's * necessary until everything is converted to using data-source handles. */ -#define WT_STAT_FAST_DATA_DECRV(session, fld, value) do { \ +#define WT_STAT_DATA_DECRV(session, fld, value) do { \ if ((session)->dhandle != NULL) \ - WT_STAT_FAST_DECRV( \ + WT_STAT_DECRV( \ session, (session)->dhandle->stats, fld, value); \ } while (0) -#define WT_STAT_FAST_DATA_DECR(session, fld) \ - WT_STAT_FAST_DATA_DECRV(session, fld, 1) -#define WT_STAT_FAST_DATA_INCRV(session, fld, value) do { \ +#define WT_STAT_DATA_DECR(session, fld) \ + WT_STAT_DATA_DECRV(session, fld, 1) +#define WT_STAT_DATA_INCRV(session, fld, value) do { \ if ((session)->dhandle != NULL) \ - WT_STAT_FAST_INCRV( \ + WT_STAT_INCRV( \ session, (session)->dhandle->stats, fld, value); \ } while (0) -#define WT_STAT_FAST_DATA_INCR(session, fld) \ - WT_STAT_FAST_DATA_INCRV(session, fld, 1) -#define WT_STAT_FAST_DATA_SET(session, fld, value) do { \ +#define WT_STAT_DATA_INCR(session, fld) \ + WT_STAT_DATA_INCRV(session, fld, 1) +#define WT_STAT_DATA_SET(session, fld, value) do { \ if ((session)->dhandle != NULL) \ - WT_STAT_FAST_SET( \ + WT_STAT_SET( \ session, (session)->dhandle->stats, fld, value); \ } while (0) @@ -286,12 +273,14 @@ struct __wt_connection_stats { int64_t cache_eviction_get_ref_empty; int64_t cache_eviction_get_ref_empty2; int64_t cache_eviction_aggressive_set; + int64_t cache_eviction_empty_score; int64_t cache_eviction_queue_empty; int64_t cache_eviction_queue_not_empty; int64_t cache_eviction_server_evicting; int64_t cache_eviction_server_slept; int64_t cache_eviction_slow; int64_t cache_eviction_state; + int64_t cache_eviction_walks_abandoned; int64_t cache_eviction_worker_evicting; int64_t cache_eviction_force_fail; int64_t cache_eviction_walks_active; diff --git a/src/include/txn.i b/src/include/txn.i index ffd319fd5c1..1a8851a9a2a 100644 --- a/src/include/txn.i +++ b/src/include/txn.i @@ -21,7 +21,7 @@ __txn_next_op(WT_SESSION_IMPL *session, WT_TXN_OP **opp) txn = &session->txn; *opp = NULL; - /* + /* * We're about to perform an update. * Make sure we have allocated a transaction ID. */ @@ -414,7 +414,7 @@ __wt_txn_update_check(WT_SESSION_IMPL *session, WT_UPDATE *upd) if (txn->isolation == WT_ISO_SNAPSHOT) while (upd != NULL && !__wt_txn_visible(session, upd->txnid)) { if (upd->txnid != WT_TXN_ABORTED) { - WT_STAT_FAST_DATA_INCR( + WT_STAT_DATA_INCR( session, txn_update_conflict); return (WT_ROLLBACK); } diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index 61a66bd4086..f4763a113f1 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -1812,7 +1812,7 @@ struct __wt_connection { * of checkpoints to bring the dirty content in cache to this level\, * expressed as a percentage of the total cache size. Ignored if set to * zero or \c in_memory is \c true., an integer between 0 and 99; - * default \c 15.} + * default \c 5.} * @config{eviction_dirty_target, perform eviction in worker threads * when the cache contains at least this much dirty content\, expressed * as a percentage of the total cache size. Ignored if \c in_memory is @@ -2278,7 +2278,7 @@ struct __wt_connection { * @config{eviction_checkpoint_target, perform eviction at the beginning of * checkpoints to bring the dirty content in cache to this level\, expressed as * a percentage of the total cache size. Ignored if set to zero or \c in_memory - * is \c true., an integer between 0 and 99; default \c 15.} + * is \c true., an integer between 0 and 99; default \c 5.} * @config{eviction_dirty_target, perform eviction in worker threads when the * cache contains at least this much dirty content\, expressed as a percentage * of the total cache size. Ignored if \c in_memory is \c true., an integer @@ -4294,360 +4294,364 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_CACHE_EVICTION_GET_REF_EMPTY2 1039 /*! cache: eviction currently operating in aggressive mode */ #define WT_STAT_CONN_CACHE_EVICTION_AGGRESSIVE_SET 1040 +/*! cache: eviction empty score */ +#define WT_STAT_CONN_CACHE_EVICTION_EMPTY_SCORE 1041 /*! cache: eviction server candidate queue empty when topping up */ -#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_EMPTY 1041 +#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_EMPTY 1042 /*! cache: eviction server candidate queue not empty when topping up */ -#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1042 +#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1043 /*! cache: eviction server evicting pages */ -#define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1043 +#define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1044 /*! * cache: eviction server slept, because we did not make progress with * eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SERVER_SLEPT 1044 +#define WT_STAT_CONN_CACHE_EVICTION_SERVER_SLEPT 1045 /*! cache: eviction server unable to reach eviction goal */ -#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1045 +#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1046 /*! cache: eviction state */ -#define WT_STAT_CONN_CACHE_EVICTION_STATE 1046 +#define WT_STAT_CONN_CACHE_EVICTION_STATE 1047 +/*! cache: eviction walks abandoned */ +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ABANDONED 1048 /*! cache: eviction worker thread evicting pages */ -#define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1047 +#define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1049 /*! cache: failed eviction of pages that exceeded the in-memory maximum */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1048 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1050 /*! cache: files with active eviction walks */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ACTIVE 1049 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ACTIVE 1051 /*! cache: files with new eviction walks started */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STARTED 1050 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STARTED 1052 /*! cache: hazard pointer blocked page eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1051 +#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1053 /*! cache: hazard pointer check calls */ -#define WT_STAT_CONN_CACHE_HAZARD_CHECKS 1052 +#define WT_STAT_CONN_CACHE_HAZARD_CHECKS 1054 /*! cache: hazard pointer check entries walked */ -#define WT_STAT_CONN_CACHE_HAZARD_WALKS 1053 +#define WT_STAT_CONN_CACHE_HAZARD_WALKS 1055 /*! cache: hazard pointer maximum array length */ -#define WT_STAT_CONN_CACHE_HAZARD_MAX 1054 +#define WT_STAT_CONN_CACHE_HAZARD_MAX 1056 /*! cache: in-memory page passed criteria to be split */ -#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1055 +#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1057 /*! cache: in-memory page splits */ -#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1056 +#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1058 /*! cache: internal pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1057 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1059 /*! cache: internal pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1058 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1060 /*! cache: leaf pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1059 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1061 /*! cache: lookaside table insert calls */ -#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1060 +#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1062 /*! cache: lookaside table remove calls */ -#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1061 +#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1063 /*! cache: maximum bytes configured */ -#define WT_STAT_CONN_CACHE_BYTES_MAX 1062 +#define WT_STAT_CONN_CACHE_BYTES_MAX 1064 /*! cache: maximum page size at eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1063 +#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1065 /*! cache: modified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1064 +#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1066 /*! cache: modified pages evicted by application threads */ -#define WT_STAT_CONN_CACHE_EVICTION_APP_DIRTY 1065 +#define WT_STAT_CONN_CACHE_EVICTION_APP_DIRTY 1067 /*! cache: overflow pages read into cache */ -#define WT_STAT_CONN_CACHE_READ_OVERFLOW 1066 +#define WT_STAT_CONN_CACHE_READ_OVERFLOW 1068 /*! cache: overflow values cached in memory */ -#define WT_STAT_CONN_CACHE_OVERFLOW_VALUE 1067 +#define WT_STAT_CONN_CACHE_OVERFLOW_VALUE 1069 /*! cache: page split during eviction deepened the tree */ -#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1068 +#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1070 /*! cache: page written requiring lookaside records */ -#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1069 +#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1071 /*! cache: pages currently held in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_INUSE 1070 +#define WT_STAT_CONN_CACHE_PAGES_INUSE 1072 /*! cache: pages evicted because they exceeded the in-memory maximum */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1071 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1073 /*! cache: pages evicted because they had chains of deleted items */ -#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1072 +#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1074 /*! cache: pages evicted by application threads */ -#define WT_STAT_CONN_CACHE_EVICTION_APP 1073 +#define WT_STAT_CONN_CACHE_EVICTION_APP 1075 /*! cache: pages queued for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1074 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1076 /*! cache: pages queued for urgent eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_URGENT 1075 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_URGENT 1077 /*! cache: pages queued for urgent eviction during walk */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1076 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1078 /*! cache: pages read into cache */ -#define WT_STAT_CONN_CACHE_READ 1077 +#define WT_STAT_CONN_CACHE_READ 1079 /*! cache: pages read into cache requiring lookaside entries */ -#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1078 +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1080 /*! cache: pages requested from the cache */ -#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1079 +#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1081 /*! cache: pages seen by eviction walk */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1080 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1082 /*! cache: pages selected for eviction unable to be evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1081 +#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1083 /*! cache: pages walked for eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK 1082 +#define WT_STAT_CONN_CACHE_EVICTION_WALK 1084 /*! cache: pages written from cache */ -#define WT_STAT_CONN_CACHE_WRITE 1083 +#define WT_STAT_CONN_CACHE_WRITE 1085 /*! cache: pages written requiring in-memory restoration */ -#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1084 +#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1086 /*! cache: percentage overhead */ -#define WT_STAT_CONN_CACHE_OVERHEAD 1085 +#define WT_STAT_CONN_CACHE_OVERHEAD 1087 /*! cache: tracked bytes belonging to internal pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1086 +#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1088 /*! cache: tracked bytes belonging to leaf pages in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_LEAF 1087 +#define WT_STAT_CONN_CACHE_BYTES_LEAF 1089 /*! cache: tracked dirty bytes in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1088 +#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1090 /*! cache: tracked dirty pages in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1089 +#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1091 /*! cache: unmodified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1090 +#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1092 /*! connection: auto adjusting condition resets */ -#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1091 +#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1093 /*! connection: auto adjusting condition wait calls */ -#define WT_STAT_CONN_COND_AUTO_WAIT 1092 +#define WT_STAT_CONN_COND_AUTO_WAIT 1094 /*! connection: files currently open */ -#define WT_STAT_CONN_FILE_OPEN 1093 +#define WT_STAT_CONN_FILE_OPEN 1095 /*! connection: memory allocations */ -#define WT_STAT_CONN_MEMORY_ALLOCATION 1094 +#define WT_STAT_CONN_MEMORY_ALLOCATION 1096 /*! connection: memory frees */ -#define WT_STAT_CONN_MEMORY_FREE 1095 +#define WT_STAT_CONN_MEMORY_FREE 1097 /*! connection: memory re-allocations */ -#define WT_STAT_CONN_MEMORY_GROW 1096 +#define WT_STAT_CONN_MEMORY_GROW 1098 /*! connection: pthread mutex condition wait calls */ -#define WT_STAT_CONN_COND_WAIT 1097 +#define WT_STAT_CONN_COND_WAIT 1099 /*! connection: pthread mutex shared lock read-lock calls */ -#define WT_STAT_CONN_RWLOCK_READ 1098 +#define WT_STAT_CONN_RWLOCK_READ 1100 /*! connection: pthread mutex shared lock write-lock calls */ -#define WT_STAT_CONN_RWLOCK_WRITE 1099 +#define WT_STAT_CONN_RWLOCK_WRITE 1101 /*! connection: total fsync I/Os */ -#define WT_STAT_CONN_FSYNC_IO 1100 +#define WT_STAT_CONN_FSYNC_IO 1102 /*! connection: total read I/Os */ -#define WT_STAT_CONN_READ_IO 1101 +#define WT_STAT_CONN_READ_IO 1103 /*! connection: total write I/Os */ -#define WT_STAT_CONN_WRITE_IO 1102 +#define WT_STAT_CONN_WRITE_IO 1104 /*! cursor: cursor create calls */ -#define WT_STAT_CONN_CURSOR_CREATE 1103 +#define WT_STAT_CONN_CURSOR_CREATE 1105 /*! cursor: cursor insert calls */ -#define WT_STAT_CONN_CURSOR_INSERT 1104 +#define WT_STAT_CONN_CURSOR_INSERT 1106 /*! cursor: cursor next calls */ -#define WT_STAT_CONN_CURSOR_NEXT 1105 +#define WT_STAT_CONN_CURSOR_NEXT 1107 /*! cursor: cursor prev calls */ -#define WT_STAT_CONN_CURSOR_PREV 1106 +#define WT_STAT_CONN_CURSOR_PREV 1108 /*! cursor: cursor remove calls */ -#define WT_STAT_CONN_CURSOR_REMOVE 1107 +#define WT_STAT_CONN_CURSOR_REMOVE 1109 /*! cursor: cursor reset calls */ -#define WT_STAT_CONN_CURSOR_RESET 1108 +#define WT_STAT_CONN_CURSOR_RESET 1110 /*! cursor: cursor restarted searches */ -#define WT_STAT_CONN_CURSOR_RESTART 1109 +#define WT_STAT_CONN_CURSOR_RESTART 1111 /*! cursor: cursor search calls */ -#define WT_STAT_CONN_CURSOR_SEARCH 1110 +#define WT_STAT_CONN_CURSOR_SEARCH 1112 /*! cursor: cursor search near calls */ -#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1111 +#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1113 /*! cursor: cursor update calls */ -#define WT_STAT_CONN_CURSOR_UPDATE 1112 +#define WT_STAT_CONN_CURSOR_UPDATE 1114 /*! cursor: truncate calls */ -#define WT_STAT_CONN_CURSOR_TRUNCATE 1113 +#define WT_STAT_CONN_CURSOR_TRUNCATE 1115 /*! data-handle: connection data handles currently active */ -#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1114 +#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1116 /*! data-handle: connection sweep candidate became referenced */ -#define WT_STAT_CONN_DH_SWEEP_REF 1115 +#define WT_STAT_CONN_DH_SWEEP_REF 1117 /*! data-handle: connection sweep dhandles closed */ -#define WT_STAT_CONN_DH_SWEEP_CLOSE 1116 +#define WT_STAT_CONN_DH_SWEEP_CLOSE 1118 /*! data-handle: connection sweep dhandles removed from hash list */ -#define WT_STAT_CONN_DH_SWEEP_REMOVE 1117 +#define WT_STAT_CONN_DH_SWEEP_REMOVE 1119 /*! data-handle: connection sweep time-of-death sets */ -#define WT_STAT_CONN_DH_SWEEP_TOD 1118 +#define WT_STAT_CONN_DH_SWEEP_TOD 1120 /*! data-handle: connection sweeps */ -#define WT_STAT_CONN_DH_SWEEPS 1119 +#define WT_STAT_CONN_DH_SWEEPS 1121 /*! data-handle: session dhandles swept */ -#define WT_STAT_CONN_DH_SESSION_HANDLES 1120 +#define WT_STAT_CONN_DH_SESSION_HANDLES 1122 /*! data-handle: session sweep attempts */ -#define WT_STAT_CONN_DH_SESSION_SWEEPS 1121 +#define WT_STAT_CONN_DH_SESSION_SWEEPS 1123 /*! log: busy returns attempting to switch slots */ -#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1122 +#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1124 /*! log: consolidated slot closures */ -#define WT_STAT_CONN_LOG_SLOT_CLOSES 1123 +#define WT_STAT_CONN_LOG_SLOT_CLOSES 1125 /*! log: consolidated slot join races */ -#define WT_STAT_CONN_LOG_SLOT_RACES 1124 +#define WT_STAT_CONN_LOG_SLOT_RACES 1126 /*! log: consolidated slot join transitions */ -#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1125 +#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1127 /*! log: consolidated slot joins */ -#define WT_STAT_CONN_LOG_SLOT_JOINS 1126 +#define WT_STAT_CONN_LOG_SLOT_JOINS 1128 /*! log: consolidated slot unbuffered writes */ -#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1127 +#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1129 /*! log: log bytes of payload data */ -#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1128 +#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1130 /*! log: log bytes written */ -#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1129 +#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1131 /*! log: log files manually zero-filled */ -#define WT_STAT_CONN_LOG_ZERO_FILLS 1130 +#define WT_STAT_CONN_LOG_ZERO_FILLS 1132 /*! log: log flush operations */ -#define WT_STAT_CONN_LOG_FLUSH 1131 +#define WT_STAT_CONN_LOG_FLUSH 1133 /*! log: log force write operations */ -#define WT_STAT_CONN_LOG_FORCE_WRITE 1132 +#define WT_STAT_CONN_LOG_FORCE_WRITE 1134 /*! log: log force write operations skipped */ -#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1133 +#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1135 /*! log: log records compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1134 +#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1136 /*! log: log records not compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1135 +#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1137 /*! log: log records too small to compress */ -#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1136 +#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1138 /*! log: log release advances write LSN */ -#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1137 +#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1139 /*! log: log scan operations */ -#define WT_STAT_CONN_LOG_SCANS 1138 +#define WT_STAT_CONN_LOG_SCANS 1140 /*! log: log scan records requiring two reads */ -#define WT_STAT_CONN_LOG_SCAN_REREADS 1139 +#define WT_STAT_CONN_LOG_SCAN_REREADS 1141 /*! log: log server thread advances write LSN */ -#define WT_STAT_CONN_LOG_WRITE_LSN 1140 +#define WT_STAT_CONN_LOG_WRITE_LSN 1142 /*! log: log server thread write LSN walk skipped */ -#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1141 +#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1143 /*! log: log sync operations */ -#define WT_STAT_CONN_LOG_SYNC 1142 +#define WT_STAT_CONN_LOG_SYNC 1144 /*! log: log sync time duration (usecs) */ -#define WT_STAT_CONN_LOG_SYNC_DURATION 1143 +#define WT_STAT_CONN_LOG_SYNC_DURATION 1145 /*! log: log sync_dir operations */ -#define WT_STAT_CONN_LOG_SYNC_DIR 1144 +#define WT_STAT_CONN_LOG_SYNC_DIR 1146 /*! log: log sync_dir time duration (usecs) */ -#define WT_STAT_CONN_LOG_SYNC_DIR_DURATION 1145 +#define WT_STAT_CONN_LOG_SYNC_DIR_DURATION 1147 /*! log: log write operations */ -#define WT_STAT_CONN_LOG_WRITES 1146 +#define WT_STAT_CONN_LOG_WRITES 1148 /*! log: logging bytes consolidated */ -#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1147 +#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1149 /*! log: maximum log file size */ -#define WT_STAT_CONN_LOG_MAX_FILESIZE 1148 +#define WT_STAT_CONN_LOG_MAX_FILESIZE 1150 /*! log: number of pre-allocated log files to create */ -#define WT_STAT_CONN_LOG_PREALLOC_MAX 1149 +#define WT_STAT_CONN_LOG_PREALLOC_MAX 1151 /*! log: pre-allocated log files not ready and missed */ -#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1150 +#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1152 /*! log: pre-allocated log files prepared */ -#define WT_STAT_CONN_LOG_PREALLOC_FILES 1151 +#define WT_STAT_CONN_LOG_PREALLOC_FILES 1153 /*! log: pre-allocated log files used */ -#define WT_STAT_CONN_LOG_PREALLOC_USED 1152 +#define WT_STAT_CONN_LOG_PREALLOC_USED 1154 /*! log: records processed by log scan */ -#define WT_STAT_CONN_LOG_SCAN_RECORDS 1153 +#define WT_STAT_CONN_LOG_SCAN_RECORDS 1155 /*! log: total in-memory size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_MEM 1154 +#define WT_STAT_CONN_LOG_COMPRESS_MEM 1156 /*! log: total log buffer size */ -#define WT_STAT_CONN_LOG_BUFFER_SIZE 1155 +#define WT_STAT_CONN_LOG_BUFFER_SIZE 1157 /*! log: total size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_LEN 1156 +#define WT_STAT_CONN_LOG_COMPRESS_LEN 1158 /*! log: written slots coalesced */ -#define WT_STAT_CONN_LOG_SLOT_COALESCED 1157 +#define WT_STAT_CONN_LOG_SLOT_COALESCED 1159 /*! log: yields waiting for previous log file close */ -#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1158 +#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1160 /*! reconciliation: fast-path pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1159 +#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1161 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_CONN_REC_PAGES 1160 +#define WT_STAT_CONN_REC_PAGES 1162 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_CONN_REC_PAGES_EVICTION 1161 +#define WT_STAT_CONN_REC_PAGES_EVICTION 1163 /*! reconciliation: pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE 1162 +#define WT_STAT_CONN_REC_PAGE_DELETE 1164 /*! reconciliation: split bytes currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1163 +#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1165 /*! reconciliation: split objects currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1164 +#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1166 /*! session: open cursor count */ -#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1165 +#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1167 /*! session: open session count */ -#define WT_STAT_CONN_SESSION_OPEN 1166 +#define WT_STAT_CONN_SESSION_OPEN 1168 /*! session: table compact failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_COMPACT_FAIL 1167 +#define WT_STAT_CONN_SESSION_TABLE_COMPACT_FAIL 1169 /*! session: table compact successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_COMPACT_SUCCESS 1168 +#define WT_STAT_CONN_SESSION_TABLE_COMPACT_SUCCESS 1170 /*! session: table create failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_CREATE_FAIL 1169 +#define WT_STAT_CONN_SESSION_TABLE_CREATE_FAIL 1171 /*! session: table create successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_CREATE_SUCCESS 1170 +#define WT_STAT_CONN_SESSION_TABLE_CREATE_SUCCESS 1172 /*! session: table drop failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_DROP_FAIL 1171 +#define WT_STAT_CONN_SESSION_TABLE_DROP_FAIL 1173 /*! session: table drop successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_DROP_SUCCESS 1172 +#define WT_STAT_CONN_SESSION_TABLE_DROP_SUCCESS 1174 /*! session: table rebalance failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_FAIL 1173 +#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_FAIL 1175 /*! session: table rebalance successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_SUCCESS 1174 +#define WT_STAT_CONN_SESSION_TABLE_REBALANCE_SUCCESS 1176 /*! session: table rename failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_RENAME_FAIL 1175 +#define WT_STAT_CONN_SESSION_TABLE_RENAME_FAIL 1177 /*! session: table rename successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_RENAME_SUCCESS 1176 +#define WT_STAT_CONN_SESSION_TABLE_RENAME_SUCCESS 1178 /*! session: table salvage failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_FAIL 1177 +#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_FAIL 1179 /*! session: table salvage successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_SUCCESS 1178 +#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_SUCCESS 1180 /*! session: table truncate failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_FAIL 1179 +#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_FAIL 1181 /*! session: table truncate successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_SUCCESS 1180 +#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_SUCCESS 1182 /*! session: table verify failed calls */ -#define WT_STAT_CONN_SESSION_TABLE_VERIFY_FAIL 1181 +#define WT_STAT_CONN_SESSION_TABLE_VERIFY_FAIL 1183 /*! session: table verify successful calls */ -#define WT_STAT_CONN_SESSION_TABLE_VERIFY_SUCCESS 1182 +#define WT_STAT_CONN_SESSION_TABLE_VERIFY_SUCCESS 1184 /*! thread-state: active filesystem fsync calls */ -#define WT_STAT_CONN_THREAD_FSYNC_ACTIVE 1183 +#define WT_STAT_CONN_THREAD_FSYNC_ACTIVE 1185 /*! thread-state: active filesystem read calls */ -#define WT_STAT_CONN_THREAD_READ_ACTIVE 1184 +#define WT_STAT_CONN_THREAD_READ_ACTIVE 1186 /*! thread-state: active filesystem write calls */ -#define WT_STAT_CONN_THREAD_WRITE_ACTIVE 1185 +#define WT_STAT_CONN_THREAD_WRITE_ACTIVE 1187 /*! thread-yield: page acquire busy blocked */ -#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1186 +#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1188 /*! thread-yield: page acquire eviction blocked */ -#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1187 +#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1189 /*! thread-yield: page acquire locked blocked */ -#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1188 +#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1190 /*! thread-yield: page acquire read blocked */ -#define WT_STAT_CONN_PAGE_READ_BLOCKED 1189 +#define WT_STAT_CONN_PAGE_READ_BLOCKED 1191 /*! thread-yield: page acquire time sleeping (usecs) */ -#define WT_STAT_CONN_PAGE_SLEEP 1190 +#define WT_STAT_CONN_PAGE_SLEEP 1192 /*! transaction: number of named snapshots created */ -#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1191 +#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1193 /*! transaction: number of named snapshots dropped */ -#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1192 +#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1194 /*! transaction: transaction begins */ -#define WT_STAT_CONN_TXN_BEGIN 1193 +#define WT_STAT_CONN_TXN_BEGIN 1195 /*! transaction: transaction checkpoint currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1194 +#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1196 /*! transaction: transaction checkpoint generation */ -#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1195 +#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1197 /*! transaction: transaction checkpoint max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1196 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1198 /*! transaction: transaction checkpoint min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1197 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1199 /*! transaction: transaction checkpoint most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1198 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1200 /*! transaction: transaction checkpoint scrub dirty target */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1199 +#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1201 /*! transaction: transaction checkpoint scrub time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1200 +#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1202 /*! transaction: transaction checkpoint total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1201 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1203 /*! transaction: transaction checkpoints */ -#define WT_STAT_CONN_TXN_CHECKPOINT 1202 +#define WT_STAT_CONN_TXN_CHECKPOINT 1204 /*! transaction: transaction failures due to cache overflow */ -#define WT_STAT_CONN_TXN_FAIL_CACHE 1203 +#define WT_STAT_CONN_TXN_FAIL_CACHE 1205 /*! * transaction: transaction fsync calls for checkpoint after allocating * the transaction ID */ -#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1204 +#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1206 /*! * transaction: transaction fsync duration for checkpoint after * allocating the transaction ID (usecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1205 +#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1207 /*! transaction: transaction range of IDs currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_RANGE 1206 +#define WT_STAT_CONN_TXN_PINNED_RANGE 1208 /*! transaction: transaction range of IDs currently pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1207 +#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1209 /*! * transaction: transaction range of IDs currently pinned by named * snapshots */ -#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1208 +#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1210 /*! transaction: transaction sync calls */ -#define WT_STAT_CONN_TXN_SYNC 1209 +#define WT_STAT_CONN_TXN_SYNC 1211 /*! transaction: transactions committed */ -#define WT_STAT_CONN_TXN_COMMIT 1210 +#define WT_STAT_CONN_TXN_COMMIT 1212 /*! transaction: transactions rolled back */ -#define WT_STAT_CONN_TXN_ROLLBACK 1211 +#define WT_STAT_CONN_TXN_ROLLBACK 1213 /*! * @} diff --git a/src/log/log.c b/src/log/log.c index b17f31d5d16..b0c789f0f9e 100644 --- a/src/log/log.c +++ b/src/log/log.c @@ -133,8 +133,8 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn) WT_ERR(__wt_epoch(session, &fsync_stop)); fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start); log->sync_dir_lsn = *min_lsn; - WT_STAT_FAST_CONN_INCR(session, log_sync_dir); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCR(session, log_sync_dir); + WT_STAT_CONN_INCRV(session, log_sync_dir_duration, fsync_duration_usecs); } /* @@ -157,8 +157,8 @@ __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn) WT_ERR(__wt_epoch(session, &fsync_stop)); fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start); log->sync_lsn = *min_lsn; - WT_STAT_FAST_CONN_INCR(session, log_sync); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCR(session, log_sync); + WT_STAT_CONN_INCRV(session, log_sync_duration, fsync_duration_usecs); WT_ERR(__wt_close(session, &log_fh)); __wt_cond_signal(session, log->log_sync_cond); @@ -410,7 +410,7 @@ __log_zero(WT_SESSION_IMPL *session, bufsz = (uint32_t)conn->log_file_max; WT_RET(__wt_scr_alloc(session, bufsz, &zerobuf)); memset(zerobuf->mem, 0, zerobuf->memsize); - WT_STAT_FAST_CONN_INCR(session, log_zero_fills); + WT_STAT_CONN_INCR(session, log_zero_fills); /* * Read in a chunk starting at the end of the file. Keep going until @@ -580,7 +580,7 @@ __log_fill(WT_SESSION_IMPL *session, myslot->offset + myslot->slot->slot_start_offset, record->size, record->mem)); - WT_STAT_FAST_CONN_INCRV(session, log_bytes_written, record->size); + WT_STAT_CONN_INCRV(session, log_bytes_written, record->size); if (lsnp != NULL) { *lsnp = myslot->slot->slot_start_lsn; lsnp->l.offset += (uint32_t)myslot->offset; @@ -774,7 +774,7 @@ __log_alloc_prealloc(WT_SESSION_IMPL *session, uint32_t to_num) __wt_verbose(session, WT_VERB_LOG, "log_alloc_prealloc: rename log %s to %s", (const char *)from_path->data, (const char *)to_path->data); - WT_STAT_FAST_CONN_INCR(session, log_prealloc_used); + WT_STAT_CONN_INCR(session, log_prealloc_used); /* * All file setup, writing the header and pre-allocation was done * before. We only need to rename it. @@ -813,7 +813,7 @@ __log_newfile(WT_SESSION_IMPL *session, bool conn_open, bool *created) */ WT_ASSERT(session, F_ISSET(session, WT_SESSION_LOCKED_SLOT)); for (yield_cnt = 0; log->log_close_fh != NULL;) { - WT_STAT_FAST_CONN_INCR(session, log_close_yields); + WT_STAT_CONN_INCR(session, log_close_yields); __wt_log_wrlsn(session, NULL); if (++yield_cnt > 10000) return (EBUSY); @@ -859,8 +859,7 @@ __log_newfile(WT_SESSION_IMPL *session, bool conn_open, bool *created) if (ret == 0) create_log = false; else { - WT_STAT_FAST_CONN_INCR( - session, log_prealloc_missed); + WT_STAT_CONN_INCR(session, log_prealloc_missed); if (conn->log_cond != NULL) __wt_cond_auto_signal( session, conn->log_cond); @@ -1411,7 +1410,7 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) * Wait for earlier groups to finish, otherwise there could * be holes in the log file. */ - WT_STAT_FAST_CONN_INCR(session, log_release_write_lsn); + WT_STAT_CONN_INCR(session, log_release_write_lsn); while (__wt_log_cmp(&log->write_lsn, &slot->slot_release_lsn) != 0) { /* * If we're on a locked path and the write LSN is not advancing, @@ -1485,8 +1484,8 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start); log->sync_dir_lsn = sync_lsn; - WT_STAT_FAST_CONN_INCR(session, log_sync_dir); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCR(session, log_sync_dir); + WT_STAT_CONN_INCRV(session, log_sync_dir_duration, fsync_duration_usecs); } @@ -1500,13 +1499,13 @@ __wt_log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, bool *freep) "/%" PRIu32, log->log_fh->name, sync_lsn.l.file, sync_lsn.l.offset); - WT_STAT_FAST_CONN_INCR(session, log_sync); + WT_STAT_CONN_INCR(session, log_sync); WT_ERR(__wt_epoch(session, &fsync_start)); WT_ERR(__wt_fsync(session, log->log_fh, true)); WT_ERR(__wt_epoch(session, &fsync_stop)); fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, log_sync_duration, fsync_duration_usecs); log->sync_lsn = sync_lsn; __wt_cond_signal(session, log->log_sync_cond); @@ -1745,7 +1744,7 @@ advance: WT_ERR(__wt_buf_grow(session, buf, rdup_len)); WT_ERR(__wt_read(session, log_fh, rd_lsn.l.offset, (size_t)rdup_len, buf->mem)); - WT_STAT_FAST_CONN_INCR(session, log_scan_rereads); + WT_STAT_CONN_INCR(session, log_scan_rereads); } /* * We read in the record, verify checksum. @@ -1787,7 +1786,7 @@ advance: * We have a valid log record. If it is not the log file * header, invoke the callback. */ - WT_STAT_FAST_CONN_INCR(session, log_scan_records); + WT_STAT_CONN_INCR(session, log_scan_records); next_lsn = rd_lsn; next_lsn.l.offset += rdup_len; if (rd_lsn.l.offset != 0) { @@ -1828,7 +1827,7 @@ advance: WT_ERR(__log_truncate(session, &rd_lsn, WT_LOG_FILENAME, 0)); -err: WT_STAT_FAST_CONN_INCR(session, log_scans); +err: WT_STAT_CONN_INCR(session, log_scans); /* * If the first attempt to read a log record results in * an error recovery is likely going to fail. Try to provide @@ -1875,13 +1874,13 @@ __wt_log_force_write(WT_SESSION_IMPL *session, bool retry, bool *did_work) log = S2C(session)->log; memset(&myslot, 0, sizeof(myslot)); - WT_STAT_FAST_CONN_INCR(session, log_force_write); + WT_STAT_CONN_INCR(session, log_force_write); if (did_work != NULL) *did_work = true; myslot.slot = log->active_slot; joined = WT_LOG_SLOT_JOINED(log->active_slot->slot_state); if (joined == 0) { - WT_STAT_FAST_CONN_INCR(session, log_force_write_skip); + WT_STAT_CONN_INCR(session, log_force_write_skip); if (did_work != NULL) *did_work = false; return (0); @@ -1923,7 +1922,7 @@ __wt_log_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, ip = record; if ((compressor = conn->log_compressor) != NULL && record->size < log->allocsize) { - WT_STAT_FAST_CONN_INCR(session, log_compress_small); + WT_STAT_CONN_INCR(session, log_compress_small); } else if (compressor != NULL) { /* Skip the log header */ src = (uint8_t *)record->mem + WT_LOG_COMPRESS_SKIP; @@ -1968,13 +1967,13 @@ __wt_log_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, if (compression_failed || result_len / log->allocsize >= record->size / log->allocsize) - WT_STAT_FAST_CONN_INCR(session, + WT_STAT_CONN_INCR(session, log_compress_write_fails); else { - WT_STAT_FAST_CONN_INCR(session, log_compress_writes); - WT_STAT_FAST_CONN_INCRV(session, log_compress_mem, + WT_STAT_CONN_INCR(session, log_compress_writes); + WT_STAT_CONN_INCRV(session, log_compress_mem, record->size); - WT_STAT_FAST_CONN_INCRV(session, log_compress_len, + WT_STAT_CONN_INCRV(session, log_compress_len, result_len); /* @@ -2056,7 +2055,7 @@ __log_write_internal(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, * that we can write the full amount. Do this whether or not * direct_io is in use because it makes the reading code cleaner. */ - WT_STAT_FAST_CONN_INCRV(session, log_bytes_payload, record->size); + WT_STAT_CONN_INCRV(session, log_bytes_payload, record->size); rdup_len = __wt_rduppo2((uint32_t)record->size, log->allocsize); WT_ERR(__wt_buf_grow(session, record, rdup_len)); WT_ASSERT(session, record->data == record->mem); @@ -2083,7 +2082,7 @@ __log_write_internal(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, logrec->checksum = __wt_bswap32(logrec->checksum); #endif - WT_STAT_FAST_CONN_INCR(session, log_writes); + WT_STAT_CONN_INCR(session, log_writes); __wt_log_slot_join(session, rdup_len, flags, &myslot); /* diff --git a/src/log/log_slot.c b/src/log/log_slot.c index 58377aff6f5..c79805f5371 100644 --- a/src/log/log_slot.c +++ b/src/log/log_slot.c @@ -90,7 +90,7 @@ retry: * We own the slot now. No one else can join. * Set the end LSN. */ - WT_STAT_FAST_CONN_INCR(session, log_slot_closes); + WT_STAT_CONN_INCR(session, log_slot_closes); if (WT_LOG_SLOT_DONE(new_state)) *releasep = 1; slot->slot_end_lsn = slot->slot_start_lsn; @@ -108,7 +108,7 @@ retry: end_offset = WT_LOG_SLOT_JOINED_BUFFERED(old_state) + slot->slot_unbuffered; slot->slot_end_lsn.l.offset += (uint32_t)end_offset; - WT_STAT_FAST_CONN_INCRV(session, log_slot_consolidated, end_offset); + WT_STAT_CONN_INCRV(session, log_slot_consolidated, end_offset); /* * XXX Would like to change so one piece of code advances the LSN. */ @@ -200,7 +200,7 @@ __wt_log_slot_switch( WT_WITH_SLOT_LOCK(session, log, ret, ret = __log_slot_switch_internal(session, myslot, forced)); if (ret == EBUSY) { - WT_STAT_FAST_CONN_INCR(session, log_slot_switch_busy); + WT_STAT_CONN_INCR(session, log_slot_switch_busy); __wt_yield(); } } while (F_ISSET(myslot, WT_MYSLOT_CLOSE) || (retry && ret == EBUSY)); @@ -253,7 +253,7 @@ __wt_log_slot_new(WT_SESSION_IMPL *session) * We have a new, initialized slot to use. * Set it as the active slot. */ - WT_STAT_FAST_CONN_INCR(session, + WT_STAT_CONN_INCR(session, log_slot_transitions); log->active_slot = slot; return (0); @@ -303,7 +303,7 @@ __wt_log_slot_init(WT_SESSION_IMPL *session) &log->slot_pool[i].slot_buf, log->slot_buf_size)); F_SET(&log->slot_pool[i], WT_SLOT_INIT_FLAGS); } - WT_STAT_FAST_CONN_SET(session, + WT_STAT_CONN_SET(session, log_buffer_size, log->slot_buf_size * WT_SLOT_POOL); /* * Set up the available slot from the pool the first time. @@ -428,7 +428,7 @@ __wt_log_slot_join(WT_SESSION_IMPL *session, uint64_t mysize, * The slot is no longer open or we lost the race to * update it. Yield and try again. */ - WT_STAT_FAST_CONN_INCR(session, log_slot_races); + WT_STAT_CONN_INCR(session, log_slot_races); __wt_yield(); } /* @@ -436,7 +436,7 @@ __wt_log_slot_join(WT_SESSION_IMPL *session, uint64_t mysize, * the caller. */ if (mysize != 0) - WT_STAT_FAST_CONN_INCR(session, log_slot_joins); + WT_STAT_CONN_INCR(session, log_slot_joins); if (LF_ISSET(WT_LOG_DSYNC | WT_LOG_FSYNC)) F_SET(slot, WT_SLOT_SYNC_DIR); if (LF_ISSET(WT_LOG_FLUSH)) @@ -445,7 +445,7 @@ __wt_log_slot_join(WT_SESSION_IMPL *session, uint64_t mysize, F_SET(slot, WT_SLOT_SYNC); if (F_ISSET(myslot, WT_MYSLOT_UNBUFFERED)) { WT_ASSERT(session, slot->slot_unbuffered == 0); - WT_STAT_FAST_CONN_INCR(session, log_slot_unbuffered); + WT_STAT_CONN_INCR(session, log_slot_unbuffered); slot->slot_unbuffered = (int64_t)mysize; } myslot->slot = slot; diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c index bf591d8dbe6..e98f59e7b05 100644 --- a/src/lsm/lsm_cursor.c +++ b/src/lsm/lsm_cursor.c @@ -668,7 +668,7 @@ retry: if (F_ISSET(clsm, WT_CLSM_MERGE)) { clsm->dsk_gen = lsm_tree->dsk_gen; -err: +err: #ifdef HAVE_DIAGNOSTIC /* Check that all cursors are open as expected. */ if (ret == 0 && F_ISSET(clsm, WT_CLSM_OPEN_READ)) { @@ -1348,11 +1348,11 @@ __clsm_put(WT_SESSION_IMPL *session, WT_CURSOR_LSM *clsm, clsm->update_count = 0; WT_LSM_TREE_STAT_INCRV(session, lsm_tree->lsm_checkpoint_throttle, lsm_tree->ckpt_throttle); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, lsm_checkpoint_throttle, lsm_tree->ckpt_throttle); WT_LSM_TREE_STAT_INCRV(session, lsm_tree->lsm_merge_throttle, lsm_tree->merge_throttle); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, lsm_merge_throttle, lsm_tree->merge_throttle); __wt_sleep(0, lsm_tree->ckpt_throttle + lsm_tree->merge_throttle); diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c index a504acc361c..5a5140b9c3a 100644 --- a/src/lsm/lsm_manager.c +++ b/src/lsm/lsm_manager.c @@ -328,7 +328,7 @@ __wt_lsm_manager_destroy(WT_SESSION_IMPL *session) WT_TRET(wt_session->close(wt_session, NULL)); } } - WT_STAT_FAST_CONN_INCRV(session, lsm_work_units_discarded, removed); + WT_STAT_CONN_INCRV(session, lsm_work_units_discarded, removed); /* Free resources that are allocated in connection initialize */ __wt_spin_destroy(session, &manager->switch_lock); @@ -413,7 +413,7 @@ __lsm_manager_run_server(WT_SESSION_IMPL *session) * more. */ if (lsm_tree->queue_ref >= LSM_TREE_MAX_QUEUE) - WT_STAT_FAST_CONN_INCR(session, + WT_STAT_CONN_INCR(session, lsm_work_queue_max); else if ((!lsm_tree->modified && lsm_tree->nchunks > 1) || @@ -539,7 +539,7 @@ __wt_lsm_manager_clear_tree(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) __wt_lsm_manager_free_work_unit(session, current); } __wt_spin_unlock(session, &manager->manager_lock); - WT_STAT_FAST_CONN_INCRV(session, lsm_work_units_discarded, removed); + WT_STAT_CONN_INCRV(session, lsm_work_units_discarded, removed); } /* @@ -554,7 +554,7 @@ __wt_lsm_manager_clear_tree(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) TAILQ_FOREACH(entry, (qh), q) { \ if (FLD_ISSET(type, entry->type)) { \ TAILQ_REMOVE(qh, entry, q); \ - WT_STAT_FAST_CONN_DECR(session, qlen); \ + WT_STAT_CONN_DECR(session, qlen); \ break; \ } \ } \ @@ -590,7 +590,7 @@ __wt_lsm_manager_pop_entry( LSM_POP_ENTRY(&manager->appqh, &manager->app_lock, lsm_work_queue_app); if (entry != NULL) - WT_STAT_FAST_CONN_INCR(session, lsm_work_units_done); + WT_STAT_CONN_INCR(session, lsm_work_units_done); *entryp = entry; return (0); } @@ -603,7 +603,7 @@ __wt_lsm_manager_pop_entry( #define LSM_PUSH_ENTRY(qh, qlock, qlen) do { \ __wt_spin_lock(session, qlock); \ TAILQ_INSERT_TAIL((qh), entry, q); \ - WT_STAT_FAST_CONN_INCR(session, qlen); \ + WT_STAT_CONN_INCR(session, qlen); \ __wt_spin_unlock(session, qlock); \ } while (0) @@ -656,7 +656,7 @@ __wt_lsm_manager_push_entry(WT_SESSION_IMPL *session, entry->type = type; entry->flags = flags; entry->lsm_tree = lsm_tree; - WT_STAT_FAST_CONN_INCR(session, lsm_work_units_created); + WT_STAT_CONN_INCR(session, lsm_work_units_created); if (type == WT_LSM_WORK_SWITCH) LSM_PUSH_ENTRY(&manager->switchqh, diff --git a/src/lsm/lsm_merge.c b/src/lsm/lsm_merge.c index 2276631af1e..4bbfcfd4411 100644 --- a/src/lsm/lsm_merge.c +++ b/src/lsm/lsm_merge.c @@ -461,7 +461,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) if (!lsm_tree->active) WT_ERR(EINTR); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, lsm_rows_merged, LSM_MERGE_CHECK_INTERVAL); ++lsm_tree->merge_progressing; } @@ -476,7 +476,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) } WT_ERR_NOTFOUND_OK(ret); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, lsm_rows_merged, insert_count % LSM_MERGE_CHECK_INTERVAL); ++lsm_tree->merge_progressing; __wt_verbose(session, WT_VERB_LSM, diff --git a/src/lsm/lsm_stat.c b/src/lsm/lsm_stat.c index 95909ce30e8..f4f5a0acce8 100644 --- a/src/lsm/lsm_stat.c +++ b/src/lsm/lsm_stat.c @@ -39,7 +39,7 @@ __curstat_lsm_init( WT_ERR(__wt_scr_alloc(session, 0, &uribuf)); /* Propagate all, fast and/or clear to the cursors we open. */ - if (!F_ISSET(cst, WT_CONN_STAT_NONE)) { + if (cst->flags != 0) { (void)snprintf(config, sizeof(config), "statistics=(%s%s%s%s)", F_ISSET(cst, WT_CONN_STAT_ALL) ? "all," : "", @@ -91,7 +91,8 @@ __curstat_lsm_init( * top-level. */ new = (WT_DSRC_STATS *)WT_CURSOR_STATS(stat_cursor); - WT_STAT_WRITE(new, lsm_generation_max, chunk->generation); + WT_STAT_WRITE(session, + new, lsm_generation_max, chunk->generation); /* Aggregate statistics from each new chunk. */ __wt_stat_dsrc_aggregate_single(new, stats); @@ -115,40 +116,41 @@ __curstat_lsm_init( * into the top-level. */ new = (WT_DSRC_STATS *)WT_CURSOR_STATS(stat_cursor); - WT_STAT_WRITE(new, bloom_size, + WT_STAT_WRITE(session, new, bloom_size, (int64_t)((chunk->count * lsm_tree->bloom_bit_count) / 8)); - WT_STAT_WRITE(new, bloom_page_evict, + WT_STAT_WRITE(session, new, bloom_page_evict, new->cache_eviction_clean + new->cache_eviction_dirty); - WT_STAT_WRITE(new, bloom_page_read, new->cache_read); + WT_STAT_WRITE(session, new, bloom_page_read, new->cache_read); __wt_stat_dsrc_aggregate_single(new, stats); WT_ERR(stat_cursor->close(stat_cursor)); } /* Set statistics that aren't aggregated directly into the cursor */ - WT_STAT_WRITE(stats, bloom_count, bloom_count); - WT_STAT_WRITE(stats, lsm_chunk_count, lsm_tree->nchunks); + WT_STAT_WRITE(session, stats, bloom_count, bloom_count); + WT_STAT_WRITE(session, stats, lsm_chunk_count, lsm_tree->nchunks); /* Include, and optionally clear, LSM-level specific information. */ - WT_STAT_WRITE(stats, bloom_miss, lsm_tree->bloom_miss); + WT_STAT_WRITE(session, stats, bloom_miss, lsm_tree->bloom_miss); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->bloom_miss = 0; - WT_STAT_WRITE(stats, bloom_hit, lsm_tree->bloom_hit); + WT_STAT_WRITE(session, stats, bloom_hit, lsm_tree->bloom_hit); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->bloom_hit = 0; - WT_STAT_WRITE( + WT_STAT_WRITE(session, stats, bloom_false_positive, lsm_tree->bloom_false_positive); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->bloom_false_positive = 0; - WT_STAT_WRITE( + WT_STAT_WRITE(session, stats, lsm_lookup_no_bloom, lsm_tree->lsm_lookup_no_bloom); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->lsm_lookup_no_bloom = 0; - WT_STAT_WRITE( + WT_STAT_WRITE(session, stats, lsm_checkpoint_throttle, lsm_tree->lsm_checkpoint_throttle); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->lsm_checkpoint_throttle = 0; - WT_STAT_WRITE(stats, lsm_merge_throttle, lsm_tree->lsm_merge_throttle); + WT_STAT_WRITE(session, + stats, lsm_merge_throttle, lsm_tree->lsm_merge_throttle); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->lsm_merge_throttle = 0; diff --git a/src/meta/meta_table.c b/src/meta/meta_table.c index 58842c756d1..76f4ef0c25f 100644 --- a/src/meta/meta_table.c +++ b/src/meta/meta_table.c @@ -54,7 +54,7 @@ __wt_metadata_cursor_open( */ btree = ((WT_CURSOR_BTREE *)(*cursorp))->btree; - /* + /* * Special settings for metadata: skew eviction so metadata almost * always stays in cache and make sure metadata is logged if possible. * diff --git a/src/os_common/os_alloc.c b/src/os_common/os_alloc.c index cfc7b80450e..bfe5efafc8b 100644 --- a/src/os_common/os_alloc.c +++ b/src/os_common/os_alloc.c @@ -46,7 +46,7 @@ __wt_calloc(WT_SESSION_IMPL *session, size_t number, size_t size, void *retp) WT_ASSERT(session, number != 0 && size != 0); if (session != NULL) - WT_STAT_FAST_CONN_INCR(session, memory_allocation); + WT_STAT_CONN_INCR(session, memory_allocation); if ((p = calloc(number, size)) == NULL) WT_RET_MSG(session, __wt_errno(), @@ -79,7 +79,7 @@ __wt_malloc(WT_SESSION_IMPL *session, size_t bytes_to_allocate, void *retp) WT_ASSERT(session, bytes_to_allocate != 0); if (session != NULL) - WT_STAT_FAST_CONN_INCR(session, memory_allocation); + WT_STAT_CONN_INCR(session, memory_allocation); if ((p = malloc(bytes_to_allocate)) == NULL) WT_RET_MSG(session, __wt_errno(), @@ -121,9 +121,9 @@ __realloc_func(WT_SESSION_IMPL *session, if (session != NULL) { if (p == NULL) - WT_STAT_FAST_CONN_INCR(session, memory_allocation); + WT_STAT_CONN_INCR(session, memory_allocation); else - WT_STAT_FAST_CONN_INCR(session, memory_grow); + WT_STAT_CONN_INCR(session, memory_grow); } if ((p = realloc(p, bytes_to_allocate)) == NULL) @@ -216,7 +216,7 @@ __wt_realloc_aligned(WT_SESSION_IMPL *session, bytes_to_allocate = WT_ALIGN(bytes_to_allocate, S2C(session)->buffer_alignment); - WT_STAT_FAST_CONN_INCR(session, memory_allocation); + WT_STAT_CONN_INCR(session, memory_allocation); if ((ret = posix_memalign(&newp, S2C(session)->buffer_alignment, @@ -302,7 +302,7 @@ __wt_free_int(WT_SESSION_IMPL *session, const void *p_arg) * This function MUST handle a NULL WT_SESSION_IMPL handle. */ if (session != NULL) - WT_STAT_FAST_CONN_INCR(session, memory_free); + WT_STAT_CONN_INCR(session, memory_free); free(p); } diff --git a/src/os_posix/os_mtx_cond.c b/src/os_posix/os_mtx_cond.c index 9f17d9ff381..b25bb8c25d1 100644 --- a/src/os_posix/os_mtx_cond.c +++ b/src/os_posix/os_mtx_cond.c @@ -57,7 +57,7 @@ __wt_cond_wait_signal( return; __wt_verbose(session, WT_VERB_MUTEX, "wait %s", cond->name); - WT_STAT_FAST_CONN_INCR(session, cond_wait); + WT_STAT_CONN_INCR(session, cond_wait); WT_ERR(pthread_mutex_lock(&cond->mtx)); locked = true; diff --git a/src/os_win/os_mtx_cond.c b/src/os_win/os_mtx_cond.c index 27207d289a6..41acec3ab4c 100644 --- a/src/os_win/os_mtx_cond.c +++ b/src/os_win/os_mtx_cond.c @@ -54,7 +54,7 @@ __wt_cond_wait_signal( return; __wt_verbose(session, WT_VERB_MUTEX, "wait %s", cond->name); - WT_STAT_FAST_CONN_INCR(session, cond_wait); + WT_STAT_CONN_INCR(session, cond_wait); EnterCriticalSection(&cond->mtx); locked = true; diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c index a9912628942..9c38c535301 100644 --- a/src/reconcile/rec_write.c +++ b/src/reconcile/rec_write.c @@ -435,19 +435,19 @@ __wt_reconcile(WT_SESSION_IMPL *session, __wt_writeunlock(session, &page->page_lock); /* Update statistics. */ - WT_STAT_FAST_CONN_INCR(session, rec_pages); - WT_STAT_FAST_DATA_INCR(session, rec_pages); + WT_STAT_CONN_INCR(session, rec_pages); + WT_STAT_DATA_INCR(session, rec_pages); if (LF_ISSET(WT_EVICTING)) { - WT_STAT_FAST_CONN_INCR(session, rec_pages_eviction); - WT_STAT_FAST_DATA_INCR(session, rec_pages_eviction); + WT_STAT_CONN_INCR(session, rec_pages_eviction); + WT_STAT_DATA_INCR(session, rec_pages_eviction); } if (r->cache_write_lookaside) { - WT_STAT_FAST_CONN_INCR(session, cache_write_lookaside); - WT_STAT_FAST_DATA_INCR(session, cache_write_lookaside); + WT_STAT_CONN_INCR(session, cache_write_lookaside); + WT_STAT_DATA_INCR(session, cache_write_lookaside); } if (r->cache_write_restore) { - WT_STAT_FAST_CONN_INCR(session, cache_write_restore); - WT_STAT_FAST_DATA_INCR(session, cache_write_restore); + WT_STAT_CONN_INCR(session, cache_write_restore); + WT_STAT_DATA_INCR(session, cache_write_restore); } /* @@ -2273,7 +2273,7 @@ __rec_split_row_promote( for (cnt = 1; len > 0; ++cnt, --len, ++pa, ++pb) if (*pa != *pb) { if (size != cnt) { - WT_STAT_FAST_DATA_INCRV(session, + WT_STAT_DATA_INCRV(session, rec_suffix_compression, size - cnt); size = cnt; } @@ -2726,7 +2726,7 @@ __rec_split_raw_worker(WT_SESSION_IMPL *session, * we were successful and have a block to write. */ if (result_slots == 0) { - WT_STAT_FAST_DATA_INCR(session, compress_raw_fail); + WT_STAT_DATA_INCR(session, compress_raw_fail); /* * If there are no more rows, we can write the original @@ -2755,7 +2755,7 @@ __rec_split_raw_worker(WT_SESSION_IMPL *session, */ last->already_compressed = false; } else { - WT_STAT_FAST_DATA_INCR(session, compress_raw_ok); + WT_STAT_DATA_INCR(session, compress_raw_ok); /* * If there are more rows and the compression function @@ -2873,7 +2873,7 @@ no_slots: * Compression failed and there are no more rows to accumulate, * write the original buffer instead. */ - WT_STAT_FAST_DATA_INCR(session, compress_raw_fail); + WT_STAT_DATA_INCR(session, compress_raw_fail); dsk->recno = last->recno; dsk->mem_size = WT_PTRDIFF32(r->first_free, dsk); @@ -2892,7 +2892,7 @@ no_slots: * compression function wants to try again; increase the size of * the "page" and try again after we accumulate some more rows. */ - WT_STAT_FAST_DATA_INCR(session, compress_raw_fail_temporary); + WT_STAT_DATA_INCR(session, compress_raw_fail_temporary); goto split_grow; } @@ -3323,7 +3323,7 @@ supd_check_complete: multi->addr.reuse = 1; bnd->addr = multi->addr; - WT_STAT_FAST_DATA_INCR(session, rec_page_match); + WT_STAT_DATA_INCR(session, rec_page_match); goto copy_image; } } @@ -5644,8 +5644,8 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) case 0: /* Page delete */ __wt_verbose( session, WT_VERB_RECONCILE, "page %p empty", (void *)page); - WT_STAT_FAST_CONN_INCR(session, rec_page_delete); - WT_STAT_FAST_DATA_INCR(session, rec_page_delete); + WT_STAT_CONN_INCR(session, rec_page_delete); + WT_STAT_DATA_INCR(session, rec_page_delete); /* If this is the root page, we need to create a sync point. */ ref = r->ref; @@ -5710,13 +5710,12 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) switch (page->type) { case WT_PAGE_COL_INT: case WT_PAGE_ROW_INT: - WT_STAT_FAST_DATA_INCR( - session, rec_multiblock_internal); + WT_STAT_DATA_INCR(session, rec_multiblock_internal); break; case WT_PAGE_COL_FIX: case WT_PAGE_COL_VAR: case WT_PAGE_ROW_LEAF: - WT_STAT_FAST_DATA_INCR(session, rec_multiblock_leaf); + WT_STAT_DATA_INCR(session, rec_multiblock_leaf); break; WT_ILLEGAL_VALUE(session); } @@ -5728,7 +5727,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) /* Track the largest set of page-splits. */ if (r->bnd_next > r->bnd_next_max) { r->bnd_next_max = r->bnd_next; - WT_STAT_FAST_DATA_SET( + WT_STAT_DATA_SET( session, rec_multiblock_max, r->bnd_next_max); } @@ -5929,7 +5928,7 @@ __rec_cell_build_int_key(WT_SESSION_IMPL *session, /* Create an overflow object if the data won't fit. */ if (size > btree->maxintlkey) { - WT_STAT_FAST_DATA_INCR(session, rec_overflow_key_internal); + WT_STAT_DATA_INCR(session, rec_overflow_key_internal); *is_ovflp = true; return (__rec_cell_build_ovfl( @@ -6008,7 +6007,7 @@ __rec_cell_build_leaf_key(WT_SESSION_IMPL *session, if (pfx < btree->prefix_compression_min) pfx = 0; else - WT_STAT_FAST_DATA_INCRV( + WT_STAT_DATA_INCRV( session, rec_prefix_compression, pfx); } @@ -6029,7 +6028,7 @@ __rec_cell_build_leaf_key(WT_SESSION_IMPL *session, * object that was prefix compressed. */ if (pfx == 0) { - WT_STAT_FAST_DATA_INCR(session, rec_overflow_key_leaf); + WT_STAT_DATA_INCR(session, rec_overflow_key_leaf); *is_ovflp = true; return (__rec_cell_build_ovfl( @@ -6113,7 +6112,7 @@ __rec_cell_build_val(WT_SESSION_IMPL *session, /* Create an overflow object if the data won't fit. */ if (val->buf.size > btree->maxleafvalue) { - WT_STAT_FAST_DATA_INCR(session, rec_overflow_value); + WT_STAT_DATA_INCR(session, rec_overflow_value); return (__rec_cell_build_ovfl( session, r, val, WT_CELL_VALUE_OVFL, rle)); @@ -6356,7 +6355,7 @@ __rec_dictionary_lookup( WT_RET(__wt_cell_pack_data_match( dp->cell, &val->cell, val->buf.data, &match)); if (match) { - WT_STAT_FAST_DATA_INCR(session, rec_dictionary); + WT_STAT_DATA_INCR(session, rec_dictionary); *dpp = dp; return (0); } diff --git a/src/schema/schema_truncate.c b/src/schema/schema_truncate.c index d9a798b6ed8..563bafa8ffc 100644 --- a/src/schema/schema_truncate.c +++ b/src/schema/schema_truncate.c @@ -20,7 +20,7 @@ __truncate_table(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]) u_int i; WT_RET(__wt_schema_get_table(session, uri, strlen(uri), false, &table)); - WT_STAT_FAST_DATA_INCR(session, cursor_truncate); + WT_STAT_DATA_INCR(session, cursor_truncate); /* Truncate the column groups. */ for (i = 0; i < WT_COLGROUPS(table); i++) @@ -55,7 +55,7 @@ __truncate_dsrc(WT_SESSION_IMPL *session, const char *uri) while ((ret = cursor->next(cursor)) == 0) WT_ERR(cursor->remove(cursor)); WT_ERR_NOTFOUND_OK(ret); - WT_STAT_FAST_DATA_INCR(session, cursor_truncate); + WT_STAT_DATA_INCR(session, cursor_truncate); err: WT_TRET(cursor->close(cursor)); return (ret); diff --git a/src/session/session_api.c b/src/session/session_api.c index 82ce934c250..0d3fcad3184 100644 --- a/src/session/session_api.c +++ b/src/session/session_api.c @@ -203,7 +203,7 @@ __session_close(WT_SESSION *wt_session, const char *config) __wt_spin_lock(session, &conn->api_lock); /* Decrement the count of open sessions. */ - WT_STAT_FAST_CONN_DECR(session, session_open); + WT_STAT_CONN_DECR(session, session_open); /* * Sessions are re-used, clear the structure: the clear sets the active @@ -517,9 +517,9 @@ __session_create(WT_SESSION *wt_session, const char *uri, const char *config) ret = __wt_session_create(session, uri, config); err: if (ret != 0) - WT_STAT_FAST_CONN_INCR(session, session_table_create_fail); + WT_STAT_CONN_INCR(session, session_table_create_fail); else - WT_STAT_FAST_CONN_INCR(session, session_table_create_success); + WT_STAT_CONN_INCR(session, session_table_create_success); API_END_RET_NOTFOUND_MAP(session, ret); } @@ -540,7 +540,7 @@ __session_create_readonly( session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL_NOCONF(session, create); - WT_STAT_FAST_CONN_INCR(session, session_table_create_fail); + WT_STAT_CONN_INCR(session, session_table_create_fail); ret = __wt_session_notsup(session); err: API_END_RET(session, ret); } @@ -560,7 +560,7 @@ __session_log_flush(WT_SESSION *wt_session, const char *config) session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL(session, log_flush, config, cfg); - WT_STAT_FAST_CONN_INCR(session, log_flush); + WT_STAT_CONN_INCR(session, log_flush); conn = S2C(session); flags = 0; @@ -664,9 +664,9 @@ __session_rebalance(WT_SESSION *wt_session, const char *uri, const char *config) NULL, cfg, WT_DHANDLE_EXCLUSIVE | WT_BTREE_REBALANCE))); err: if (ret != 0) - WT_STAT_FAST_CONN_INCR(session, session_table_rebalance_fail); + WT_STAT_CONN_INCR(session, session_table_rebalance_fail); else - WT_STAT_FAST_CONN_INCR(session, + WT_STAT_CONN_INCR(session, session_table_rebalance_success); API_END_RET_NOTFOUND_MAP(session, ret); } @@ -688,7 +688,7 @@ __session_rebalance_readonly( session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL_NOCONF(session, rebalance); - WT_STAT_FAST_CONN_INCR(session, session_table_rebalance_fail); + WT_STAT_CONN_INCR(session, session_table_rebalance_fail); ret = __wt_session_notsup(session); err: API_END_RET(session, ret); } @@ -717,9 +717,9 @@ __session_rename(WT_SESSION *wt_session, ret = __wt_schema_rename(session, uri, newuri, cfg)))); err: if (ret != 0) - WT_STAT_FAST_CONN_INCR(session, session_table_rename_fail); + WT_STAT_CONN_INCR(session, session_table_rename_fail); else - WT_STAT_FAST_CONN_INCR(session, session_table_rename_success); + WT_STAT_CONN_INCR(session, session_table_rename_success); API_END_RET_NOTFOUND_MAP(session, ret); } @@ -741,7 +741,7 @@ __session_rename_readonly(WT_SESSION *wt_session, session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL_NOCONF(session, rename); - WT_STAT_FAST_CONN_INCR(session, session_table_rename_fail); + WT_STAT_CONN_INCR(session, session_table_rename_fail); ret = __wt_session_notsup(session); err: API_END_RET(session, ret); } @@ -829,9 +829,9 @@ __session_drop(WT_SESSION *wt_session, const char *uri, const char *config) ret = __wt_session_drop(session, uri, cfg); err: if (ret != 0) - WT_STAT_FAST_CONN_INCR(session, session_table_drop_fail); + WT_STAT_CONN_INCR(session, session_table_drop_fail); else - WT_STAT_FAST_CONN_INCR(session, session_table_drop_success); + WT_STAT_CONN_INCR(session, session_table_drop_success); /* Note: drop operations cannot be unrolled (yet?). */ API_END_RET_NOTFOUND_MAP(session, ret); @@ -854,7 +854,7 @@ __session_drop_readonly( session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL_NOCONF(session, drop); - WT_STAT_FAST_CONN_INCR(session, session_table_drop_fail); + WT_STAT_CONN_INCR(session, session_table_drop_fail); ret = __wt_session_notsup(session); err: API_END_RET(session, ret); } @@ -1015,9 +1015,9 @@ __session_salvage(WT_SESSION *wt_session, const char *uri, const char *config) NULL, cfg, WT_DHANDLE_EXCLUSIVE | WT_BTREE_SALVAGE))); err: if (ret != 0) - WT_STAT_FAST_CONN_INCR(session, session_table_salvage_fail); + WT_STAT_CONN_INCR(session, session_table_salvage_fail); else - WT_STAT_FAST_CONN_INCR(session, session_table_salvage_success); + WT_STAT_CONN_INCR(session, session_table_salvage_success); API_END_RET_NOTFOUND_MAP(session, ret); } @@ -1038,7 +1038,7 @@ __session_salvage_readonly( session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL_NOCONF(session, salvage); - WT_STAT_FAST_CONN_INCR(session, session_table_salvage_fail); + WT_STAT_CONN_INCR(session, session_table_salvage_fail); ret = __wt_session_notsup(session); err: API_END_RET(session, ret); } @@ -1172,7 +1172,7 @@ __session_truncate(WT_SESSION *wt_session, session = (WT_SESSION_IMPL *)wt_session; SESSION_TXN_API_CALL(session, truncate, config, cfg); - WT_STAT_FAST_CONN_INCR(session, cursor_truncate); + WT_STAT_CONN_INCR(session, cursor_truncate); /* * If the URI is specified, we don't need a start/stop, if start/stop @@ -1219,9 +1219,9 @@ __session_truncate(WT_SESSION *wt_session, err: TXN_API_END_RETRY(session, ret, 0); if (ret != 0) - WT_STAT_FAST_CONN_INCR(session, session_table_truncate_fail); + WT_STAT_CONN_INCR(session, session_table_truncate_fail); else - WT_STAT_FAST_CONN_INCR(session, session_table_truncate_success); + WT_STAT_CONN_INCR(session, session_table_truncate_success); /* * Only map WT_NOTFOUND to ENOENT if a URI was specified. */ @@ -1247,7 +1247,7 @@ __session_truncate_readonly(WT_SESSION *wt_session, session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL_NOCONF(session, truncate); - WT_STAT_FAST_CONN_INCR(session, session_table_truncate_fail); + WT_STAT_CONN_INCR(session, session_table_truncate_fail); ret = __wt_session_notsup(session); err: API_END_RET(session, ret); } @@ -1319,9 +1319,9 @@ __session_verify(WT_SESSION *wt_session, const char *uri, const char *config) NULL, cfg, WT_DHANDLE_EXCLUSIVE | WT_BTREE_VERIFY))); err: if (ret != 0) - WT_STAT_FAST_CONN_INCR(session, session_table_verify_fail); + WT_STAT_CONN_INCR(session, session_table_verify_fail); else - WT_STAT_FAST_CONN_INCR(session, session_table_verify_success); + WT_STAT_CONN_INCR(session, session_table_verify_success); API_END_RET_NOTFOUND_MAP(session, ret); } @@ -1337,7 +1337,7 @@ __session_begin_transaction(WT_SESSION *wt_session, const char *config) session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL(session, begin_transaction, config, cfg); - WT_STAT_FAST_CONN_INCR(session, txn_begin); + WT_STAT_CONN_INCR(session, txn_begin); if (F_ISSET(&session->txn, WT_TXN_RUNNING)) WT_ERR_MSG(session, EINVAL, "Transaction already running"); @@ -1360,7 +1360,7 @@ __session_commit_transaction(WT_SESSION *wt_session, const char *config) session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL(session, commit_transaction, config, cfg); - WT_STAT_FAST_CONN_INCR(session, txn_commit); + WT_STAT_CONN_INCR(session, txn_commit); txn = &session->txn; if (F_ISSET(txn, WT_TXN_ERROR) && txn->mod_count != 0) @@ -1389,7 +1389,7 @@ __session_rollback_transaction(WT_SESSION *wt_session, const char *config) session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL(session, rollback_transaction, config, cfg); - WT_STAT_FAST_CONN_INCR(session, txn_rollback); + WT_STAT_CONN_INCR(session, txn_rollback); WT_TRET(__wt_session_reset_cursors(session, false)); @@ -1449,7 +1449,7 @@ __session_transaction_sync(WT_SESSION *wt_session, const char *config) session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL(session, transaction_sync, config, cfg); - WT_STAT_FAST_CONN_INCR(session, txn_sync); + WT_STAT_CONN_INCR(session, txn_sync); conn = S2C(session); txn = &session->txn; @@ -1551,7 +1551,7 @@ __session_checkpoint(WT_SESSION *wt_session, const char *config) session = (WT_SESSION_IMPL *)wt_session; - WT_STAT_FAST_CONN_INCR(session, txn_checkpoint); + WT_STAT_CONN_INCR(session, txn_checkpoint); SESSION_API_CALL(session, checkpoint, config, cfg); if (F_ISSET(S2C(session), WT_CONN_IN_MEMORY)) @@ -1828,7 +1828,7 @@ __open_session(WT_CONNECTION_IMPL *conn, WT_STATIC_ASSERT(offsetof(WT_SESSION_IMPL, iface) == 0); *sessionp = session_ret; - WT_STAT_FAST_CONN_INCR(session, session_open); + WT_STAT_CONN_INCR(session, session_open); err: __wt_spin_unlock(session, &conn->api_lock); return (ret); diff --git a/src/session/session_compact.c b/src/session/session_compact.c index 47ed5298304..f03d5d34bac 100644 --- a/src/session/session_compact.c +++ b/src/session/session_compact.c @@ -334,9 +334,9 @@ err: session->compact = NULL; WT_TRET(__wt_session_release_resources(session)); if (ret != 0) - WT_STAT_FAST_CONN_INCR(session, session_table_compact_fail); + WT_STAT_CONN_INCR(session, session_table_compact_fail); else - WT_STAT_FAST_CONN_INCR(session, session_table_compact_success); + WT_STAT_CONN_INCR(session, session_table_compact_success); API_END_RET_NOTFOUND_MAP(session, ret); } @@ -357,7 +357,7 @@ __wt_session_compact_readonly( session = (WT_SESSION_IMPL *)wt_session; SESSION_API_CALL_NOCONF(session, compact); - WT_STAT_FAST_CONN_INCR(session, session_table_compact_fail); + WT_STAT_CONN_INCR(session, session_table_compact_fail); ret = __wt_session_notsup(session); err: API_END_RET(session, ret); } diff --git a/src/session/session_dhandle.c b/src/session/session_dhandle.c index a899bad1b1f..e76407567bc 100644 --- a/src/session/session_dhandle.c +++ b/src/session/session_dhandle.c @@ -390,7 +390,7 @@ __session_dhandle_sweep(WT_SESSION_IMPL *session) return (0); session->last_sweep = now; - WT_STAT_FAST_CONN_INCR(session, dh_session_sweeps); + WT_STAT_CONN_INCR(session, dh_session_sweeps); dhandle_cache = TAILQ_FIRST(&session->dhandles); while (dhandle_cache != NULL) { @@ -402,7 +402,7 @@ __session_dhandle_sweep(WT_SESSION_IMPL *session) (dhandle->timeofdeath != 0 && difftime(now, dhandle->timeofdeath) > conn->sweep_idle_time))) { - WT_STAT_FAST_CONN_INCR(session, dh_session_handles); + WT_STAT_CONN_INCR(session, dh_session_handles); WT_ASSERT(session, !WT_IS_METADATA(session, dhandle)); __session_discard_dhandle(session, dhandle_cache); } diff --git a/src/support/cond_auto.c b/src/support/cond_auto.c index 69114b066ae..a3ae67f5baa 100644 --- a/src/support/cond_auto.c +++ b/src/support/cond_auto.c @@ -85,7 +85,7 @@ __wt_cond_auto_wait_signal( */ WT_ASSERT(session, cond->min_wait != 0); - WT_STAT_FAST_CONN_INCR(session, cond_auto_wait); + WT_STAT_CONN_INCR(session, cond_auto_wait); if (progress) cond->prev_wait = cond->min_wait; else { @@ -97,7 +97,7 @@ __wt_cond_auto_wait_signal( __wt_cond_wait_signal(session, cond, cond->prev_wait, signalled); if (progress || *signalled) - WT_STAT_FAST_CONN_INCR(session, cond_auto_wait_reset); + WT_STAT_CONN_INCR(session, cond_auto_wait_reset); if (*signalled) cond->prev_wait = cond->min_wait; } diff --git a/src/support/mtx_rw.c b/src/support/mtx_rw.c index 0bdde81c32f..fefa346ac14 100644 --- a/src/support/mtx_rw.c +++ b/src/support/mtx_rw.c @@ -143,7 +143,7 @@ __wt_try_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) { wt_rwlock_t *l, new, old; - WT_STAT_FAST_CONN_INCR(session, rwlock_read); + WT_STAT_CONN_INCR(session, rwlock_read); l = &rwlock->rwlock; new = old = *l; @@ -177,7 +177,7 @@ __wt_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) uint16_t ticket; int pause_cnt; - WT_STAT_FAST_CONN_INCR(session, rwlock_read); + WT_STAT_CONN_INCR(session, rwlock_read); WT_DIAGNOSTIC_YIELD; @@ -247,7 +247,7 @@ __wt_try_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) { wt_rwlock_t *l, new, old; - WT_STAT_FAST_CONN_INCR(session, rwlock_write); + WT_STAT_CONN_INCR(session, rwlock_write); l = &rwlock->rwlock; old = new = *l; @@ -278,7 +278,7 @@ __wt_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) uint16_t ticket; int pause_cnt; - WT_STAT_FAST_CONN_INCR(session, rwlock_write); + WT_STAT_CONN_INCR(session, rwlock_write); l = &rwlock->rwlock; diff --git a/src/support/stat.c b/src/support/stat.c index 81859ef1ca8..7150223e6cb 100644 --- a/src/support/stat.c +++ b/src/support/stat.c @@ -559,12 +559,14 @@ static const char * const __stats_connection_desc[] = { "cache: eviction calls to get a page found queue empty", "cache: eviction calls to get a page found queue empty after locking", "cache: eviction currently operating in aggressive mode", + "cache: eviction empty score", "cache: eviction server candidate queue empty when topping up", "cache: eviction server candidate queue not empty when topping up", "cache: eviction server evicting pages", "cache: eviction server slept, because we did not make progress with eviction", "cache: eviction server unable to reach eviction goal", "cache: eviction state", + "cache: eviction walks abandoned", "cache: eviction worker thread evicting pages", "cache: failed eviction of pages that exceeded the in-memory maximum", "cache: files with active eviction walks", @@ -801,12 +803,14 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->cache_eviction_get_ref_empty = 0; stats->cache_eviction_get_ref_empty2 = 0; /* not clearing cache_eviction_aggressive_set */ + /* not clearing cache_eviction_empty_score */ stats->cache_eviction_queue_empty = 0; stats->cache_eviction_queue_not_empty = 0; stats->cache_eviction_server_evicting = 0; stats->cache_eviction_server_slept = 0; stats->cache_eviction_slow = 0; /* not clearing cache_eviction_state */ + stats->cache_eviction_walks_abandoned = 0; stats->cache_eviction_worker_evicting = 0; stats->cache_eviction_force_fail = 0; /* not clearing cache_eviction_walks_active */ @@ -1041,6 +1045,8 @@ __wt_stat_connection_aggregate( WT_STAT_READ(from, cache_eviction_get_ref_empty2); to->cache_eviction_aggressive_set += WT_STAT_READ(from, cache_eviction_aggressive_set); + to->cache_eviction_empty_score += + WT_STAT_READ(from, cache_eviction_empty_score); to->cache_eviction_queue_empty += WT_STAT_READ(from, cache_eviction_queue_empty); to->cache_eviction_queue_not_empty += @@ -1051,6 +1057,8 @@ __wt_stat_connection_aggregate( WT_STAT_READ(from, cache_eviction_server_slept); to->cache_eviction_slow += WT_STAT_READ(from, cache_eviction_slow); to->cache_eviction_state += WT_STAT_READ(from, cache_eviction_state); + to->cache_eviction_walks_abandoned += + WT_STAT_READ(from, cache_eviction_walks_abandoned); to->cache_eviction_worker_evicting += WT_STAT_READ(from, cache_eviction_worker_evicting); to->cache_eviction_force_fail += diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c index 91cee92b862..180a06a3aed 100644 --- a/src/txn/txn_ckpt.c +++ b/src/txn/txn_ckpt.c @@ -306,7 +306,7 @@ __checkpoint_update_generation(WT_SESSION_IMPL *session) WT_PUBLISH(btree->checkpoint_gen, S2C(session)->txn_global.checkpoint_gen); - WT_STAT_FAST_DATA_SET(session, + WT_STAT_DATA_SET(session, btree_checkpoint_generation, btree->checkpoint_gen); } @@ -424,14 +424,14 @@ __checkpoint_reduce_dirty_cache(WT_SESSION_IMPL *session) */ __wt_sleep(0, 10 * stepdown_us); cache->eviction_scrub_limit = current_dirty - delta; - WT_STAT_FAST_CONN_SET(session, txn_checkpoint_scrub_target, + WT_STAT_CONN_SET(session, txn_checkpoint_scrub_target, cache->eviction_scrub_limit); WT_RET(__wt_epoch(session, &last)); } WT_RET(__wt_epoch(session, &stop)); total_ms = WT_TIMEDIFF_MS(stop, start); - WT_STAT_FAST_CONN_SET(session, txn_checkpoint_scrub_time, total_ms); + WT_STAT_CONN_SET(session, txn_checkpoint_scrub_time, total_ms); return (0); } @@ -619,7 +619,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) * ignore the checkpoint's transaction. */ (void)__wt_atomic_addv64(&txn_global->checkpoint_gen, 1); - WT_STAT_FAST_CONN_SET(session, + WT_STAT_CONN_SET(session, txn_checkpoint_generation, txn_global->checkpoint_gen); /* Keep track of handles acquired for locking. */ @@ -705,7 +705,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) * after this point are too new to be written in the checkpoint. */ cache->eviction_scrub_limit = 0.0; - WT_STAT_FAST_CONN_SET(session, txn_checkpoint_scrub_target, 0); + WT_STAT_CONN_SET(session, txn_checkpoint_scrub_target, 0); /* * Mark old checkpoints that are being deleted and figure out which @@ -749,8 +749,8 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) WT_ERR(__checkpoint_apply(session, cfg, __wt_checkpoint_sync)); WT_ERR(__wt_epoch(session, &fsync_stop)); fsync_duration_usecs = WT_TIMEDIFF_US(fsync_stop, fsync_start); - WT_STAT_FAST_CONN_INCR(session, txn_checkpoint_fsync_post); - WT_STAT_FAST_CONN_SET(session, + WT_STAT_CONN_INCR(session, txn_checkpoint_fsync_post); + WT_STAT_CONN_SET(session, txn_checkpoint_fsync_post_duration, fsync_duration_usecs); WT_ERR(__checkpoint_verbose_track(session, @@ -829,7 +829,7 @@ err: /* WT_TRET(__wt_meta_track_off(session, false, ret != 0)); cache->eviction_scrub_limit = 0.0; - WT_STAT_FAST_CONN_SET(session, txn_checkpoint_scrub_target, 0); + WT_STAT_CONN_SET(session, txn_checkpoint_scrub_target, 0); if (F_ISSET(txn, WT_TXN_RUNNING)) { /* @@ -903,12 +903,12 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]) * calls checkpoint directly, it can be tough to avoid. Serialize here * to ensure we don't get into trouble. */ - WT_STAT_FAST_CONN_SET(session, txn_checkpoint_running, 1); + WT_STAT_CONN_SET(session, txn_checkpoint_running, 1); WT_WITH_CHECKPOINT_LOCK(session, ret, ret = __txn_checkpoint(session, cfg)); - WT_STAT_FAST_CONN_SET(session, txn_checkpoint_running, 0); + WT_STAT_CONN_SET(session, txn_checkpoint_running, 0); F_CLR(session, WT_SESSION_CAN_WAIT | WT_SESSION_NO_EVICTION); diff --git a/src/txn/txn_nsnap.c b/src/txn/txn_nsnap.c index d0110d9edd8..8f7e93238de 100644 --- a/src/txn/txn_nsnap.c +++ b/src/txn/txn_nsnap.c @@ -47,7 +47,7 @@ __nsnap_drop_one(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *name) TAILQ_NEXT(found, q)->snap_min : WT_TXN_NONE; TAILQ_REMOVE(&txn_global->nsnaph, found, q); __nsnap_destroy(session, found); - WT_STAT_FAST_CONN_INCR(session, txn_snapshots_dropped); + WT_STAT_CONN_INCR(session, txn_snapshots_dropped); return (ret); } @@ -112,7 +112,7 @@ __nsnap_drop_to(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *name, bool inclusive) WT_ASSERT(session, nsnap != NULL); TAILQ_REMOVE(&txn_global->nsnaph, nsnap, q); __nsnap_destroy(session, nsnap); - WT_STAT_FAST_CONN_INCR(session, txn_snapshots_dropped); + WT_STAT_CONN_INCR(session, txn_snapshots_dropped); /* Last will be NULL in the all case so it will never match */ } while (nsnap != last && !TAILQ_EMPTY(&txn_global->nsnaph)); @@ -178,7 +178,7 @@ __wt_txn_named_snapshot_begin(WT_SESSION_IMPL *session, const char *cfg[]) if (TAILQ_EMPTY(&txn_global->nsnaph)) txn_global->nsnap_oldest_id = nsnap_new->snap_min; TAILQ_INSERT_TAIL(&txn_global->nsnaph, nsnap_new, q); - WT_STAT_FAST_CONN_INCR(session, txn_snapshots_created); + WT_STAT_CONN_INCR(session, txn_snapshots_created); nsnap_new = NULL; err: if (started_txn) diff --git a/src/utilities/util_stat.c b/src/utilities/util_stat.c index e511ca4f7e8..4376f559ceb 100644 --- a/src/utilities/util_stat.c +++ b/src/utilities/util_stat.c @@ -70,7 +70,6 @@ util_stat(WT_SESSION *session, int argc, char *argv[]) } snprintf(uri, urilen, "statistics:%s", objname); - if ((ret = session->open_cursor(session, uri, NULL, config, &cursor)) != 0) { fprintf(stderr, "%s: cursor open(%s) failed: %s\n", |