diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2015-09-11 16:23:54 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2015-09-11 16:23:54 +1000 |
commit | 58c7ad85c90619d4fa0e7e4df3b9f4d643b9b73b (patch) | |
tree | 63cfbe95d22f14a3d3366d68976df0d739318e9c /src/third_party/wiredtiger/src/include | |
parent | 8b205afd0ae74fd7351bc183e39b8931044f3987 (diff) | |
download | mongo-58c7ad85c90619d4fa0e7e4df3b9f4d643b9b73b.tar.gz |
Import wiredtiger-wiredtiger-2.6.1-1056-g5205bb1.tar.gz from wiredtiger branch mongodb-3.2
Diffstat (limited to 'src/third_party/wiredtiger/src/include')
29 files changed, 762 insertions, 485 deletions
diff --git a/src/third_party/wiredtiger/src/include/bitstring.i b/src/third_party/wiredtiger/src/include/bitstring.i index c548c12761d..5449ffe6209 100644 --- a/src/third_party/wiredtiger/src/include/bitstring.i +++ b/src/third_party/wiredtiger/src/include/bitstring.i @@ -84,10 +84,10 @@ __bit_alloc(WT_SESSION_IMPL *session, uint64_t nbits, void *retp) * __bit_test -- * Test one bit in name. */ -static inline int +static inline bool __bit_test(uint8_t *bitf, uint64_t bit) { - return (bitf[__bit_byte(bit)] & __bit_mask(bit) ? 1 : 0); + return ((bitf[__bit_byte(bit)] & __bit_mask(bit)) != 0); } /* diff --git a/src/third_party/wiredtiger/src/include/btmem.h b/src/third_party/wiredtiger/src/include/btmem.h index 4aa2b1c7a7d..f214ddb1dc3 100644 --- a/src/third_party/wiredtiger/src/include/btmem.h +++ b/src/third_party/wiredtiger/src/include/btmem.h @@ -6,6 +6,8 @@ * See the file LICENSE for redistribution information. */ +#define WT_RECNO_OOB 0 /* Illegal record number */ + /* * WT_PAGE_HEADER -- * Blocks have a common header, a WT_PAGE_HEADER structure followed by a @@ -43,6 +45,7 @@ struct __wt_page_header { #define WT_PAGE_EMPTY_V_ALL 0x02 /* Page has all zero-length values */ #define WT_PAGE_EMPTY_V_NONE 0x04 /* Page has no zero-length values */ #define WT_PAGE_ENCRYPTED 0x08 /* Page is encrypted on disk */ +#define WT_PAGE_LAS_UPDATE 0x10 /* Page updates in lookaside store */ uint8_t flags; /* 25: flags */ /* @@ -168,6 +171,29 @@ struct __wt_ovfl_txnc { }; /* + * Lookaside table support: when a page is being reconciled for eviction and has + * updates that might be required by earlier readers in the system, the updates + * are written into a lookaside table, and restored as necessary if the page is + * read. The key is a unique marker for the page (a file ID plus an address), + * a counter (used to ensure the update records remain in the original order), + * the on-page item's transaction ID (so we can discard any update records from + * the lookaside table once the on-page item's transaction is globally visible), + * and the page key (byte-string for row-store, record number for column-store). + * The value is the WT_UPDATE structure's transaction ID, update size and value. + * + * As the key for the lookaside table is different for row- and column-store, we + * store both key types in a WT_ITEM, building/parsing them in the code, because + * otherwise we'd need two lookaside files with different key formats. We could + * make the lookaside table's key standard by moving the source key into the + * lookaside table value, but that doesn't make the coding any simpler, and it + * makes the lookaside table's value more likely to overflow the page size when + * the row-store key is relatively large. + */ +#define WT_LAS_FORMAT \ + "key_format=" WT_UNCHECKED_STRING(IuQQu) \ + ",value_format=" WT_UNCHECKED_STRING(QIu) + +/* * WT_PAGE_MODIFY -- * When a page is modified, there's additional information to maintain. */ @@ -238,15 +264,17 @@ struct __wt_page_modify { * Eviction, but block wasn't written: unresolved updates and * associated disk image. * - * Skipped updates are either a WT_INSERT, or a row-store leaf - * page entry. + * Saved updates are either a WT_INSERT, or a row-store leaf + * page entry; in the case of creating lookaside records, there + * is an additional value, the committed item's transaction ID. */ - struct __wt_upd_skipped { + struct __wt_save_upd { WT_INSERT *ins; WT_ROW *rip; - } *skip; - uint32_t skip_entries; - void *skip_dsk; + uint64_t onpage_txn; + } *supd; + uint32_t supd_entries; + void *supd_dsk; /* * Block was written: address, size and checksum. @@ -556,9 +584,8 @@ struct __wt_page { #define WT_PAGE_DISK_ALLOC 0x02 /* Disk image in allocated memory */ #define WT_PAGE_DISK_MAPPED 0x04 /* Disk image in mapped memory */ #define WT_PAGE_EVICT_LRU 0x08 /* Page is on the LRU queue */ -#define WT_PAGE_SCANNING 0x10 /* Obsolete updates are being scanned */ +#define WT_PAGE_RECONCILIATION 0x10 /* Page reconciliation lock */ #define WT_PAGE_SPLIT_INSERT 0x20 /* A leaf page was split for append */ -#define WT_PAGE_SPLIT_LOCKED 0x40 /* An internal page is growing */ uint8_t flags_atomic; /* Atomic flags, use F_*_ATOMIC */ /* @@ -869,8 +896,9 @@ WT_PACKED_STRUCT_BEGIN(__wt_update) * store 4GB objects; I'd rather do that than increase the size of this * structure for a flag bit. */ -#define WT_UPDATE_DELETED_ISSET(upd) ((upd)->size == UINT32_MAX) -#define WT_UPDATE_DELETED_SET(upd) ((upd)->size = UINT32_MAX) +#define WT_UPDATE_DELETED_VALUE UINT32_MAX +#define WT_UPDATE_DELETED_SET(upd) ((upd)->size = WT_UPDATE_DELETED_VALUE) +#define WT_UPDATE_DELETED_ISSET(upd) ((upd)->size == WT_UPDATE_DELETED_VALUE) uint32_t size; /* update length */ /* The untyped value immediately follows the WT_UPDATE structure. */ diff --git a/src/third_party/wiredtiger/src/include/btree.h b/src/third_party/wiredtiger/src/include/btree.h index deecd8f6d88..98ce4c22c10 100644 --- a/src/third_party/wiredtiger/src/include/btree.h +++ b/src/third_party/wiredtiger/src/include/btree.h @@ -146,12 +146,14 @@ struct __wt_btree { /* Flags values up to 0xff are reserved for WT_DHANDLE_* */ #define WT_BTREE_BULK 0x00100 /* Bulk-load handle */ #define WT_BTREE_IN_MEMORY 0x00200 /* Cache-resident object */ -#define WT_BTREE_NO_EVICTION 0x00400 /* Disable eviction */ -#define WT_BTREE_NO_LOGGING 0x00800 /* Disable logging */ -#define WT_BTREE_SALVAGE 0x01000 /* Handle is for salvage */ -#define WT_BTREE_SKIP_CKPT 0x02000 /* Handle skipped checkpoint */ -#define WT_BTREE_UPGRADE 0x04000 /* Handle is for upgrade */ -#define WT_BTREE_VERIFY 0x08000 /* Handle is for verify */ +#define WT_BTREE_LOOKASIDE 0x00400 /* Look-aside table */ +#define WT_BTREE_NO_CHECKPOINT 0x00800 /* Disable checkpoints */ +#define WT_BTREE_NO_EVICTION 0x01000 /* Disable eviction */ +#define WT_BTREE_NO_LOGGING 0x02000 /* Disable logging */ +#define WT_BTREE_SALVAGE 0x04000 /* Handle is for salvage */ +#define WT_BTREE_SKIP_CKPT 0x08000 /* Handle skipped checkpoint */ +#define WT_BTREE_UPGRADE 0x10000 /* Handle is for upgrade */ +#define WT_BTREE_VERIFY 0x20000 /* Handle is for verify */ uint32_t flags; }; diff --git a/src/third_party/wiredtiger/src/include/btree.i b/src/third_party/wiredtiger/src/include/btree.i index 058a00d5a78..b54cecb6ce0 100644 --- a/src/third_party/wiredtiger/src/include/btree.i +++ b/src/third_party/wiredtiger/src/include/btree.i @@ -10,17 +10,17 @@ * __wt_ref_is_root -- * Return if the page reference is for the root page. */ -static inline int +static inline bool __wt_ref_is_root(WT_REF *ref) { - return (ref->home == NULL ? 1 : 0); + return (ref->home == NULL); } /* * __wt_page_is_empty -- * Return if the page is empty. */ -static inline int +static inline bool __wt_page_is_empty(WT_PAGE *page) { return (page->modify != NULL && @@ -31,10 +31,10 @@ __wt_page_is_empty(WT_PAGE *page) * __wt_page_is_modified -- * Return if the page is dirty. */ -static inline int +static inline bool __wt_page_is_modified(WT_PAGE *page) { - return (page->modify != NULL && page->modify->write_gen != 0 ? 1 : 0); + return (page->modify != NULL && page->modify->write_gen != 0); } /* @@ -84,6 +84,9 @@ __wt_cache_decr_check_size( __wt_errx(session, "%s underflow: decrementing %" WT_SIZET_FMT, fld, v); first = 0; } +#else + WT_UNUSED(fld); + WT_UNUSED(session); #endif } @@ -109,6 +112,9 @@ __wt_cache_decr_check_uint64( __wt_errx(session, "%s underflow: decrementing %" WT_SIZET_FMT, fld, v); first = 0; } +#else + WT_UNUSED(fld); + WT_UNUSED(session); #endif } @@ -352,9 +358,13 @@ __wt_page_only_modify_set(WT_SESSION_IMPL *session, WT_PAGE *page) * have committed in the meantime, and the last_running field * been updated past it. That is all very unlikely, but not * impossible, so we take care to read the global state before - * the atomic increment. If we raced with reconciliation, just - * leave the previous value here: at worst, we will write a - * page in a checkpoint when not absolutely necessary. + * the atomic increment. + * + * If the page was dirty on entry, then last_running == 0. The + * page could have become clean since then, if reconciliation + * completed. In that case, we leave the previous value for + * first_dirty_txn rather than potentially racing to update it, + * at worst, we'll unnecessarily write a page in a checkpoint. */ if (last_running != 0) page->modify->first_dirty_txn = last_running; @@ -366,6 +376,25 @@ __wt_page_only_modify_set(WT_SESSION_IMPL *session, WT_PAGE *page) } /* + * __wt_page_modify_clear -- + * Clean a modified page. + */ +static inline void +__wt_page_modify_clear(WT_SESSION_IMPL *session, WT_PAGE *page) +{ + /* + * The page must be held exclusive when this call is made, this call + * can only be used when the page is owned by a single thread. + * + * Allow the call to be made on clean pages. + */ + if (__wt_page_is_modified(page)) { + page->modify->write_gen = 0; + __wt_cache_dirty_decr(session, page); + } +} + +/* * __wt_page_modify_set -- * Mark the page and tree dirty. */ @@ -385,6 +414,9 @@ __wt_page_modify_set(WT_SESSION_IMPL *session, WT_PAGE *page) * shouldn't cause problems; regardless, let's play it safe.) */ if (S2BT(session)->modified == 0) { + /* Assert we never dirty a checkpoint handle. */ + WT_ASSERT(session, session->dhandle->checkpoint == NULL); + S2BT(session)->modified = 1; WT_FULL_BARRIER(); } @@ -426,7 +458,7 @@ __wt_page_parent_modify_set( * __wt_off_page -- * Return if a pointer references off-page data. */ -static inline int +static inline bool __wt_off_page(WT_PAGE *page, const void *p) { /* @@ -527,7 +559,12 @@ __wt_ref_key_instantiated(WT_REF *ref) static inline void __wt_ref_key_clear(WT_REF *ref) { - /* The key union has 2 fields, both of which are 8B. */ + /* + * The key union has 2 8B fields; this is equivalent to: + * + * ref->key.recno = WT_RECNO_OOB; + * ref->key.ikey = NULL; + */ ref->key.recno = 0; } @@ -537,7 +574,7 @@ __wt_ref_key_clear(WT_REF *ref) * had without unpacking a cell, and information about the cell, if the key * isn't cheaply available. */ -static inline int +static inline bool __wt_row_leaf_key_info(WT_PAGE *page, void *copy, WT_IKEY **ikeyp, WT_CELL **cellp, void *datap, size_t *sizep) { @@ -628,7 +665,7 @@ __wt_row_leaf_key_info(WT_PAGE *page, void *copy, if (cellp != NULL) *cellp = WT_PAGE_REF_OFFSET(page, WT_CELL_DECODE_OFFSET(v)); - return (0); + return (false); case WT_K_FLAG: /* Encoded key: no instantiated key, no cell. */ if (cellp != NULL) @@ -639,9 +676,9 @@ __wt_row_leaf_key_info(WT_PAGE *page, void *copy, *(void **)datap = WT_PAGE_REF_OFFSET(page, WT_K_DECODE_KEY_OFFSET(v)); *sizep = WT_K_DECODE_KEY_LEN(v); - return (1); + return (true); } - return (0); + return (false); case WT_KV_FLAG: /* Encoded key/value pair: no instantiated key, no cell. */ if (cellp != NULL) @@ -652,9 +689,9 @@ __wt_row_leaf_key_info(WT_PAGE *page, void *copy, *(void **)datap = WT_PAGE_REF_OFFSET( page, WT_KV_DECODE_KEY_OFFSET(v)); *sizep = WT_KV_DECODE_KEY_LEN(v); - return (1); + return (true); } - return (0); + return (false); } @@ -667,9 +704,9 @@ __wt_row_leaf_key_info(WT_PAGE *page, void *copy, if (datap != NULL) { *(void **)datap = WT_IKEY_DATA(ikey); *sizep = ikey->size; - return (1); + return (true); } - return (0); + return (false); } /* @@ -857,7 +894,7 @@ __wt_row_leaf_value_cell(WT_PAGE *page, WT_ROW *rip, WT_CELL_UNPACK *kpack) * __wt_row_leaf_value -- * Return the value for a row-store leaf page encoded key/value pair. */ -static inline int +static inline bool __wt_row_leaf_value(WT_PAGE *page, WT_ROW *rip, WT_ITEM *value) { uintptr_t v; @@ -873,9 +910,9 @@ __wt_row_leaf_value(WT_PAGE *page, WT_ROW *rip, WT_ITEM *value) value->data = WT_PAGE_REF_OFFSET(page, WT_KV_DECODE_VALUE_OFFSET(v)); value->size = WT_KV_DECODE_VALUE_LEN(v); - return (1); + return (true); } - return (0); + return (false); } /* @@ -934,11 +971,13 @@ __wt_ref_info(WT_SESSION_IMPL *session, * __wt_page_can_split -- * Check whether a page can be split in memory. */ -static inline int +static inline bool __wt_page_can_split(WT_SESSION_IMPL *session, WT_PAGE *page) { WT_BTREE *btree; WT_INSERT_HEAD *ins_head; + WT_INSERT *ins; + int i; btree = S2BT(session); @@ -947,58 +986,54 @@ __wt_page_can_split(WT_SESSION_IMPL *session, WT_PAGE *page) * of the page could continually split without benefit. */ if (F_ISSET_ATOMIC(page, WT_PAGE_SPLIT_INSERT)) - return (0); + return (false); /* * Check for pages with append-only workloads. A common application * pattern is to have multiple threads frantically appending to the * tree. We want to reconcile and evict this page, but we'd like to - * do it without making the appending threads wait. If we're not - * discarding the tree, check and see if it's worth doing a split to - * let the threads continue before doing eviction. - * - * Ignore anything other than large, dirty row-store leaf pages. + * do it without making the appending threads wait. See if it's worth + * doing a split to let the threads continue before doing eviction. * - * XXX KEITH - * Need a better test for append-only workloads. + * Ignore anything other than large, dirty row-store leaf pages. The + * split code only supports row-store pages, and we depend on the page + * being dirty for correctness (the page must be reconciled again + * before being evicted after the split, information from a previous + * reconciliation will be wrong, so we can't evict immediately). */ if (page->type != WT_PAGE_ROW_LEAF || page->memory_footprint < btree->maxmempage || !__wt_page_is_modified(page)) - return (0); - - /* Don't split a page that is pending a multi-block split. */ - if (F_ISSET(page->modify, WT_PM_REC_MULTIBLOCK)) - return (0); + return (false); /* * There is no point splitting if the list is small, no deep items is - * our heuristic for that. (A 1/4 probability of adding a new skiplist - * level means there will be a new 6th level for roughly each 4KB of - * entries in the list. If we have at least two 6th level entries, the - * list is at least large enough to work with.) - * - * The following code requires at least two items on the insert list, - * this test serves the additional purpose of confirming that. + * our heuristic for that. A 1/4 probability of adding a new skiplist + * level, with level-0 always created, means there will be a 5th level + * entry for roughly every 1024 entries in the list. If there are at + * least 4 5th level entries (4K items), the list is large enough. */ -#define WT_MIN_SPLIT_SKIPLIST_DEPTH WT_MIN(6, WT_SKIP_MAXDEPTH - 1) +#define WT_MIN_SPLIT_SKIPLIST_DEPTH WT_MIN(5, WT_SKIP_MAXDEPTH - 1) ins_head = page->pg_row_entries == 0 ? WT_ROW_INSERT_SMALLEST(page) : WT_ROW_INSERT_SLOT(page, page->pg_row_entries - 1); - if (ins_head == NULL || - ins_head->head[WT_MIN_SPLIT_SKIPLIST_DEPTH] == NULL || - ins_head->head[WT_MIN_SPLIT_SKIPLIST_DEPTH] == - ins_head->tail[WT_MIN_SPLIT_SKIPLIST_DEPTH]) - return (0); - - return (1); + if (ins_head == NULL) + return (false); + for (i = 0, ins = ins_head->head[WT_MIN_SPLIT_SKIPLIST_DEPTH]; + ins != NULL; ins = ins->next[WT_MIN_SPLIT_SKIPLIST_DEPTH]) + if (++i == 4) { + WT_STAT_FAST_CONN_INCR(session, cache_inmem_splittable); + WT_STAT_FAST_DATA_INCR(session, cache_inmem_splittable); + return (true); + } + return (false); } /* * __wt_page_can_evict -- * Check whether a page can be evicted. */ -static inline int +static inline bool __wt_page_can_evict(WT_SESSION_IMPL *session, WT_PAGE *page, int check_splits, int *inmem_splitp) { @@ -1011,11 +1046,22 @@ __wt_page_can_evict(WT_SESSION_IMPL *session, btree = S2BT(session); mod = page->modify; - txn_global = &S2C(session)->txn_global; /* Pages that have never been modified can always be evicted. */ if (mod == NULL) - return (1); + return (true); + + /* + * Check for in-memory splits before other eviction tests. If the page + * should split in-memory, return success immediately and skip more + * detailed eviction tests. We don't need further tests since the page + * won't be written or discarded from the cache. + */ + if (__wt_page_can_split(session, page)) { + if (inmem_splitp != NULL) + *inmem_splitp = 1; + return (true); + } /* * If the tree was deepened, there's a requirement that newly created @@ -1028,20 +1074,7 @@ __wt_page_can_evict(WT_SESSION_IMPL *session, */ if (check_splits && WT_PAGE_IS_INTERNAL(page) && !__wt_txn_visible_all(session, mod->mod_split_txn)) - return (0); - - /* - * Allow for the splitting of pages when a checkpoint is underway only - * if the allow_splits flag has been passed, we know we are performing - * a checkpoint, the page is larger than the stated maximum and there - * has not already been a split on this page as the WT_PM_REC_MULTIBLOCK - * flag is unset. - */ - if (__wt_page_can_split(session, page)) { - if (inmem_splitp != NULL) - *inmem_splitp = 1; - return (1); - } + return (false); /* * If the file is being checkpointed, we can't evict dirty pages: @@ -1049,25 +1082,27 @@ __wt_page_can_evict(WT_SESSION_IMPL *session, * previous version might be referenced by an internal page already * been written in the checkpoint, leaving the checkpoint inconsistent. */ - if (btree->checkpointing && - (__wt_page_is_modified(page) || - F_ISSET(mod, WT_PM_REC_MULTIBLOCK))) { + if (btree->checkpointing && __wt_page_is_modified(page)) { WT_STAT_FAST_CONN_INCR(session, cache_eviction_checkpoint); WT_STAT_FAST_DATA_INCR(session, cache_eviction_checkpoint); - return (0); + return (false); } /* - * If the page was recently split in-memory, don't force it out: we - * hope an eviction thread will find it first. The check here is - * similar to __wt_txn_visible_all, but ignores the checkpoint's - * transaction. + * If the page was recently split in-memory, don't evict it immediately: + * we want to give application threads that are appending a chance to + * move to the new leaf page created by the split. + * + * Note the check here is similar to __wt_txn_visible_all, but ignores + * the checkpoint's transaction. */ - if (check_splits && - WT_TXNID_LE(txn_global->oldest_id, mod->inmem_split_txn)) - return (0); + if (check_splits) { + txn_global = &S2C(session)->txn_global; + if (WT_TXNID_LE(txn_global->oldest_id, mod->inmem_split_txn)) + return (false); + } - return (1); + return (true); } /* @@ -1100,7 +1135,7 @@ __wt_page_release_evict(WT_SESSION_IMPL *session, WT_REF *ref) (void)__wt_atomic_addv32(&btree->evict_busy, 1); too_big = (page->memory_footprint > btree->maxmempage) ? 1 : 0; - if ((ret = __wt_evict_page(session, ref)) == 0) { + if ((ret = __wt_evict(session, ref, 0)) == 0) { if (too_big) WT_STAT_FAST_CONN_INCR(session, cache_eviction_force); else @@ -1151,12 +1186,13 @@ __wt_page_release(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags) * memory_page_max setting, when we see many deleted items, and when we * are attempting to scan without trashing the cache. * - * Fast checks if eviction is disabled for this operation or this tree, - * then perform a general check if eviction will be possible. + * Fast checks if eviction is disabled for this handle, operation or + * tree, then perform a general check if eviction will be possible. */ page = ref->page; if (page->read_gen != WT_READGEN_OLDEST || LF_ISSET(WT_READ_NO_EVICT) || + F_ISSET(session, WT_SESSION_NO_EVICTION) || F_ISSET(btree, WT_BTREE_NO_EVICTION) || !__wt_page_can_evict(session, page, 1, NULL)) return (__wt_hazard_clear(session, page)); @@ -1272,13 +1308,13 @@ __wt_skip_choose_depth(WT_SESSION_IMPL *session) } /* - * __wt_btree_lsm_size -- + * __wt_btree_lsm_over_size -- * Return if the size of an in-memory tree with a single leaf page is over * a specified maximum. If called on anything other than a simple tree with a * single leaf page, returns true so our LSM caller will switch to a new tree. */ -static inline int -__wt_btree_lsm_size(WT_SESSION_IMPL *session, uint64_t maxsize) +static inline bool +__wt_btree_lsm_over_size(WT_SESSION_IMPL *session, uint64_t maxsize) { WT_BTREE *btree; WT_PAGE *child, *root; @@ -1290,20 +1326,20 @@ __wt_btree_lsm_size(WT_SESSION_IMPL *session, uint64_t maxsize) /* Check for a non-existent tree. */ if (root == NULL) - return (0); + return (false); /* A tree that can be evicted always requires a switch. */ if (!F_ISSET(btree, WT_BTREE_NO_EVICTION)) - return (1); + return (true); /* Check for a tree with a single leaf page. */ WT_INTL_INDEX_GET(session, root, pindex); if (pindex->entries != 1) /* > 1 child page, switch */ - return (1); + return (true); first = pindex->index[0]; if (first->state != WT_REF_MEM) /* no child page, ignore */ - return (0); + return (false); /* * We're reaching down into the page without a hazard pointer, but @@ -1312,7 +1348,7 @@ __wt_btree_lsm_size(WT_SESSION_IMPL *session, uint64_t maxsize) */ child = first->page; if (child->type != WT_PAGE_ROW_LEAF) /* not a single leaf page */ - return (1); + return (true); return (child->memory_footprint > maxsize); } diff --git a/src/third_party/wiredtiger/src/include/cache.h b/src/third_party/wiredtiger/src/include/cache.h index ed93f82538c..f98483a215f 100644 --- a/src/third_party/wiredtiger/src/include/cache.h +++ b/src/third_party/wiredtiger/src/include/cache.h @@ -18,11 +18,6 @@ #define WT_EVICT_WALK_BASE 300 /* Pages tracked across file visits */ #define WT_EVICT_WALK_INCR 100 /* Pages added each walk */ -#define WT_EVICT_PASS_AGGRESSIVE 0x01 -#define WT_EVICT_PASS_ALL 0x02 -#define WT_EVICT_PASS_DIRTY 0x04 -#define WT_EVICT_PASS_WOULD_BLOCK 0x08 - /* * WT_EVICT_ENTRY -- * Encapsulation of an eviction candidate. @@ -109,6 +104,7 @@ struct __wt_cache { * Cache pool information. */ uint64_t cp_pass_pressure; /* Calculated pressure from this pass */ + uint64_t cp_quota; /* Maximum size for this cache */ uint64_t cp_reserved; /* Base size for this cache */ WT_SESSION_IMPL *cp_session; /* May be used for cache management */ uint32_t cp_skip_count; /* Post change stabilization */ @@ -119,6 +115,15 @@ struct __wt_cache { uint64_t cp_saved_read; /* Read count at last review */ /* + * Work state. + */ +#define WT_EVICT_PASS_AGGRESSIVE 0x01 +#define WT_EVICT_PASS_ALL 0x02 +#define WT_EVICT_PASS_DIRTY 0x04 +#define WT_EVICT_PASS_WOULD_BLOCK 0x08 + uint32_t state; + + /* * Flags. */ #define WT_CACHE_POOL_MANAGER 0x01 /* The active cache pool manager */ @@ -140,6 +145,7 @@ struct __wt_cache_pool { const char *name; uint64_t size; uint64_t chunk; + uint64_t quota; uint64_t currently_used; uint32_t refs; /* Reference count for structure. */ /* Locked: List of connections participating in the cache pool. */ diff --git a/src/third_party/wiredtiger/src/include/cache.i b/src/third_party/wiredtiger/src/include/cache.i index 87f8c5543d1..bc33f82d927 100644 --- a/src/third_party/wiredtiger/src/include/cache.i +++ b/src/third_party/wiredtiger/src/include/cache.i @@ -104,48 +104,6 @@ __wt_cache_dirty_inuse(WT_CACHE *cache) } /* - * __wt_cache_status -- - * Return if the cache usage exceeds the eviction or dirty targets. - */ -static inline void -__wt_cache_status(WT_SESSION_IMPL *session, int *evictp, int *dirtyp) -{ - WT_CONNECTION_IMPL *conn; - WT_CACHE *cache; - uint64_t bytes_inuse, bytes_max, dirty_inuse; - - conn = S2C(session); - cache = conn->cache; - - /* - * There's an assumption "evict" overrides "dirty", that is, if eviction - * is required, we no longer care where we are with respect to the dirty - * target. - * - * Avoid division by zero if the cache size has not yet been set in a - * shared cache. - */ - bytes_max = conn->cache_size + 1; - if (evictp != NULL) { - bytes_inuse = __wt_cache_bytes_inuse(cache); - if (bytes_inuse > (cache->eviction_target * bytes_max) / 100) { - *evictp = 1; - return; - } - *evictp = 0; - } - if (dirtyp != NULL) { - dirty_inuse = __wt_cache_dirty_inuse(cache); - if (dirty_inuse > - (cache->eviction_dirty_target * bytes_max) / 100) { - *dirtyp = 1; - return; - } - *dirtyp = 0; - } -} - -/* * __wt_session_can_wait -- * Return if a session available for a potentially slow operation. */ @@ -161,29 +119,52 @@ __wt_session_can_wait(WT_SESSION_IMPL *session) return (0); /* - * LSM sets the no-cache-check flag when holding the LSM tree lock, + * LSM sets the no-eviction flag when holding the LSM tree lock, * in that case, or when holding the schema lock, we don't want to * highjack the thread for eviction. */ if (F_ISSET(session, - WT_SESSION_NO_CACHE_CHECK | WT_SESSION_LOCKED_SCHEMA)) + WT_SESSION_NO_EVICTION | WT_SESSION_LOCKED_SCHEMA)) return (0); return (1); } /* + * __wt_eviction_aggressive -- + * Return if the eviction server is running in aggressive mode. + */ +static inline int +__wt_eviction_aggressive(WT_SESSION_IMPL *session) +{ + return (FLD_ISSET( + S2C(session)->cache->state, WT_EVICT_PASS_AGGRESSIVE) ? 1 : 0); +} + +/* + * __wt_eviction_dirty_target -- + * Return if the eviction server is running to reduce the number of dirty + * pages (versus running to discard pages from the cache). + */ +static inline int +__wt_eviction_dirty_target(WT_SESSION_IMPL *session) +{ + return (FLD_ISSET( + S2C(session)->cache->state, WT_EVICT_PASS_DIRTY) ? 1 : 0); +} + +/* * __wt_eviction_needed -- * Return if an application thread should do eviction, and the cache full * percentage as a side-effect. */ -static inline int -__wt_eviction_needed(WT_SESSION_IMPL *session, int *pct_fullp) +static inline bool +__wt_eviction_needed(WT_SESSION_IMPL *session, u_int *pct_fullp) { WT_CONNECTION_IMPL *conn; WT_CACHE *cache; uint64_t bytes_inuse, bytes_max; - int pct_full; + u_int pct_full; conn = S2C(session); cache = conn->cache; @@ -196,25 +177,20 @@ __wt_eviction_needed(WT_SESSION_IMPL *session, int *pct_fullp) bytes_max = conn->cache_size + 1; /* - * Return the cache full percentage; anything over 95% means we involve - * the application thread. + * Calculate the cache full percentage; anything over the trigger means + * we involve the application thread. */ - pct_full = (int)((100 * bytes_inuse) / bytes_max); + pct_full = (u_int)((100 * bytes_inuse) / bytes_max); if (pct_fullp != NULL) *pct_fullp = pct_full; - if (pct_full >= 95) - return (1); + if (pct_full > cache->eviction_trigger) + return (true); - /* - * Return if we're over the trigger cache size or there are too many - * dirty pages. - */ - if (bytes_inuse > (cache->eviction_trigger * bytes_max) / 100) - return (1); + /* Return if there are too many dirty bytes in cache. */ if (__wt_cache_dirty_inuse(cache) > (cache->eviction_dirty_trigger * bytes_max) / 100) - return (1); - return (0); + return (true); + return (false); } /* @@ -225,7 +201,7 @@ static inline int __wt_cache_eviction_check(WT_SESSION_IMPL *session, int busy, int *didworkp) { WT_BTREE *btree; - int pct_full; + u_int pct_full; if (didworkp != NULL) *didworkp = 0; @@ -235,7 +211,7 @@ __wt_cache_eviction_check(WT_SESSION_IMPL *session, int busy, int *didworkp) * that case, or when holding the schema or handle list locks (which * block eviction), we don't want to highjack the thread for eviction. */ - if (F_ISSET(session, WT_SESSION_NO_CACHE_CHECK | + if (F_ISSET(session, WT_SESSION_NO_EVICTION | WT_SESSION_LOCKED_HANDLE_LIST | WT_SESSION_LOCKED_SCHEMA)) return (0); diff --git a/src/third_party/wiredtiger/src/include/cell.i b/src/third_party/wiredtiger/src/include/cell.i index 20a4d214015..d7ecfd3bda4 100644 --- a/src/third_party/wiredtiger/src/include/cell.i +++ b/src/third_party/wiredtiger/src/include/cell.i @@ -182,7 +182,7 @@ __wt_cell_pack_addr(WT_CELL *cell, u_int cell_type, uint64_t recno, size_t size) p = cell->__chunk + 1; - if (recno == 0) + if (recno == WT_RECNO_OOB) cell->__chunk[0] = cell_type; /* Type */ else { cell->__chunk[0] = cell_type | WT_CELL_64V; diff --git a/src/third_party/wiredtiger/src/include/connection.h b/src/third_party/wiredtiger/src/include/connection.h index 64043035e76..d8ff261cd82 100644 --- a/src/third_party/wiredtiger/src/include/connection.h +++ b/src/third_party/wiredtiger/src/include/connection.h @@ -270,7 +270,9 @@ struct __wt_connection_impl { uint32_t hazard_max; /* Hazard array size */ WT_CACHE *cache; /* Page cache */ - uint64_t cache_size; /* Configured cache size */ + volatile uint64_t cache_size; /* Cache size (either statically + configured or the current size + within a cache pool). */ WT_TXN_GLOBAL txn_global; /* Global transaction state */ @@ -292,8 +294,6 @@ struct __wt_connection_impl { uint64_t ckpt_time_recent; /* Checkpoint time recent/total */ uint64_t ckpt_time_total; - int compact_in_memory_pass; /* Compaction serialization */ - #define WT_CONN_STAT_ALL 0x01 /* "all" statistics configured */ #define WT_CONN_STAT_CLEAR 0x02 /* clear after gathering */ #define WT_CONN_STAT_FAST 0x04 /* "fast" statistics configured */ @@ -370,6 +370,20 @@ struct __wt_connection_impl { time_t sweep_interval;/* Handle sweep interval */ u_int sweep_handles_min;/* Handle sweep minimum open */ + /* + * Shared lookaside lock, session and cursor, used by threads accessing + * the lookaside table (other than eviction server and worker threads + * and the sweep thread, all of which have their own lookaside cursors). + */ + WT_SPINLOCK las_lock; /* Lookaside table spinlock */ + WT_SESSION_IMPL *las_session; /* Lookaside table session */ + WT_CURSOR *las_cursor; /* Lookaside table cursor */ + bool las_written; /* Lookaside table has been written */ + + WT_ITEM las_sweep_key; /* Sweep server's saved key */ + int las_sweep_call;/* Sweep server's call count */ + uint64_t las_sweep_cnt; /* Sweep server's per-call row count */ + /* Locked: collator list */ TAILQ_HEAD(__wt_coll_qh, __wt_named_collator) collqh; diff --git a/src/third_party/wiredtiger/src/include/cursor.h b/src/third_party/wiredtiger/src/include/cursor.h index 2b3a3221004..2f55dfc8186 100644 --- a/src/third_party/wiredtiger/src/include/cursor.h +++ b/src/third_party/wiredtiger/src/include/cursor.h @@ -261,6 +261,7 @@ struct __wt_cursor_index { WT_CURSOR *child; WT_CURSOR **cg_cursors; + uint8_t *cg_needvalue; }; struct __wt_cursor_json { diff --git a/src/third_party/wiredtiger/src/include/cursor.i b/src/third_party/wiredtiger/src/include/cursor.i index 484af0b4a58..e7fed250251 100644 --- a/src/third_party/wiredtiger/src/include/cursor.i +++ b/src/third_party/wiredtiger/src/include/cursor.i @@ -32,7 +32,7 @@ __cursor_pos_clear(WT_CURSOR_BTREE *cbt) * and it's a minimal set of things we need to clear. It would be a * lot simpler to clear everything, but we call this function a lot. */ - cbt->recno = 0; + cbt->recno = WT_RECNO_OOB; cbt->ins = NULL; cbt->ins_head = NULL; diff --git a/src/third_party/wiredtiger/src/include/error.h b/src/third_party/wiredtiger/src/include/error.h index fcb96b16361..abffc02945e 100644 --- a/src/third_party/wiredtiger/src/include/error.h +++ b/src/third_party/wiredtiger/src/include/error.h @@ -92,7 +92,8 @@ return (__wt_illegal_value(session, NULL)) #define WT_ILLEGAL_VALUE_ERR(session) \ default: \ - WT_ERR(__wt_illegal_value(session, NULL)) + ret = __wt_illegal_value(session, NULL); \ + goto err #define WT_ILLEGAL_VALUE_SET(session) \ default: \ ret = __wt_illegal_value(session, NULL); \ diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h index a7b02ec4a75..e5c5a72fe02 100644 --- a/src/third_party/wiredtiger/src/include/extern.h +++ b/src/third_party/wiredtiger/src/include/extern.h @@ -63,7 +63,7 @@ extern int __wt_block_ext_prealloc(WT_SESSION_IMPL *session, u_int max); extern int __wt_block_ext_discard(WT_SESSION_IMPL *session, u_int max); extern int __wt_block_salvage_start(WT_SESSION_IMPL *session, WT_BLOCK *block); extern int __wt_block_salvage_end(WT_SESSION_IMPL *session, WT_BLOCK *block); -extern int __wt_block_offset_invalid(WT_BLOCK *block, wt_off_t offset, uint32_t size); +extern bool __wt_block_offset_invalid(WT_BLOCK *block, wt_off_t offset, uint32_t size); extern int __wt_block_salvage_next(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t *addr, size_t *addr_sizep, int *eofp); extern int __wt_block_salvage_valid(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t *addr, size_t addr_size, int valid); extern int __wt_block_verify_start(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_CKPT *ckptbase, const char *cfg[]); @@ -101,8 +101,9 @@ extern int __wt_btcur_next_random(WT_CURSOR_BTREE *cbt); extern int __wt_btcur_compare(WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *cmpp); extern int __wt_btcur_equals( WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *equalp); extern int __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop); +extern void __wt_btcur_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt); extern void __wt_btcur_open(WT_CURSOR_BTREE *cbt); -extern int __wt_btcur_close(WT_CURSOR_BTREE *cbt); +extern int __wt_btcur_close(WT_CURSOR_BTREE *cbt, int lowlevel); extern int __wt_debug_set_verbose(WT_SESSION_IMPL *session, const char *v); extern int __wt_debug_addr_print( WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size); extern int __wt_debug_addr(WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size, const char *ofile); @@ -115,12 +116,13 @@ extern int __wt_debug_tree(WT_SESSION_IMPL *session, WT_PAGE *page, const char * extern int __wt_debug_page(WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile); extern int __wt_delete_page(WT_SESSION_IMPL *session, WT_REF *ref, int *skipp); extern void __wt_delete_page_rollback(WT_SESSION_IMPL *session, WT_REF *ref); -extern int __wt_delete_page_skip(WT_SESSION_IMPL *session, WT_REF *ref); +extern bool __wt_delete_page_skip(WT_SESSION_IMPL *session, WT_REF *ref); extern int __wt_delete_page_instantiate(WT_SESSION_IMPL *session, WT_REF *ref); extern void __wt_ref_out(WT_SESSION_IMPL *session, WT_REF *ref); extern void __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep); extern void __wt_free_ref( WT_SESSION_IMPL *session, WT_PAGE *page, WT_REF *ref, int free_pages); extern void __wt_free_ref_index(WT_SESSION_IMPL *session, WT_PAGE *page, WT_PAGE_INDEX *pindex, int free_pages); +extern void __wt_free_update_list(WT_SESSION_IMPL *session, WT_UPDATE *upd); extern int __wt_btree_open(WT_SESSION_IMPL *session, const char *op_cfg[]); extern int __wt_btree_close(WT_SESSION_IMPL *session); extern void __wt_root_ref_init(WT_REF *root_ref, WT_PAGE *root, int is_recno); @@ -138,15 +140,15 @@ extern const char *__wt_addr_string(WT_SESSION_IMPL *session, const uint8_t *add extern int __wt_ovfl_read(WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL_UNPACK *unpack, WT_ITEM *store); extern int __wt_ovfl_cache(WT_SESSION_IMPL *session, WT_PAGE *page, void *cookie, WT_CELL_UNPACK *vpack); extern int __wt_ovfl_discard(WT_SESSION_IMPL *session, WT_CELL *cell); +extern int __wt_page_alloc(WT_SESSION_IMPL *session, uint8_t type, uint64_t recno, uint32_t alloc_entries, int alloc_refs, WT_PAGE **pagep); +extern int __wt_page_inmem(WT_SESSION_IMPL *session, WT_REF *ref, const void *image, size_t memsize, uint32_t flags, WT_PAGE **pagep); +extern int __wt_las_remove_block(WT_SESSION_IMPL *session, WT_CURSOR *cursor, uint32_t btree_id, const uint8_t *addr, size_t addr_size); extern int __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags #ifdef HAVE_DIAGNOSTIC , const char *file, int line #endif ); -extern int __wt_page_alloc(WT_SESSION_IMPL *session, uint8_t type, uint64_t recno, uint32_t alloc_entries, int alloc_refs, WT_PAGE **pagep); -extern int __wt_page_inmem(WT_SESSION_IMPL *session, WT_REF *ref, const void *image, size_t memsize, uint32_t flags, WT_PAGE **pagep); -extern int __wt_cache_read(WT_SESSION_IMPL *session, WT_REF *ref); extern int __wt_kv_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd); extern int __wt_bt_salvage(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, const char *cfg[]); extern void __wt_split_stash_discard(WT_SESSION_IMPL *session); @@ -162,7 +164,7 @@ extern int __wt_verify(WT_SESSION_IMPL *session, const char *cfg[]); extern int __wt_verify_dsk_image(WT_SESSION_IMPL *session, const char *tag, const WT_PAGE_HEADER *dsk, size_t size, int empty_page_ok); extern int __wt_verify_dsk(WT_SESSION_IMPL *session, const char *tag, WT_ITEM *buf); extern int __wt_tree_walk(WT_SESSION_IMPL *session, WT_REF **refp, uint64_t *walkcntp, uint32_t flags); -extern int __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, WT_ITEM *value, WT_UPDATE *upd, int is_remove); +extern int __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, WT_ITEM *value, WT_UPDATE *upd_arg, int is_remove); extern int __wt_col_search(WT_SESSION_IMPL *session, uint64_t recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt); extern int __wt_row_leaf_keys(WT_SESSION_IMPL *session, WT_PAGE *page); extern int __wt_row_leaf_key_copy( WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip, WT_ITEM *key); @@ -179,6 +181,14 @@ extern void __wt_update_obsolete_free( WT_SESSION_IMPL *session, WT_PAGE *page, extern int __wt_search_insert( WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_ITEM *srch_key); extern int __wt_row_search(WT_SESSION_IMPL *session, WT_ITEM *srch_key, WT_REF *leaf, WT_CURSOR_BTREE *cbt, int insert); extern int __wt_row_random(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt); +extern void __wt_las_stats_update(WT_SESSION_IMPL *session); +extern int __wt_las_create(WT_SESSION_IMPL *session); +extern int __wt_las_destroy(WT_SESSION_IMPL *session); +extern void __wt_las_set_written(WT_SESSION_IMPL *session); +extern bool __wt_las_is_written(WT_SESSION_IMPL *session); +extern int __wt_las_cursor( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t *session_flags); +extern int __wt_las_cursor_close( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t session_flags); +extern int __wt_las_sweep(WT_SESSION_IMPL *session); extern int __wt_config_initn( WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str, size_t len); extern int __wt_config_init(WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str); extern int __wt_config_subinit( WT_SESSION_IMPL *session, WT_CONFIG *conf, WT_CONFIG_ITEM *item); @@ -237,7 +247,7 @@ extern int __wt_conn_dhandle_discard(WT_SESSION_IMPL *session); extern int __wt_connection_init(WT_CONNECTION_IMPL *conn); extern int __wt_connection_destroy(WT_CONNECTION_IMPL *conn); extern int __wt_log_truncate_files( WT_SESSION_IMPL *session, WT_CURSOR *cursor, const char *cfg[]); -extern int __wt_log_wrlsn(WT_SESSION_IMPL *session, uint32_t *free_i, int *yield); +extern int __wt_log_wrlsn(WT_SESSION_IMPL *session); extern int __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[]); extern int __wt_logmgr_open(WT_SESSION_IMPL *session); extern int __wt_logmgr_destroy(WT_SESSION_IMPL *session); @@ -308,14 +318,14 @@ extern void __wt_evict_list_clear_page(WT_SESSION_IMPL *session, WT_REF *ref); extern int __wt_evict_server_wake(WT_SESSION_IMPL *session); extern int __wt_evict_create(WT_SESSION_IMPL *session); extern int __wt_evict_destroy(WT_SESSION_IMPL *session); -extern int __wt_evict_page(WT_SESSION_IMPL *session, WT_REF *ref); extern int __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session, int *evict_resetp); extern void __wt_evict_file_exclusive_off(WT_SESSION_IMPL *session); -extern int __wt_cache_eviction_worker(WT_SESSION_IMPL *session, int busy, int pct_full); -extern void __wt_cache_dump(WT_SESSION_IMPL *session); +extern int __wt_cache_eviction_worker(WT_SESSION_IMPL *session, int busy, u_int pct_full); +extern int __wt_cache_dump(WT_SESSION_IMPL *session, const char *ofile); extern int __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, int closing); extern int __wt_evict_page_clean_update(WT_SESSION_IMPL *session, WT_REF *ref, int closing); extern int __wt_log_ckpt(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn); +extern int __wt_log_ckpt_lsn(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn); extern int __wt_log_background(WT_SESSION_IMPL *session, WT_LSN *lsn); extern int __wt_log_force_sync(WT_SESSION_IMPL *session, WT_LSN *min_lsn); extern int __wt_log_needs_recovery(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn, int *rec); @@ -323,12 +333,13 @@ extern void __wt_log_written_reset(WT_SESSION_IMPL *session); extern int __wt_log_get_all_files(WT_SESSION_IMPL *session, char ***filesp, u_int *countp, uint32_t *maxid, int active_only); extern void __wt_log_files_free(WT_SESSION_IMPL *session, char **files, u_int count); extern int __wt_log_extract_lognum( WT_SESSION_IMPL *session, const char *name, uint32_t *id); +extern int __wt_log_acquire(WT_SESSION_IMPL *session, uint64_t recsize, WT_LOGSLOT *slot); extern int __wt_log_allocfile( WT_SESSION_IMPL *session, uint32_t lognum, const char *dest, int prealloc); extern int __wt_log_remove(WT_SESSION_IMPL *session, const char *file_prefix, uint32_t lognum); extern int __wt_log_open(WT_SESSION_IMPL *session); extern int __wt_log_close(WT_SESSION_IMPL *session); -extern int __wt_log_newfile(WT_SESSION_IMPL *session, int conn_create, int *created); extern int __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, int (*func)(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, WT_LSN *next_lsnp, void *cookie, int firstrecord), void *cookie); +extern int __wt_log_force_write(WT_SESSION_IMPL *session, int retry); extern int __wt_log_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, uint32_t flags); extern int __wt_log_vprintf(WT_SESSION_IMPL *session, const char *fmt, va_list ap); extern int __wt_logrec_alloc(WT_SESSION_IMPL *session, size_t size, WT_ITEM **logrecp); @@ -354,14 +365,16 @@ extern int __wt_logop_row_truncate_pack( WT_SESSION_IMPL *session, WT_ITEM *logr extern int __wt_logop_row_truncate_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *startp, WT_ITEM *stopp, uint32_t *modep); extern int __wt_logop_row_truncate_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out); extern int __wt_txn_op_printlog( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out); +extern void __wt_log_slot_activate(WT_SESSION_IMPL *session, WT_LOGSLOT *slot); +extern int __wt_log_slot_close( WT_SESSION_IMPL *session, WT_LOGSLOT *slot, int *releasep, int forced); +extern int __wt_log_slot_switch_internal(WT_SESSION_IMPL *session, WT_MYSLOT *myslot); +extern int __wt_log_slot_switch(WT_SESSION_IMPL *session, WT_MYSLOT *myslot); +extern int __wt_log_slot_new(WT_SESSION_IMPL *session); extern int __wt_log_slot_init(WT_SESSION_IMPL *session); extern int __wt_log_slot_destroy(WT_SESSION_IMPL *session); -extern int __wt_log_slot_join(WT_SESSION_IMPL *session, uint64_t mysize, uint32_t flags, WT_MYSLOT *myslotp); -extern int __wt_log_slot_close(WT_SESSION_IMPL *session, WT_LOGSLOT *slot); -extern int __wt_log_slot_notify(WT_SESSION_IMPL *session, WT_LOGSLOT *slot); -extern int __wt_log_slot_wait(WT_SESSION_IMPL *session, WT_LOGSLOT *slot); -extern int64_t __wt_log_slot_release(WT_LOGSLOT *slot, uint64_t size); -extern int __wt_log_slot_free(WT_SESSION_IMPL *session, WT_LOGSLOT *slot); +extern void __wt_log_slot_join(WT_SESSION_IMPL *session, uint64_t mysize, uint32_t flags, WT_MYSLOT *myslot); +extern int64_t __wt_log_slot_release(WT_SESSION_IMPL *session, WT_MYSLOT *myslot, int64_t size); +extern void __wt_log_slot_free(WT_SESSION_IMPL *session, WT_LOGSLOT *slot); extern int __wt_clsm_request_switch(WT_CURSOR_LSM *clsm); extern int __wt_clsm_await_switch(WT_CURSOR_LSM *clsm); extern int __wt_clsm_init_merge( WT_CURSOR *cursor, u_int start_chunk, uint32_t start_id, u_int nchunks); @@ -474,7 +487,7 @@ extern int __wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t siz extern int __wt_mmap_discard(WT_SESSION_IMPL *session, void *p, size_t size); extern int __wt_munmap(WT_SESSION_IMPL *session, WT_FH *fh, void *map, size_t len, void **mappingcookie); extern int __wt_cond_alloc(WT_SESSION_IMPL *session, const char *name, int is_signalled, WT_CONDVAR **condp); -extern int __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs); +extern int __wt_cond_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs, int *signalled); extern int __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond); extern int __wt_cond_destroy(WT_SESSION_IMPL *session, WT_CONDVAR **condp); extern int __wt_rwlock_alloc( WT_SESSION_IMPL *session, WT_RWLOCK **rwlockp, const char *name); @@ -488,7 +501,7 @@ extern int __wt_rwlock_destroy(WT_SESSION_IMPL *session, WT_RWLOCK **rwlockp); extern int __wt_once(void (*init_routine)(void)); extern int __wt_open(WT_SESSION_IMPL *session, const char *name, int ok_create, int exclusive, int dio_type, WT_FH **fhp); extern int __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp); -extern int __wt_absolute_path(const char *path); +extern bool __wt_absolute_path(const char *path); extern const char *__wt_path_separator(void); extern int __wt_has_priv(void); extern int __wt_remove(WT_SESSION_IMPL *session, const char *name); @@ -576,6 +589,8 @@ extern int __wt_schema_worker(WT_SESSION_IMPL *session, const char *uri, int (*f extern int __wt_session_reset_cursors(WT_SESSION_IMPL *session, int free_buffers); extern int __wt_session_copy_values(WT_SESSION_IMPL *session); extern int __wt_open_cursor(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp); +extern int __wt_session_create( WT_SESSION_IMPL *session, const char *uri, const char *config); +extern int __wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]); extern int __wt_open_internal_session(WT_CONNECTION_IMPL *conn, const char *name, int uses_dhandles, int open_metadata, WT_SESSION_IMPL **sessionp); extern int __wt_open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const char *config, int open_metadata, WT_SESSION_IMPL **sessionp); extern int __wt_compact_uri_analyze(WT_SESSION_IMPL *session, const char *uri, int *skip); @@ -638,7 +653,7 @@ extern int __wt_huffman_decode(WT_SESSION_IMPL *session, void *huffman_arg, cons extern uint32_t __wt_nlpo2_round(uint32_t v); extern uint32_t __wt_nlpo2(uint32_t v); extern uint32_t __wt_log2_int(uint32_t n); -extern int __wt_ispo2(uint32_t v); +extern bool __wt_ispo2(uint32_t v); extern uint32_t __wt_rduppo2(uint32_t n, uint32_t po2); extern void __wt_random_init(WT_RAND_STATE volatile *rnd_state); extern uint32_t __wt_random(WT_RAND_STATE volatile *rnd_state); diff --git a/src/third_party/wiredtiger/src/include/flags.h b/src/third_party/wiredtiger/src/include/flags.h index 031be7e7c59..ca3c3c38245 100644 --- a/src/third_party/wiredtiger/src/include/flags.h +++ b/src/third_party/wiredtiger/src/include/flags.h @@ -18,6 +18,8 @@ #define WT_CONN_SERVER_SWEEP 0x00002000 #define WT_CONN_WAS_BACKUP 0x00004000 #define WT_EVICTING 0x00000001 +#define WT_EVICT_LOOKASIDE 0x00000002 +#define WT_EVICT_UPDATE_RESTORE 0x00000004 #define WT_FILE_TYPE_CHECKPOINT 0x00000001 #define WT_FILE_TYPE_DATA 0x00000002 #define WT_FILE_TYPE_DIRECTORY 0x00000004 @@ -46,17 +48,17 @@ #define WT_SESSION_LOCKED_CHECKPOINT 0x00000008 #define WT_SESSION_LOCKED_HANDLE_LIST 0x00000010 #define WT_SESSION_LOCKED_SCHEMA 0x00000020 -#define WT_SESSION_LOCKED_TABLE 0x00000040 -#define WT_SESSION_LOGGING_INMEM 0x00000080 -#define WT_SESSION_NO_CACHE 0x00000100 -#define WT_SESSION_NO_CACHE_CHECK 0x00000200 -#define WT_SESSION_NO_DATA_HANDLES 0x00000400 -#define WT_SESSION_NO_LOGGING 0x00000800 -#define WT_SESSION_NO_SCHEMA_LOCK 0x00001000 -#define WT_SESSION_QUIET_CORRUPT_FILE 0x00002000 -#define WT_SESSION_SERVER_ASYNC 0x00004000 -#define WT_SKIP_UPDATE_ERR 0x00000002 -#define WT_SKIP_UPDATE_RESTORE 0x00000004 +#define WT_SESSION_LOCKED_SLOT 0x00000040 +#define WT_SESSION_LOCKED_TABLE 0x00000080 +#define WT_SESSION_LOGGING_INMEM 0x00000100 +#define WT_SESSION_LOOKASIDE_CURSOR 0x00000200 +#define WT_SESSION_NO_CACHE 0x00000400 +#define WT_SESSION_NO_DATA_HANDLES 0x00000800 +#define WT_SESSION_NO_EVICTION 0x00001000 +#define WT_SESSION_NO_LOGGING 0x00002000 +#define WT_SESSION_NO_SCHEMA_LOCK 0x00004000 +#define WT_SESSION_QUIET_CORRUPT_FILE 0x00008000 +#define WT_SESSION_SERVER_ASYNC 0x00010000 #define WT_SYNC_CHECKPOINT 0x00000001 #define WT_SYNC_CLOSE 0x00000002 #define WT_SYNC_DISCARD 0x00000004 @@ -90,6 +92,7 @@ #define WT_VERB_VERIFY 0x00200000 #define WT_VERB_VERSION 0x00400000 #define WT_VERB_WRITE 0x00800000 +#define WT_VISIBILITY_ERR 0x00000008 /* * flags section: END * DO NOT EDIT: automatically built by dist/flags.py. diff --git a/src/third_party/wiredtiger/src/include/gcc.h b/src/third_party/wiredtiger/src/include/gcc.h index 3472985745e..01e33792d73 100644 --- a/src/third_party/wiredtiger/src/include/gcc.h +++ b/src/third_party/wiredtiger/src/include/gcc.h @@ -123,7 +123,7 @@ __wt_atomic_sub##name(type *vp, type v) \ { \ return (__sync_sub_and_fetch(vp, v)); \ } \ -static inline int \ +static inline bool \ __wt_atomic_cas##name(type *vp, type old, type new) \ { \ return (WT_ATOMIC_CAS(vp, old, new)); \ @@ -145,7 +145,7 @@ WT_ATOMIC_FUNC(size, size_t, size_t) * __wt_atomic_cas_ptr -- * Pointer compare and swap. */ -static inline int +static inline bool __wt_atomic_cas_ptr(void *vp, void *old, void *new) { return (WT_ATOMIC_CAS((void **)vp, old, new)); diff --git a/src/third_party/wiredtiger/src/include/hardware.h b/src/third_party/wiredtiger/src/include/hardware.h index c9b72f8a609..32353072c5b 100644 --- a/src/third_party/wiredtiger/src/include/hardware.h +++ b/src/third_party/wiredtiger/src/include/hardware.h @@ -50,6 +50,16 @@ &(p)->flags_atomic, __orig, __orig | (uint8_t)(mask))); \ } while (0) +#define F_CAS_ATOMIC_WAIT(p, mask) do { \ + int __ret; \ + for (;;) { \ + F_CAS_ATOMIC(p, mask, __ret); \ + if (__ret == 0) \ + break; \ + __wt_yield(); \ + } \ +} while (0) + #define F_CLR_ATOMIC(p, mask) do { \ uint8_t __orig; \ do { \ diff --git a/src/third_party/wiredtiger/src/include/lint.h b/src/third_party/wiredtiger/src/include/lint.h index eba4a1c3b3f..f288fb98683 100644 --- a/src/third_party/wiredtiger/src/include/lint.h +++ b/src/third_party/wiredtiger/src/include/lint.h @@ -49,14 +49,14 @@ __wt_atomic_sub##name(type *vp, type v) \ *vp -= v; \ return (*vp); \ } \ -static inline int \ +static inline bool \ __wt_atomic_cas##name(type *vp, type old, type new) \ { \ if (*vp == old) { \ *vp = new; \ - return (1); \ + return (true); \ } \ - return (0); \ + return (false); \ } WT_ATOMIC_FUNC(8, uint8_t, uint8_t) @@ -75,13 +75,13 @@ WT_ATOMIC_FUNC(size, size_t, size_t) * __wt_atomic_cas_ptr -- * Pointer compare and swap. */ -static inline int +static inline bool __wt_atomic_cas_ptr(void *vp, void *old, void *new) { if (*(void **)vp == old) { *(void **)vp = new; - return (1); + return (true); } - return (0); + return (false); } static inline void WT_BARRIER(void) { return; } diff --git a/src/third_party/wiredtiger/src/include/log.h b/src/third_party/wiredtiger/src/include/log.h index 949eb09ca30..06be95697c7 100644 --- a/src/third_party/wiredtiger/src/include/log.h +++ b/src/third_party/wiredtiger/src/include/log.h @@ -12,7 +12,6 @@ /* Logging subsystem declarations. */ #define WT_LOG_ALIGN 128 -#define WT_LOG_SLOT_BUF_SIZE 256 * 1024 #define WT_INIT_LSN(l) do { \ (l)->file = 1; \ @@ -48,63 +47,133 @@ ((size) - offsetof(WT_LOG_RECORD, record)) /* - * Compare 2 LSNs, return -1 if lsn0 < lsn1, 0 if lsn0 == lsn1 - * and 1 if lsn0 > lsn1. - */ -#define WT_LOG_CMP(lsn1, lsn2) \ - ((lsn1)->file != (lsn2)->file ? \ - ((lsn1)->file < (lsn2)->file ? -1 : 1) : \ - ((lsn1)->offset != (lsn2)->offset ? \ - ((lsn1)->offset < (lsn2)->offset ? -1 : 1) : 0)) - -/* * Possible values for the consolidation array slot states: - * (NOTE: Any new states must be > WT_LOG_SLOT_DONE and < WT_LOG_SLOT_READY.) * - * < WT_LOG_SLOT_DONE - threads are actively writing to the log. - * WT_LOG_SLOT_DONE - all activity on this slot is complete. + * WT_LOG_SLOT_CLOSE - slot is in use but closed to new joins. * WT_LOG_SLOT_FREE - slot is available for allocation. - * WT_LOG_SLOT_PENDING - slot is transitioning from ready to active. * WT_LOG_SLOT_WRITTEN - slot is written and should be processed by worker. - * WT_LOG_SLOT_READY - slot is ready for threads to join. - * > WT_LOG_SLOT_READY - threads are actively consolidating on this slot. * * The slot state must be volatile: threads loop checking the state and can't * cache the first value they see. + * + * The slot state is divided into two 32 bit sizes. One half is the + * amount joined and the other is the amount released. Since we use + * a few special states, reserve the top few bits for state. That makes + * the maximum size less than 32 bits for both joined and released. + */ + +/* + * The high bit is reserved for the special states. If the high bit is + * set (WT_LOG_SLOT_RESERVED) then we are guaranteed to be in a special state. + */ +#define WT_LOG_SLOT_FREE -1 /* Not in use */ +#define WT_LOG_SLOT_WRITTEN -2 /* Slot data written, not processed */ + +/* + * We allocate the buffer size, but trigger a slot switch when we cross + * the maximum size of half the buffer. If a record is more than the buffer + * maximum then we trigger a slot switch and write that record unbuffered. + * We use a larger buffer to provide overflow space so that we can switch + * once we cross the threshold. + */ +#define WT_LOG_SLOT_BUF_SIZE (256 * 1024) /* Must be power of 2 */ +#define WT_LOG_SLOT_BUF_MAX ((uint32_t)log->slot_buf_size / 2) +#define WT_LOG_SLOT_UNBUFFERED (WT_LOG_SLOT_BUF_SIZE << 1) + +/* + * If new slot states are added, adjust WT_LOG_SLOT_BITS and + * WT_LOG_SLOT_MASK_OFF accordingly for how much of the top 32 + * bits we are using. More slot states here will reduce the maximum + * size that a slot can hold unbuffered by half. If a record is + * larger than the maximum we can account for in the slot state we fall + * back to direct writes. + */ +#define WT_LOG_SLOT_BITS 2 +#define WT_LOG_SLOT_MAXBITS (32 - WT_LOG_SLOT_BITS) +#define WT_LOG_SLOT_CLOSE 0x4000000000000000LL /* Force slot close */ +#define WT_LOG_SLOT_RESERVED 0x8000000000000000LL /* Reserved states */ + +/* + * Check if the unbuffered flag is set in the joined portion of + * the slot state. */ -#define WT_LOG_SLOT_DONE 0 -#define WT_LOG_SLOT_FREE 1 -#define WT_LOG_SLOT_PENDING 2 -#define WT_LOG_SLOT_WRITTEN 3 -#define WT_LOG_SLOT_READY 4 +#define WT_LOG_SLOT_UNBUFFERED_ISSET(state) \ + ((state) & ((int64_t)WT_LOG_SLOT_UNBUFFERED << 32)) + +#define WT_LOG_SLOT_MASK_OFF 0x3fffffffffffffffLL +#define WT_LOG_SLOT_MASK_ON ~(WT_LOG_SLOT_MASK_OFF) +#define WT_LOG_SLOT_JOIN_MASK (WT_LOG_SLOT_MASK_OFF >> 32) + +/* + * These macros manipulate the slot state and its component parts. + */ +#define WT_LOG_SLOT_FLAGS(state) ((state) & WT_LOG_SLOT_MASK_ON) +#define WT_LOG_SLOT_JOINED(state) (((state) & WT_LOG_SLOT_MASK_OFF) >> 32) +#define WT_LOG_SLOT_JOINED_BUFFERED(state) \ + (WT_LOG_SLOT_JOINED(state) & \ + (WT_LOG_SLOT_UNBUFFERED - 1)) +#define WT_LOG_SLOT_JOIN_REL(j, r, s) (((j) << 32) + (r) + (s)) +#define WT_LOG_SLOT_RELEASED(state) ((int64_t)(int32_t)(state)) +#define WT_LOG_SLOT_RELEASED_BUFFERED(state) \ + ((int64_t)((int32_t)WT_LOG_SLOT_RELEASED(state) & \ + (WT_LOG_SLOT_UNBUFFERED - 1))) + +/* Slot is in use */ +#define WT_LOG_SLOT_ACTIVE(state) \ + (WT_LOG_SLOT_JOINED(state) != WT_LOG_SLOT_JOIN_MASK) +/* Slot is in use, but closed to new joins */ +#define WT_LOG_SLOT_CLOSED(state) \ + (WT_LOG_SLOT_ACTIVE(state) && \ + (FLD64_ISSET((uint64_t)state, WT_LOG_SLOT_CLOSE) && \ + !FLD64_ISSET((uint64_t)state, WT_LOG_SLOT_RESERVED))) +/* Slot is in use, all data copied into buffer */ +#define WT_LOG_SLOT_INPROGRESS(state) \ + (WT_LOG_SLOT_RELEASED(state) != WT_LOG_SLOT_JOINED(state)) +#define WT_LOG_SLOT_DONE(state) \ + (WT_LOG_SLOT_CLOSED(state) && \ + !WT_LOG_SLOT_INPROGRESS(state)) +/* Slot is in use, more threads may join this slot */ +#define WT_LOG_SLOT_OPEN(state) \ + (WT_LOG_SLOT_ACTIVE(state) && \ + !WT_LOG_SLOT_UNBUFFERED_ISSET(state) && \ + !FLD64_ISSET((uint64_t)(state), WT_LOG_SLOT_CLOSE) && \ + WT_LOG_SLOT_JOINED(state) < WT_LOG_SLOT_BUF_MAX) + struct WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) __wt_logslot { volatile int64_t slot_state; /* Slot state */ - uint64_t slot_group_size; /* Group size */ + int64_t slot_unbuffered; /* Unbuffered data in this slot */ int32_t slot_error; /* Error value */ -#define WT_SLOT_INVALID_INDEX 0xffffffff - uint32_t slot_index; /* Active slot index */ wt_off_t slot_start_offset; /* Starting file offset */ - WT_LSN slot_release_lsn; /* Slot release LSN */ - WT_LSN slot_start_lsn; /* Slot starting LSN */ - WT_LSN slot_end_lsn; /* Slot ending LSN */ + wt_off_t slot_last_offset; /* Last record offset */ + WT_LSN slot_release_lsn; /* Slot release LSN */ + WT_LSN slot_start_lsn; /* Slot starting LSN */ + WT_LSN slot_end_lsn; /* Slot ending LSN */ WT_FH *slot_fh; /* File handle for this group */ - WT_ITEM slot_buf; /* Buffer for grouped writes */ - int32_t slot_churn; /* Active slots are scarce. */ + WT_ITEM slot_buf; /* Buffer for grouped writes */ -#define WT_SLOT_BUFFERED 0x01 /* Buffer writes */ -#define WT_SLOT_CLOSEFH 0x02 /* Close old fh on release */ -#define WT_SLOT_SYNC 0x04 /* Needs sync on release */ -#define WT_SLOT_SYNC_DIR 0x08 /* Directory sync on release */ +#define WT_SLOT_CLOSEFH 0x01 /* Close old fh on release */ +#define WT_SLOT_SYNC 0x02 /* Needs sync on release */ +#define WT_SLOT_SYNC_DIR 0x04 /* Directory sync on release */ uint32_t flags; /* Flags */ }; -#define WT_SLOT_INIT_FLAGS (WT_SLOT_BUFFERED) +#define WT_SLOT_INIT_FLAGS 0 + +#define WT_WITH_SLOT_LOCK(session, log, op) do { \ + WT_ASSERT(session, !F_ISSET(session, WT_SESSION_LOCKED_SLOT)); \ + WT_WITH_LOCK(session, \ + &log->log_slot_lock, WT_SESSION_LOCKED_SLOT, op); \ +} while (0) struct __wt_myslot { - WT_LOGSLOT *slot; - wt_off_t offset; + WT_LOGSLOT *slot; /* Slot I'm using */ + wt_off_t end_offset; /* My end offset in buffer */ + wt_off_t offset; /* Slot buffer offset */ +#define WT_MYSLOT_CLOSE 0x01 /* This thread is closing the slot */ +#define WT_MYSLOT_UNBUFFERED 0x02 /* Write directly */ + uint32_t flags; /* Flags */ }; - /* Offset of first record */ + #define WT_LOG_FIRST_RECORD log->allocsize struct __wt_log { @@ -118,8 +187,9 @@ struct __wt_log { uint32_t tmp_fileid; /* Temporary file number */ uint32_t prep_missed; /* Pre-allocated file misses */ WT_FH *log_fh; /* Logging file handle */ - WT_FH *log_close_fh; /* Logging file handle to close */ WT_FH *log_dir_fh; /* Log directory file handle */ + WT_FH *log_close_fh; /* Logging file handle to close */ + WT_LSN log_close_lsn; /* LSN needed to close */ /* * System LSNs @@ -140,8 +210,9 @@ struct __wt_log { WT_SPINLOCK log_lock; /* Locked: Logging fields */ WT_SPINLOCK log_slot_lock; /* Locked: Consolidation array */ WT_SPINLOCK log_sync_lock; /* Locked: Single-thread fsync */ + WT_SPINLOCK log_writelsn_lock; /* Locked: write LSN */ - WT_RWLOCK *log_archive_lock; /* Archive and log cursors */ + WT_RWLOCK *log_archive_lock; /* Archive and log cursors */ /* Notify any waiting threads when sync_lsn is updated. */ WT_CONDVAR *log_sync_cond; @@ -150,7 +221,6 @@ struct __wt_log { /* * Consolidation array information - * WT_SLOT_ACTIVE must be less than WT_SLOT_POOL. * Our testing shows that the more consolidation we generate the * better the performance we see which equates to an active slot * slot count of one. @@ -158,13 +228,14 @@ struct __wt_log { * Note: this can't be an array, we impose cache-line alignment and * gcc doesn't support that for arrays. */ -#define WT_SLOT_ACTIVE 1 #define WT_SLOT_POOL 128 - WT_LOGSLOT *slot_array[WT_SLOT_ACTIVE]; /* Active slots */ - WT_LOGSLOT slot_pool[WT_SLOT_POOL]; /* Pool of all slots */ - size_t slot_buf_size; /* Buffer size for slots */ + WT_LOGSLOT *active_slot; /* Active slot */ + WT_LOGSLOT slot_pool[WT_SLOT_POOL]; /* Pool of all slots */ + size_t slot_buf_size; /* Buffer size for slots */ +#ifdef HAVE_DIAGNOSTIC + uint64_t write_calls; /* Calls to log_write */ +#endif -#define WT_LOG_FORCE_CONSOLIDATE 0x01 /* Disable direct writes */ uint32_t flags; }; diff --git a/src/third_party/wiredtiger/src/include/log.i b/src/third_party/wiredtiger/src/include/log.i new file mode 100644 index 00000000000..ff309c31265 --- /dev/null +++ b/src/third_party/wiredtiger/src/include/log.i @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2014-2015 MongoDB, Inc. + * Copyright (c) 2008-2014 WiredTiger, Inc. + * All rights reserved. + * + * See the file LICENSE for redistribution information. + */ + +static inline int __wt_log_cmp(WT_LSN *lsn1, WT_LSN *lsn2); + +/* + * __wt_log_cmp -- + * Compare 2 LSNs, return -1 if lsn1 < lsn2, 0if lsn1 == lsn2 + * and 1 if lsn1 > lsn2. + */ +static inline int +__wt_log_cmp(WT_LSN *lsn1, WT_LSN *lsn2) +{ + WT_LSN l1, l2; + + /* + * Read LSNs into local variables so that we only read each field + * once and all comparisons are on the same values. + */ + l1 = *(volatile WT_LSN *)lsn1; + l2 = *(volatile WT_LSN *)lsn2; + + /* + * If the file numbers are different we don't need to compare the + * offset. + */ + if (l1.file != l2.file) + return (l1.file < l2.file ? -1 : 1); + /* + * If the file numbers are the same, compare the offset. + */ + if (l1.offset != l2.offset) + return (l1.offset < l2.offset ? -1 : 1); + return (0); +} diff --git a/src/third_party/wiredtiger/src/include/meta.h b/src/third_party/wiredtiger/src/include/meta.h index 66547262417..a5a303f1630 100644 --- a/src/third_party/wiredtiger/src/include/meta.h +++ b/src/third_party/wiredtiger/src/include/meta.h @@ -21,7 +21,9 @@ #define WT_METADATA_TURTLE_SET "WiredTiger.turtle.set" /* Turtle temp file */ #define WT_METADATA_URI "metadata:" /* Metadata alias */ -#define WT_METAFILE_URI "file:WiredTiger.wt" /* Metadata file URI */ +#define WT_METAFILE_URI "file:WiredTiger.wt" /* Metadata table URI */ + +#define WT_LAS_URI "file:WiredTigerLAS.wt" /* Lookaside table URI*/ /* * Pre computed hash for the metadata file. Used to optimize comparisons diff --git a/src/third_party/wiredtiger/src/include/misc.h b/src/third_party/wiredtiger/src/include/misc.h index 7fb6ae13d38..1b2cbf11fc2 100644 --- a/src/third_party/wiredtiger/src/include/misc.h +++ b/src/third_party/wiredtiger/src/include/misc.h @@ -130,6 +130,7 @@ #define FLD_CLR(field, mask) ((field) &= ~((uint32_t)(mask))) #define FLD_ISSET(field, mask) ((field) & ((uint32_t)(mask))) +#define FLD64_ISSET(field, mask) ((field) & ((uint64_t)(mask))) #define FLD_SET(field, mask) ((field) |= ((uint32_t)(mask))) /* diff --git a/src/third_party/wiredtiger/src/include/misc.i b/src/third_party/wiredtiger/src/include/misc.i index 98facff02b9..6b502c4c1d1 100644 --- a/src/third_party/wiredtiger/src/include/misc.i +++ b/src/third_party/wiredtiger/src/include/misc.i @@ -7,6 +7,18 @@ */ /* + * __wt_cond_wait -- + * Wait on a mutex, optionally timing out. + */ +static inline int +__wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs) +{ + int notused; + + return (__wt_cond_wait_signal(session, cond, usecs, ¬used)); +} + +/* * __wt_strdup -- * ANSI strdup function. */ diff --git a/src/third_party/wiredtiger/src/include/msvc.h b/src/third_party/wiredtiger/src/include/msvc.h index f4d8ba52fc1..8f5aa9abde8 100644 --- a/src/third_party/wiredtiger/src/include/msvc.h +++ b/src/third_party/wiredtiger/src/include/msvc.h @@ -52,7 +52,7 @@ __wt_atomic_sub##name(type *vp, type v) \ { \ return (_InterlockedExchangeAdd ## s((t *)(vp), - (t)v) - (v)); \ } \ -static inline int \ +static inline bool \ __wt_atomic_cas##name(type *vp, type old, type new) \ { \ return (_InterlockedCompareExchange ## s \ @@ -75,7 +75,7 @@ WT_ATOMIC_FUNC(size, size_t, size_t, 64, __int64) * __wt_atomic_cas_ptr -- * Pointer compare and swap. */ -static inline int +static inline bool __wt_atomic_cas_ptr(void *vp, void *old, void *new) { return (_InterlockedCompareExchange64( diff --git a/src/third_party/wiredtiger/src/include/serial.i b/src/third_party/wiredtiger/src/include/serial.i index 7b62e66eccb..d90b29c2133 100644 --- a/src/third_party/wiredtiger/src/include/serial.i +++ b/src/third_party/wiredtiger/src/include/serial.i @@ -123,7 +123,7 @@ __col_append_serial_func(WT_SESSION_IMPL *session, WT_INSERT_HEAD *ins_head, * If the application didn't specify a record number, allocate a new one * and set up for an append. */ - if ((recno = WT_INSERT_RECNO(new_ins)) == 0) { + if ((recno = WT_INSERT_RECNO(new_ins)) == WT_RECNO_OOB) { recno = WT_INSERT_RECNO(new_ins) = btree->last_recno + 1; WT_ASSERT(session, WT_SKIP_LAST(ins_head) == NULL || recno > WT_INSERT_RECNO(WT_SKIP_LAST(ins_head))); @@ -292,25 +292,37 @@ __wt_update_serial(WT_SESSION_IMPL *session, WT_PAGE *page, __wt_page_modify_set(session, page); /* - * If there are subsequent WT_UPDATE structures, we're evicting pages - * and the page-scanning mutex isn't held, discard obsolete WT_UPDATE - * structures. Serialization is needed so only one thread does the - * obsolete check at a time, and to protect updates from disappearing - * under reconciliation. + * If there are no subsequent WT_UPDATE structures we are done here. */ - if (upd->next != NULL && - __wt_txn_visible_all(session, page->modify->obsolete_check_txn)) { - F_CAS_ATOMIC(page, WT_PAGE_SCANNING, ret); - /* If we can't lock it, don't scan, that's okay. */ - if (ret != 0) - return (0); - obsolete = __wt_update_obsolete_check(session, page, upd->next); - F_CLR_ATOMIC(page, WT_PAGE_SCANNING); - if (obsolete != NULL) { + if (upd->next == NULL) + return (0); + /* + * We would like to call __wt_txn_update_oldest only in the event that + * there are further updates to this page, the check against WT_TXN_NONE + * is used as an indicator of there being further updates on this page. + */ + if (page->modify->obsolete_check_txn != WT_TXN_NONE) { + if (!__wt_txn_visible_all(session, + page->modify->obsolete_check_txn)) { + /* Try to move the oldest ID forward and re-check */ + __wt_txn_update_oldest(session,0); + } + if (!__wt_txn_visible_all(session, + page->modify->obsolete_check_txn)) { page->modify->obsolete_check_txn = WT_TXN_NONE; - __wt_update_obsolete_free(session, page, obsolete); + return (0); } } + F_CAS_ATOMIC(page, WT_PAGE_RECONCILIATION, ret); + + /* If we can't lock it, don't scan, that's okay. */ + if (ret != 0) + return (0); + obsolete = __wt_update_obsolete_check(session, page, upd->next); + F_CLR_ATOMIC(page, WT_PAGE_RECONCILIATION); + if (obsolete != NULL) { + __wt_update_obsolete_free(session, page, obsolete); + } return (0); } diff --git a/src/third_party/wiredtiger/src/include/session.h b/src/third_party/wiredtiger/src/include/session.h index c6c246954f7..a691794fd46 100644 --- a/src/third_party/wiredtiger/src/include/session.h +++ b/src/third_party/wiredtiger/src/include/session.h @@ -76,6 +76,11 @@ struct WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) __wt_session_impl { WT_CURSOR_BACKUP *bkp_cursor; /* Hot backup cursor */ WT_COMPACT *compact; /* Compact state */ + /* + * Lookaside table cursor, sweep and eviction worker threads only. + */ + WT_CURSOR *las_cursor; /* Lookaside table cursor */ + WT_DATA_HANDLE *meta_dhandle; /* Metadata file */ void *meta_track; /* Metadata operation tracking */ void *meta_track_next; /* Current position */ diff --git a/src/third_party/wiredtiger/src/include/stat.h b/src/third_party/wiredtiger/src/include/stat.h index 6ecb6b3a3c7..cd2c149bc94 100644 --- a/src/third_party/wiredtiger/src/include/stat.h +++ b/src/third_party/wiredtiger/src/include/stat.h @@ -276,11 +276,17 @@ struct __wt_connection_stats { int64_t cache_eviction_walk; int64_t cache_eviction_worker_evicting; int64_t cache_inmem_split; + int64_t cache_inmem_splittable; + int64_t cache_lookaside_insert; + int64_t cache_lookaside_remove; int64_t cache_overhead; int64_t cache_pages_dirty; int64_t cache_pages_inuse; int64_t cache_read; + int64_t cache_read_lookaside; int64_t cache_write; + int64_t cache_write_lookaside; + int64_t cache_write_restore; int64_t cond_wait; int64_t cursor_create; int64_t cursor_insert; @@ -323,9 +329,9 @@ struct __wt_connection_stats { int64_t log_slot_consolidated; int64_t log_slot_joins; int64_t log_slot_races; - int64_t log_slot_toobig; - int64_t log_slot_toosmall; + int64_t log_slot_switch_busy; int64_t log_slot_transitions; + int64_t log_slot_unbuffered; int64_t log_sync; int64_t log_sync_dir; int64_t log_write_lsn; @@ -400,6 +406,7 @@ struct __wt_dsrc_stats { int64_t btree_column_deleted; int64_t btree_column_fix; int64_t btree_column_internal; + int64_t btree_column_rle; int64_t btree_column_variable; int64_t btree_compact_rewrite; int64_t btree_entries; @@ -424,10 +431,14 @@ struct __wt_dsrc_stats { int64_t cache_eviction_internal; int64_t cache_eviction_split; int64_t cache_inmem_split; + int64_t cache_inmem_splittable; int64_t cache_overflow_value; int64_t cache_read; + int64_t cache_read_lookaside; int64_t cache_read_overflow; int64_t cache_write; + int64_t cache_write_lookaside; + int64_t cache_write_restore; int64_t compress_raw_fail; int64_t compress_raw_fail_temporary; int64_t compress_raw_ok; diff --git a/src/third_party/wiredtiger/src/include/txn.h b/src/third_party/wiredtiger/src/include/txn.h index 0e7be1be6bc..4a325c70a95 100644 --- a/src/third_party/wiredtiger/src/include/txn.h +++ b/src/third_party/wiredtiger/src/include/txn.h @@ -78,9 +78,8 @@ struct __wt_txn_global { }; typedef enum __wt_txn_isolation { - WT_ISO_EVICTION, /* Internal: eviction context */ - WT_ISO_READ_UNCOMMITTED, WT_ISO_READ_COMMITTED, + WT_ISO_READ_UNCOMMITTED, WT_ISO_SNAPSHOT } WT_TXN_ISOLATION; diff --git a/src/third_party/wiredtiger/src/include/txn.i b/src/third_party/wiredtiger/src/include/txn.i index 1228893871f..2b42990f5e5 100644 --- a/src/third_party/wiredtiger/src/include/txn.i +++ b/src/third_party/wiredtiger/src/include/txn.i @@ -140,12 +140,22 @@ __wt_txn_oldest_id(WT_SESSION_IMPL *session) } /* + * __wt_txn_committed -- + * Return if a transaction has been committed. + */ +static inline bool +__wt_txn_committed(WT_SESSION_IMPL *session, uint64_t id) +{ + return (WT_TXNID_LT(id, S2C(session)->txn_global.last_running)); +} + +/* * __wt_txn_visible_all -- * Check if a given transaction ID is "globally visible". This is, if * all sessions in the system will see the transaction ID including the * ID that belongs to a running checkpoint. */ -static inline int +static inline bool __wt_txn_visible_all(WT_SESSION_IMPL *session, uint64_t id) { uint64_t oldest_id; @@ -159,28 +169,21 @@ __wt_txn_visible_all(WT_SESSION_IMPL *session, uint64_t id) * __wt_txn_visible -- * Can the current transaction see the given ID? */ -static inline int +static inline bool __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id) { WT_TXN *txn; - int found; + bool found; txn = &session->txn; /* Changes with no associated transaction are always visible. */ if (id == WT_TXN_NONE) - return (1); + return (true); /* Nobody sees the results of aborted transactions. */ if (id == WT_TXN_ABORTED) - return (0); - - /* - * Eviction only sees globally visible updates, or if there is a - * checkpoint transaction running, use its transaction. - */ - if (txn->isolation == WT_ISO_EVICTION) - return (__wt_txn_visible_all(session, id)); + return (false); /* * Read-uncommitted transactions see all other changes. @@ -194,11 +197,11 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id) */ if (txn->isolation == WT_ISO_READ_UNCOMMITTED || session->dhandle == session->meta_dhandle) - return (1); + return (true); /* Transactions see their own changes. */ if (id == txn->id) - return (1); + return (true); /* * WT_ISO_SNAPSHOT, WT_ISO_READ_COMMITTED: the ID is visible if it is @@ -210,9 +213,9 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id) * snapshot is empty. */ if (WT_TXNID_LE(txn->snap_max, id)) - return (0); + return (false); if (txn->snapshot_count == 0 || WT_TXNID_LT(id, txn->snap_min)) - return (1); + return (true); WT_BINARY_SEARCH(id, txn->snapshot, txn->snapshot_count, found); return (!found); @@ -266,7 +269,7 @@ __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[]) } F_SET(txn, WT_TXN_RUNNING); - return (0); + return (false); } /* @@ -477,7 +480,7 @@ __wt_txn_cursor_op(WT_SESSION_IMPL *session) * __wt_txn_am_oldest -- * Am I the oldest transaction in the system? */ -static inline int +static inline bool __wt_txn_am_oldest(WT_SESSION_IMPL *session) { WT_CONNECTION_IMPL *conn; @@ -492,12 +495,12 @@ __wt_txn_am_oldest(WT_SESSION_IMPL *session) txn_global = &conn->txn_global; if (txn->id == WT_TXN_NONE) - return (0); + return (false); WT_ORDERED_READ(session_cnt, conn->session_cnt); for (i = 0, s = txn_global->states; i < session_cnt; i++, s++) if ((id = s->id) != WT_TXN_NONE && WT_TXNID_LT(id, txn->id)) - return (0); + return (false); - return (1); + return (true); } diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in index ddcbf19b847..71ba3f41a44 100644 --- a/src/third_party/wiredtiger/src/include/wiredtiger.in +++ b/src/third_party/wiredtiger/src/include/wiredtiger.in @@ -1750,6 +1750,9 @@ struct __wt_connection { * @config{ name, the name of a cache that * is shared between databases or \c "none" when no shared cache is * configured., a string; default \c none.} + * @config{ quota, maximum size of cache this + * database can be allocated from the shared cache. Defaults to the + * entire shared cache size., an integer; default \c 0.} * @config{ reserve, amount of cache this * database is guaranteed to have available from the shared cache. This * setting is per database. Defaults to the chunk size., an integer; @@ -2216,10 +2219,12 @@ struct __wt_connection { * @config{ name, the name of a cache that is shared * between databases or \c "none" when no shared cache is configured., a string; * default \c none.} - * @config{ reserve, amount of cache - * this database is guaranteed to have available from the shared cache. This - * setting is per database. Defaults to the chunk size., an integer; default \c - * 0.} + * @config{ quota, maximum size of + * cache this database can be allocated from the shared cache. Defaults to the + * entire shared cache size., an integer; default \c 0.} + * @config{ reserve, amount of cache this database is + * guaranteed to have available from the shared cache. This setting is per + * database. Defaults to the chunk size., an integer; default \c 0.} * @config{ size, maximum memory to allocate for the * shared cache. Setting this will update the value if one is already set., an * integer between 1MB and 10TB; default \c 500MB.} @@ -3642,198 +3647,210 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1047 /*! cache: in-memory page splits */ #define WT_STAT_CONN_CACHE_INMEM_SPLIT 1048 +/*! cache: in-memory page passed criteria to be split */ +#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1049 +/*! cache: lookaside table insert calls */ +#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1050 +/*! cache: lookaside table remove calls */ +#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1051 /*! cache: percentage overhead */ -#define WT_STAT_CONN_CACHE_OVERHEAD 1049 +#define WT_STAT_CONN_CACHE_OVERHEAD 1052 /*! cache: tracked dirty pages in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1050 +#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1053 /*! cache: pages currently held in the cache */ -#define WT_STAT_CONN_CACHE_PAGES_INUSE 1051 +#define WT_STAT_CONN_CACHE_PAGES_INUSE 1054 /*! cache: pages read into cache */ -#define WT_STAT_CONN_CACHE_READ 1052 +#define WT_STAT_CONN_CACHE_READ 1055 +/*! cache: pages read into cache requiring lookaside entries */ +#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1056 /*! cache: pages written from cache */ -#define WT_STAT_CONN_CACHE_WRITE 1053 +#define WT_STAT_CONN_CACHE_WRITE 1057 +/*! cache: page written requiring lookaside records */ +#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1058 +/*! cache: pages written requiring in-memory restoration */ +#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1059 /*! connection: pthread mutex condition wait calls */ -#define WT_STAT_CONN_COND_WAIT 1054 +#define WT_STAT_CONN_COND_WAIT 1060 /*! cursor: cursor create calls */ -#define WT_STAT_CONN_CURSOR_CREATE 1055 +#define WT_STAT_CONN_CURSOR_CREATE 1061 /*! cursor: cursor insert calls */ -#define WT_STAT_CONN_CURSOR_INSERT 1056 +#define WT_STAT_CONN_CURSOR_INSERT 1062 /*! cursor: cursor next calls */ -#define WT_STAT_CONN_CURSOR_NEXT 1057 +#define WT_STAT_CONN_CURSOR_NEXT 1063 /*! cursor: cursor prev calls */ -#define WT_STAT_CONN_CURSOR_PREV 1058 +#define WT_STAT_CONN_CURSOR_PREV 1064 /*! cursor: cursor remove calls */ -#define WT_STAT_CONN_CURSOR_REMOVE 1059 +#define WT_STAT_CONN_CURSOR_REMOVE 1065 /*! cursor: cursor reset calls */ -#define WT_STAT_CONN_CURSOR_RESET 1060 +#define WT_STAT_CONN_CURSOR_RESET 1066 /*! cursor: cursor restarted searches */ -#define WT_STAT_CONN_CURSOR_RESTART 1061 +#define WT_STAT_CONN_CURSOR_RESTART 1067 /*! cursor: cursor search calls */ -#define WT_STAT_CONN_CURSOR_SEARCH 1062 +#define WT_STAT_CONN_CURSOR_SEARCH 1068 /*! cursor: cursor search near calls */ -#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1063 +#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1069 /*! cursor: cursor update calls */ -#define WT_STAT_CONN_CURSOR_UPDATE 1064 +#define WT_STAT_CONN_CURSOR_UPDATE 1070 /*! data-handle: connection data handles currently active */ -#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1065 +#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1071 /*! data-handle: session dhandles swept */ -#define WT_STAT_CONN_DH_SESSION_HANDLES 1066 +#define WT_STAT_CONN_DH_SESSION_HANDLES 1072 /*! data-handle: session sweep attempts */ -#define WT_STAT_CONN_DH_SESSION_SWEEPS 1067 +#define WT_STAT_CONN_DH_SESSION_SWEEPS 1073 /*! data-handle: connection sweep dhandles closed */ -#define WT_STAT_CONN_DH_SWEEP_CLOSE 1068 +#define WT_STAT_CONN_DH_SWEEP_CLOSE 1074 /*! data-handle: connection sweep candidate became referenced */ -#define WT_STAT_CONN_DH_SWEEP_REF 1069 +#define WT_STAT_CONN_DH_SWEEP_REF 1075 /*! data-handle: connection sweep dhandles removed from hash list */ -#define WT_STAT_CONN_DH_SWEEP_REMOVE 1070 +#define WT_STAT_CONN_DH_SWEEP_REMOVE 1076 /*! data-handle: connection sweep time-of-death sets */ -#define WT_STAT_CONN_DH_SWEEP_TOD 1071 +#define WT_STAT_CONN_DH_SWEEP_TOD 1077 /*! data-handle: connection sweeps */ -#define WT_STAT_CONN_DH_SWEEPS 1072 +#define WT_STAT_CONN_DH_SWEEPS 1078 /*! connection: files currently open */ -#define WT_STAT_CONN_FILE_OPEN 1073 +#define WT_STAT_CONN_FILE_OPEN 1079 /*! log: total log buffer size */ -#define WT_STAT_CONN_LOG_BUFFER_SIZE 1074 +#define WT_STAT_CONN_LOG_BUFFER_SIZE 1080 /*! log: log bytes of payload data */ -#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1075 +#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1081 /*! log: log bytes written */ -#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1076 +#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1082 /*! log: yields waiting for previous log file close */ -#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1077 +#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1083 /*! log: total size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_LEN 1078 +#define WT_STAT_CONN_LOG_COMPRESS_LEN 1084 /*! log: total in-memory size of compressed records */ -#define WT_STAT_CONN_LOG_COMPRESS_MEM 1079 +#define WT_STAT_CONN_LOG_COMPRESS_MEM 1085 /*! log: log records too small to compress */ -#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1080 +#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1086 /*! log: log records not compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1081 +#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1087 /*! log: log records compressed */ -#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1082 +#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1088 /*! log: maximum log file size */ -#define WT_STAT_CONN_LOG_MAX_FILESIZE 1083 +#define WT_STAT_CONN_LOG_MAX_FILESIZE 1089 /*! log: pre-allocated log files prepared */ -#define WT_STAT_CONN_LOG_PREALLOC_FILES 1084 +#define WT_STAT_CONN_LOG_PREALLOC_FILES 1090 /*! log: number of pre-allocated log files to create */ -#define WT_STAT_CONN_LOG_PREALLOC_MAX 1085 +#define WT_STAT_CONN_LOG_PREALLOC_MAX 1091 /*! log: pre-allocated log files used */ -#define WT_STAT_CONN_LOG_PREALLOC_USED 1086 +#define WT_STAT_CONN_LOG_PREALLOC_USED 1092 /*! log: log release advances write LSN */ -#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1087 +#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1093 /*! log: records processed by log scan */ -#define WT_STAT_CONN_LOG_SCAN_RECORDS 1088 +#define WT_STAT_CONN_LOG_SCAN_RECORDS 1094 /*! log: log scan records requiring two reads */ -#define WT_STAT_CONN_LOG_SCAN_REREADS 1089 +#define WT_STAT_CONN_LOG_SCAN_REREADS 1095 /*! log: log scan operations */ -#define WT_STAT_CONN_LOG_SCANS 1090 +#define WT_STAT_CONN_LOG_SCANS 1096 /*! log: consolidated slot closures */ -#define WT_STAT_CONN_LOG_SLOT_CLOSES 1091 +#define WT_STAT_CONN_LOG_SLOT_CLOSES 1097 /*! log: written slots coalesced */ -#define WT_STAT_CONN_LOG_SLOT_COALESCED 1092 +#define WT_STAT_CONN_LOG_SLOT_COALESCED 1098 /*! log: logging bytes consolidated */ -#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1093 +#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1099 /*! log: consolidated slot joins */ -#define WT_STAT_CONN_LOG_SLOT_JOINS 1094 +#define WT_STAT_CONN_LOG_SLOT_JOINS 1100 /*! log: consolidated slot join races */ -#define WT_STAT_CONN_LOG_SLOT_RACES 1095 -/*! log: record size exceeded maximum */ -#define WT_STAT_CONN_LOG_SLOT_TOOBIG 1096 -/*! log: failed to find a slot large enough for record */ -#define WT_STAT_CONN_LOG_SLOT_TOOSMALL 1097 +#define WT_STAT_CONN_LOG_SLOT_RACES 1101 +/*! log: busy returns attempting to switch slots */ +#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1102 /*! log: consolidated slot join transitions */ -#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1098 +#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1103 +/*! log: consolidated slot unbuffered writes */ +#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1104 /*! log: log sync operations */ -#define WT_STAT_CONN_LOG_SYNC 1099 +#define WT_STAT_CONN_LOG_SYNC 1105 /*! log: log sync_dir operations */ -#define WT_STAT_CONN_LOG_SYNC_DIR 1100 +#define WT_STAT_CONN_LOG_SYNC_DIR 1106 /*! log: log server thread advances write LSN */ -#define WT_STAT_CONN_LOG_WRITE_LSN 1101 +#define WT_STAT_CONN_LOG_WRITE_LSN 1107 /*! log: log write operations */ -#define WT_STAT_CONN_LOG_WRITES 1102 +#define WT_STAT_CONN_LOG_WRITES 1108 /*! LSM: sleep for LSM checkpoint throttle */ -#define WT_STAT_CONN_LSM_CHECKPOINT_THROTTLE 1103 +#define WT_STAT_CONN_LSM_CHECKPOINT_THROTTLE 1109 /*! LSM: sleep for LSM merge throttle */ -#define WT_STAT_CONN_LSM_MERGE_THROTTLE 1104 +#define WT_STAT_CONN_LSM_MERGE_THROTTLE 1110 /*! LSM: rows merged in an LSM tree */ -#define WT_STAT_CONN_LSM_ROWS_MERGED 1105 +#define WT_STAT_CONN_LSM_ROWS_MERGED 1111 /*! LSM: application work units currently queued */ -#define WT_STAT_CONN_LSM_WORK_QUEUE_APP 1106 +#define WT_STAT_CONN_LSM_WORK_QUEUE_APP 1112 /*! LSM: merge work units currently queued */ -#define WT_STAT_CONN_LSM_WORK_QUEUE_MANAGER 1107 +#define WT_STAT_CONN_LSM_WORK_QUEUE_MANAGER 1113 /*! LSM: tree queue hit maximum */ -#define WT_STAT_CONN_LSM_WORK_QUEUE_MAX 1108 +#define WT_STAT_CONN_LSM_WORK_QUEUE_MAX 1114 /*! LSM: switch work units currently queued */ -#define WT_STAT_CONN_LSM_WORK_QUEUE_SWITCH 1109 +#define WT_STAT_CONN_LSM_WORK_QUEUE_SWITCH 1115 /*! LSM: tree maintenance operations scheduled */ -#define WT_STAT_CONN_LSM_WORK_UNITS_CREATED 1110 +#define WT_STAT_CONN_LSM_WORK_UNITS_CREATED 1116 /*! LSM: tree maintenance operations discarded */ -#define WT_STAT_CONN_LSM_WORK_UNITS_DISCARDED 1111 +#define WT_STAT_CONN_LSM_WORK_UNITS_DISCARDED 1117 /*! LSM: tree maintenance operations executed */ -#define WT_STAT_CONN_LSM_WORK_UNITS_DONE 1112 +#define WT_STAT_CONN_LSM_WORK_UNITS_DONE 1118 /*! connection: memory allocations */ -#define WT_STAT_CONN_MEMORY_ALLOCATION 1113 +#define WT_STAT_CONN_MEMORY_ALLOCATION 1119 /*! connection: memory frees */ -#define WT_STAT_CONN_MEMORY_FREE 1114 +#define WT_STAT_CONN_MEMORY_FREE 1120 /*! connection: memory re-allocations */ -#define WT_STAT_CONN_MEMORY_GROW 1115 +#define WT_STAT_CONN_MEMORY_GROW 1121 /*! thread-yield: page acquire busy blocked */ -#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1116 +#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1122 /*! thread-yield: page acquire eviction blocked */ -#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1117 +#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1123 /*! thread-yield: page acquire locked blocked */ -#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1118 +#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1124 /*! thread-yield: page acquire read blocked */ -#define WT_STAT_CONN_PAGE_READ_BLOCKED 1119 +#define WT_STAT_CONN_PAGE_READ_BLOCKED 1125 /*! thread-yield: page acquire time sleeping (usecs) */ -#define WT_STAT_CONN_PAGE_SLEEP 1120 +#define WT_STAT_CONN_PAGE_SLEEP 1126 /*! connection: total read I/Os */ -#define WT_STAT_CONN_READ_IO 1121 +#define WT_STAT_CONN_READ_IO 1127 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_CONN_REC_PAGES 1122 +#define WT_STAT_CONN_REC_PAGES 1128 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_CONN_REC_PAGES_EVICTION 1123 +#define WT_STAT_CONN_REC_PAGES_EVICTION 1129 /*! reconciliation: split bytes currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1124 +#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1130 /*! reconciliation: split objects currently awaiting free */ -#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1125 +#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1131 /*! connection: pthread mutex shared lock read-lock calls */ -#define WT_STAT_CONN_RWLOCK_READ 1126 +#define WT_STAT_CONN_RWLOCK_READ 1132 /*! connection: pthread mutex shared lock write-lock calls */ -#define WT_STAT_CONN_RWLOCK_WRITE 1127 +#define WT_STAT_CONN_RWLOCK_WRITE 1133 /*! session: open cursor count */ -#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1128 +#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1134 /*! session: open session count */ -#define WT_STAT_CONN_SESSION_OPEN 1129 +#define WT_STAT_CONN_SESSION_OPEN 1135 /*! transaction: transaction begins */ -#define WT_STAT_CONN_TXN_BEGIN 1130 +#define WT_STAT_CONN_TXN_BEGIN 1136 /*! transaction: transaction checkpoints */ -#define WT_STAT_CONN_TXN_CHECKPOINT 1131 +#define WT_STAT_CONN_TXN_CHECKPOINT 1137 /*! transaction: transaction checkpoint generation */ -#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1132 +#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1138 /*! transaction: transaction checkpoint currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1133 +#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1139 /*! transaction: transaction checkpoint max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1134 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1140 /*! transaction: transaction checkpoint min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1135 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1141 /*! transaction: transaction checkpoint most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1136 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1142 /*! transaction: transaction checkpoint total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1137 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1143 /*! transaction: transactions committed */ -#define WT_STAT_CONN_TXN_COMMIT 1138 +#define WT_STAT_CONN_TXN_COMMIT 1144 /*! transaction: transaction failures due to cache overflow */ -#define WT_STAT_CONN_TXN_FAIL_CACHE 1139 +#define WT_STAT_CONN_TXN_FAIL_CACHE 1145 /*! transaction: transaction range of IDs currently pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1140 +#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1146 /*! transaction: transaction range of IDs currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_RANGE 1141 +#define WT_STAT_CONN_TXN_PINNED_RANGE 1147 /*! transaction: transactions rolled back */ -#define WT_STAT_CONN_TXN_ROLLBACK 1142 +#define WT_STAT_CONN_TXN_ROLLBACK 1148 /*! transaction: transaction sync calls */ -#define WT_STAT_CONN_TXN_SYNC 1143 +#define WT_STAT_CONN_TXN_SYNC 1149 /*! connection: total write I/Os */ -#define WT_STAT_CONN_WRITE_IO 1144 +#define WT_STAT_CONN_WRITE_IO 1150 /*! * @} @@ -3883,148 +3900,158 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_DSRC_BTREE_COLUMN_FIX 2019 /*! btree: column-store internal pages */ #define WT_STAT_DSRC_BTREE_COLUMN_INTERNAL 2020 +/*! btree: column-store variable-size RLE encoded values */ +#define WT_STAT_DSRC_BTREE_COLUMN_RLE 2021 /*! btree: column-store variable-size leaf pages */ -#define WT_STAT_DSRC_BTREE_COLUMN_VARIABLE 2021 +#define WT_STAT_DSRC_BTREE_COLUMN_VARIABLE 2022 /*! btree: pages rewritten by compaction */ -#define WT_STAT_DSRC_BTREE_COMPACT_REWRITE 2022 +#define WT_STAT_DSRC_BTREE_COMPACT_REWRITE 2023 /*! btree: number of key/value pairs */ -#define WT_STAT_DSRC_BTREE_ENTRIES 2023 +#define WT_STAT_DSRC_BTREE_ENTRIES 2024 /*! btree: fixed-record size */ -#define WT_STAT_DSRC_BTREE_FIXED_LEN 2024 +#define WT_STAT_DSRC_BTREE_FIXED_LEN 2025 /*! btree: maximum tree depth */ -#define WT_STAT_DSRC_BTREE_MAXIMUM_DEPTH 2025 +#define WT_STAT_DSRC_BTREE_MAXIMUM_DEPTH 2026 /*! btree: maximum internal page key size */ -#define WT_STAT_DSRC_BTREE_MAXINTLKEY 2026 +#define WT_STAT_DSRC_BTREE_MAXINTLKEY 2027 /*! btree: maximum internal page size */ -#define WT_STAT_DSRC_BTREE_MAXINTLPAGE 2027 +#define WT_STAT_DSRC_BTREE_MAXINTLPAGE 2028 /*! btree: maximum leaf page key size */ -#define WT_STAT_DSRC_BTREE_MAXLEAFKEY 2028 +#define WT_STAT_DSRC_BTREE_MAXLEAFKEY 2029 /*! btree: maximum leaf page size */ -#define WT_STAT_DSRC_BTREE_MAXLEAFPAGE 2029 +#define WT_STAT_DSRC_BTREE_MAXLEAFPAGE 2030 /*! btree: maximum leaf page value size */ -#define WT_STAT_DSRC_BTREE_MAXLEAFVALUE 2030 +#define WT_STAT_DSRC_BTREE_MAXLEAFVALUE 2031 /*! btree: overflow pages */ -#define WT_STAT_DSRC_BTREE_OVERFLOW 2031 +#define WT_STAT_DSRC_BTREE_OVERFLOW 2032 /*! btree: row-store internal pages */ -#define WT_STAT_DSRC_BTREE_ROW_INTERNAL 2032 +#define WT_STAT_DSRC_BTREE_ROW_INTERNAL 2033 /*! btree: row-store leaf pages */ -#define WT_STAT_DSRC_BTREE_ROW_LEAF 2033 +#define WT_STAT_DSRC_BTREE_ROW_LEAF 2034 /*! cache: bytes read into cache */ -#define WT_STAT_DSRC_CACHE_BYTES_READ 2034 +#define WT_STAT_DSRC_CACHE_BYTES_READ 2035 /*! cache: bytes written from cache */ -#define WT_STAT_DSRC_CACHE_BYTES_WRITE 2035 +#define WT_STAT_DSRC_CACHE_BYTES_WRITE 2036 /*! cache: checkpoint blocked page eviction */ -#define WT_STAT_DSRC_CACHE_EVICTION_CHECKPOINT 2036 +#define WT_STAT_DSRC_CACHE_EVICTION_CHECKPOINT 2037 /*! cache: unmodified pages evicted */ -#define WT_STAT_DSRC_CACHE_EVICTION_CLEAN 2037 +#define WT_STAT_DSRC_CACHE_EVICTION_CLEAN 2038 /*! cache: page split during eviction deepened the tree */ -#define WT_STAT_DSRC_CACHE_EVICTION_DEEPEN 2038 +#define WT_STAT_DSRC_CACHE_EVICTION_DEEPEN 2039 /*! cache: modified pages evicted */ -#define WT_STAT_DSRC_CACHE_EVICTION_DIRTY 2039 +#define WT_STAT_DSRC_CACHE_EVICTION_DIRTY 2040 /*! cache: data source pages selected for eviction unable to be evicted */ -#define WT_STAT_DSRC_CACHE_EVICTION_FAIL 2040 +#define WT_STAT_DSRC_CACHE_EVICTION_FAIL 2041 /*! cache: hazard pointer blocked page eviction */ -#define WT_STAT_DSRC_CACHE_EVICTION_HAZARD 2041 +#define WT_STAT_DSRC_CACHE_EVICTION_HAZARD 2042 /*! cache: internal pages evicted */ -#define WT_STAT_DSRC_CACHE_EVICTION_INTERNAL 2042 +#define WT_STAT_DSRC_CACHE_EVICTION_INTERNAL 2043 /*! cache: pages split during eviction */ -#define WT_STAT_DSRC_CACHE_EVICTION_SPLIT 2043 +#define WT_STAT_DSRC_CACHE_EVICTION_SPLIT 2044 /*! cache: in-memory page splits */ -#define WT_STAT_DSRC_CACHE_INMEM_SPLIT 2044 +#define WT_STAT_DSRC_CACHE_INMEM_SPLIT 2045 +/*! cache: in-memory page passed criteria to be split */ +#define WT_STAT_DSRC_CACHE_INMEM_SPLITTABLE 2046 /*! cache: overflow values cached in memory */ -#define WT_STAT_DSRC_CACHE_OVERFLOW_VALUE 2045 +#define WT_STAT_DSRC_CACHE_OVERFLOW_VALUE 2047 /*! cache: pages read into cache */ -#define WT_STAT_DSRC_CACHE_READ 2046 +#define WT_STAT_DSRC_CACHE_READ 2048 +/*! cache: pages read into cache requiring lookaside entries */ +#define WT_STAT_DSRC_CACHE_READ_LOOKASIDE 2049 /*! cache: overflow pages read into cache */ -#define WT_STAT_DSRC_CACHE_READ_OVERFLOW 2047 +#define WT_STAT_DSRC_CACHE_READ_OVERFLOW 2050 /*! cache: pages written from cache */ -#define WT_STAT_DSRC_CACHE_WRITE 2048 +#define WT_STAT_DSRC_CACHE_WRITE 2051 +/*! cache: page written requiring lookaside records */ +#define WT_STAT_DSRC_CACHE_WRITE_LOOKASIDE 2052 +/*! cache: pages written requiring in-memory restoration */ +#define WT_STAT_DSRC_CACHE_WRITE_RESTORE 2053 /*! compression: raw compression call failed, no additional data available */ -#define WT_STAT_DSRC_COMPRESS_RAW_FAIL 2049 +#define WT_STAT_DSRC_COMPRESS_RAW_FAIL 2054 /*! compression: raw compression call failed, additional data available */ -#define WT_STAT_DSRC_COMPRESS_RAW_FAIL_TEMPORARY 2050 +#define WT_STAT_DSRC_COMPRESS_RAW_FAIL_TEMPORARY 2055 /*! compression: raw compression call succeeded */ -#define WT_STAT_DSRC_COMPRESS_RAW_OK 2051 +#define WT_STAT_DSRC_COMPRESS_RAW_OK 2056 /*! compression: compressed pages read */ -#define WT_STAT_DSRC_COMPRESS_READ 2052 +#define WT_STAT_DSRC_COMPRESS_READ 2057 /*! compression: compressed pages written */ -#define WT_STAT_DSRC_COMPRESS_WRITE 2053 +#define WT_STAT_DSRC_COMPRESS_WRITE 2058 /*! compression: page written failed to compress */ -#define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 2054 +#define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 2059 /*! compression: page written was too small to compress */ -#define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 2055 +#define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 2060 /*! cursor: create calls */ -#define WT_STAT_DSRC_CURSOR_CREATE 2056 +#define WT_STAT_DSRC_CURSOR_CREATE 2061 /*! cursor: insert calls */ -#define WT_STAT_DSRC_CURSOR_INSERT 2057 +#define WT_STAT_DSRC_CURSOR_INSERT 2062 /*! cursor: bulk-loaded cursor-insert calls */ -#define WT_STAT_DSRC_CURSOR_INSERT_BULK 2058 +#define WT_STAT_DSRC_CURSOR_INSERT_BULK 2063 /*! cursor: cursor-insert key and value bytes inserted */ -#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 2059 +#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 2064 /*! cursor: next calls */ -#define WT_STAT_DSRC_CURSOR_NEXT 2060 +#define WT_STAT_DSRC_CURSOR_NEXT 2065 /*! cursor: prev calls */ -#define WT_STAT_DSRC_CURSOR_PREV 2061 +#define WT_STAT_DSRC_CURSOR_PREV 2066 /*! cursor: remove calls */ -#define WT_STAT_DSRC_CURSOR_REMOVE 2062 +#define WT_STAT_DSRC_CURSOR_REMOVE 2067 /*! cursor: cursor-remove key bytes removed */ -#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 2063 +#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 2068 /*! cursor: reset calls */ -#define WT_STAT_DSRC_CURSOR_RESET 2064 +#define WT_STAT_DSRC_CURSOR_RESET 2069 /*! cursor: restarted searches */ -#define WT_STAT_DSRC_CURSOR_RESTART 2065 +#define WT_STAT_DSRC_CURSOR_RESTART 2070 /*! cursor: search calls */ -#define WT_STAT_DSRC_CURSOR_SEARCH 2066 +#define WT_STAT_DSRC_CURSOR_SEARCH 2071 /*! cursor: search near calls */ -#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 2067 +#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 2072 /*! cursor: update calls */ -#define WT_STAT_DSRC_CURSOR_UPDATE 2068 +#define WT_STAT_DSRC_CURSOR_UPDATE 2073 /*! cursor: cursor-update value bytes updated */ -#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 2069 +#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 2074 /*! LSM: sleep for LSM checkpoint throttle */ -#define WT_STAT_DSRC_LSM_CHECKPOINT_THROTTLE 2070 +#define WT_STAT_DSRC_LSM_CHECKPOINT_THROTTLE 2075 /*! LSM: chunks in the LSM tree */ -#define WT_STAT_DSRC_LSM_CHUNK_COUNT 2071 +#define WT_STAT_DSRC_LSM_CHUNK_COUNT 2076 /*! LSM: highest merge generation in the LSM tree */ -#define WT_STAT_DSRC_LSM_GENERATION_MAX 2072 +#define WT_STAT_DSRC_LSM_GENERATION_MAX 2077 /*! LSM: queries that could have benefited from a Bloom filter that did * not exist */ -#define WT_STAT_DSRC_LSM_LOOKUP_NO_BLOOM 2073 +#define WT_STAT_DSRC_LSM_LOOKUP_NO_BLOOM 2078 /*! LSM: sleep for LSM merge throttle */ -#define WT_STAT_DSRC_LSM_MERGE_THROTTLE 2074 +#define WT_STAT_DSRC_LSM_MERGE_THROTTLE 2079 /*! reconciliation: dictionary matches */ -#define WT_STAT_DSRC_REC_DICTIONARY 2075 +#define WT_STAT_DSRC_REC_DICTIONARY 2080 /*! reconciliation: internal page multi-block writes */ -#define WT_STAT_DSRC_REC_MULTIBLOCK_INTERNAL 2076 +#define WT_STAT_DSRC_REC_MULTIBLOCK_INTERNAL 2081 /*! reconciliation: leaf page multi-block writes */ -#define WT_STAT_DSRC_REC_MULTIBLOCK_LEAF 2077 +#define WT_STAT_DSRC_REC_MULTIBLOCK_LEAF 2082 /*! reconciliation: maximum blocks required for a page */ -#define WT_STAT_DSRC_REC_MULTIBLOCK_MAX 2078 +#define WT_STAT_DSRC_REC_MULTIBLOCK_MAX 2083 /*! reconciliation: internal-page overflow keys */ -#define WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL 2079 +#define WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL 2084 /*! reconciliation: leaf-page overflow keys */ -#define WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF 2080 +#define WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF 2085 /*! reconciliation: overflow values written */ -#define WT_STAT_DSRC_REC_OVERFLOW_VALUE 2081 +#define WT_STAT_DSRC_REC_OVERFLOW_VALUE 2086 /*! reconciliation: pages deleted */ -#define WT_STAT_DSRC_REC_PAGE_DELETE 2082 +#define WT_STAT_DSRC_REC_PAGE_DELETE 2087 /*! reconciliation: page checksum matches */ -#define WT_STAT_DSRC_REC_PAGE_MATCH 2083 +#define WT_STAT_DSRC_REC_PAGE_MATCH 2088 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_DSRC_REC_PAGES 2084 +#define WT_STAT_DSRC_REC_PAGES 2089 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_DSRC_REC_PAGES_EVICTION 2085 +#define WT_STAT_DSRC_REC_PAGES_EVICTION 2090 /*! reconciliation: leaf page key bytes discarded using prefix compression */ -#define WT_STAT_DSRC_REC_PREFIX_COMPRESSION 2086 +#define WT_STAT_DSRC_REC_PREFIX_COMPRESSION 2091 /*! reconciliation: internal page key bytes discarded using suffix * compression */ -#define WT_STAT_DSRC_REC_SUFFIX_COMPRESSION 2087 +#define WT_STAT_DSRC_REC_SUFFIX_COMPRESSION 2092 /*! session: object compaction */ -#define WT_STAT_DSRC_SESSION_COMPACT 2088 +#define WT_STAT_DSRC_SESSION_COMPACT 2093 /*! session: open cursor count */ -#define WT_STAT_DSRC_SESSION_CURSOR_OPEN 2089 +#define WT_STAT_DSRC_SESSION_CURSOR_OPEN 2094 /*! transaction: update conflicts */ -#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 2090 +#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 2095 /*! @} */ /* * Statistics section: END diff --git a/src/third_party/wiredtiger/src/include/wt_internal.h b/src/third_party/wiredtiger/src/include/wt_internal.h index 9cc2ce2135a..4d46a25b63c 100644 --- a/src/third_party/wiredtiger/src/include/wt_internal.h +++ b/src/third_party/wiredtiger/src/include/wt_internal.h @@ -41,6 +41,7 @@ extern "C" { #else #include <pthread.h> #endif +#include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdint.h> @@ -245,6 +246,8 @@ struct __wt_rwlock; typedef struct __wt_rwlock WT_RWLOCK; struct __wt_salvage_cookie; typedef struct __wt_salvage_cookie WT_SALVAGE_COOKIE; +struct __wt_save_upd; + typedef struct __wt_save_upd WT_SAVE_UPD; struct __wt_scratch_track; typedef struct __wt_scratch_track WT_SCRATCH_TRACK; struct __wt_session_impl; @@ -265,8 +268,6 @@ struct __wt_txn_op; typedef struct __wt_txn_op WT_TXN_OP; struct __wt_txn_state; typedef struct __wt_txn_state WT_TXN_STATE; -struct __wt_upd_skipped; - typedef struct __wt_upd_skipped WT_UPD_SKIPPED; struct __wt_update; typedef struct __wt_update WT_UPDATE; union __wt_rand_state; @@ -335,6 +336,7 @@ union __wt_rand_state; #include "cache.i" /* required by txn.i */ #include "cell.i" /* required by btree.i */ +#include "log.i" #include "mutex.i" /* required by btree.i */ #include "txn.i" /* required by btree.i */ |