summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2016-05-05 15:38:12 +1000
committerMichael Cahill <michael.cahill@mongodb.com>2016-05-05 15:38:12 +1000
commit636a7b25ef3eca6b98009330f4d35337d4f35717 (patch)
tree7cc2e03ad96e206cbe73343feef10197023a37da /src/include
parenteaa7b5f0fcc62f356c33a2c56f45b609a73ca5dd (diff)
parent75c22bc0c662622c14e5c47d99ff262cede2c6bf (diff)
Merge branch 'develop' into mongodb-3.4mongodb-3.3.6
Diffstat (limited to 'src/include')
-rw-r--r--src/include/api.h2
-rw-r--r--src/include/bitstring.i14
-rw-r--r--src/include/block.h9
-rw-r--r--src/include/btmem.h83
-rw-r--r--src/include/btree.i22
-rw-r--r--src/include/cache.h26
-rw-r--r--src/include/column.i24
-rw-r--r--src/include/config.h71
-rw-r--r--src/include/connection.h44
-rw-r--r--src/include/cursor.h56
-rw-r--r--src/include/cursor.i2
-rw-r--r--src/include/extern.h61
-rw-r--r--src/include/flags.h5
-rw-r--r--src/include/log.h6
-rw-r--r--src/include/meta.h2
-rw-r--r--src/include/misc.h5
-rw-r--r--src/include/misc.i245
-rw-r--r--src/include/os.h128
-rw-r--r--src/include/os_fhandle.i154
-rw-r--r--src/include/os_fs.i243
-rw-r--r--src/include/os_fstream.i97
-rw-r--r--src/include/serial.i2
-rw-r--r--src/include/stat.h7
-rw-r--r--src/include/txn.h9
-rw-r--r--src/include/txn.i12
-rw-r--r--src/include/wiredtiger.in895
-rw-r--r--src/include/wt_internal.h26
27 files changed, 1538 insertions, 712 deletions
diff --git a/src/include/api.h b/src/include/api.h
index c6a5af40698..50b2eab83b8 100644
--- a/src/include/api.h
+++ b/src/include/api.h
@@ -118,7 +118,7 @@
#define JOINABLE_CURSOR_CALL_CHECK(cur) \
if (F_ISSET(cur, WT_CURSTD_JOINED)) \
- WT_ERR(__wt_curindex_joined(cur))
+ WT_ERR(__wt_curjoin_joined(cur))
#define JOINABLE_CURSOR_API_CALL(cur, s, n, bt) \
CURSOR_API_CALL(cur, s, n, bt); \
diff --git a/src/include/bitstring.i b/src/include/bitstring.i
index 0d30e55d1ef..08746beb9b9 100644
--- a/src/include/bitstring.i
+++ b/src/include/bitstring.i
@@ -261,10 +261,10 @@ __bit_getv(uint8_t *bitf, uint64_t entry, uint8_t width)
* Return a record number's bit-field value.
*/
static inline uint8_t
-__bit_getv_recno(WT_PAGE *page, uint64_t recno, uint8_t width)
+__bit_getv_recno(WT_REF *ref, uint64_t recno, uint8_t width)
{
return (__bit_getv(
- page->pg_fix_bitf, recno - page->pg_fix_recno, width));
+ ref->page->pg_fix_bitf, recno - ref->ref_recno, width));
}
/*
@@ -305,13 +305,3 @@ __bit_setv(uint8_t *bitf, uint64_t entry, uint8_t width, uint8_t value)
__BIT_SET(1, 0x01);
}
}
-
-/*
- * __bit_setv_recno --
- * Set a record number's bit-field value.
- */
-static inline void
-__bit_setv_recno(WT_PAGE *page, uint64_t recno, uint8_t width, uint8_t value)
-{
- __bit_setv(page->pg_fix_bitf, recno - page->pg_fix_recno, width, value);
-}
diff --git a/src/include/block.h b/src/include/block.h
index e964fb4e8c2..9f652ceddb9 100644
--- a/src/include/block.h
+++ b/src/include/block.h
@@ -174,6 +174,7 @@ struct __wt_bm {
int (*compact_start)(WT_BM *, WT_SESSION_IMPL *);
int (*free)(WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t);
bool (*is_mapped)(WT_BM *, WT_SESSION_IMPL *);
+ int (*map_discard)(WT_BM *, WT_SESSION_IMPL *, void *, size_t);
int (*preload)(WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t);
int (*read)
(WT_BM *, WT_SESSION_IMPL *, WT_ITEM *, const uint8_t *, size_t);
@@ -196,9 +197,9 @@ struct __wt_bm {
WT_BLOCK *block; /* Underlying file */
- void *map; /* Mapped region */
- size_t maplen;
- void *mappingcookie;
+ void *map; /* Mapped region */
+ size_t maplen;
+ void *mapped_cookie;
/*
* There's only a single block manager handle that can be written, all
@@ -224,8 +225,6 @@ struct __wt_block {
wt_off_t size; /* File size */
wt_off_t extend_size; /* File extended size */
wt_off_t extend_len; /* File extend chunk size */
- bool nowait_sync_available; /* File can flush asynchronously */
- bool preload_available; /* File pages can be preloaded */
/* Configuration information, set when the file is opened. */
uint32_t allocfirst; /* Allocation is first-fit */
diff --git a/src/include/btmem.h b/src/include/btmem.h
index 7cdf2bef43a..9700b6f4761 100644
--- a/src/include/btmem.h
+++ b/src/include/btmem.h
@@ -251,6 +251,7 @@ struct __wt_page_modify {
*/
union {
WT_ADDR replace; /* Single, written replacement block */
+#undef mod_replace
#define mod_replace u1.replace
struct { /* Multiple replacement blocks */
@@ -295,7 +296,9 @@ struct __wt_page_modify {
} *multi;
uint32_t multi_entries; /* Multiple blocks element count */
} m;
+#undef mod_multi
#define mod_multi u1.m.multi
+#undef mod_multi_entries
#define mod_multi_entries u1.m.multi_entries
} u1;
@@ -318,6 +321,7 @@ struct __wt_page_modify {
*/
WT_PAGE *root_split; /* Linked list of root split pages */
} intl;
+#undef mod_root_split
#define mod_root_split u2.intl.root_split
struct {
/*
@@ -344,10 +348,24 @@ struct __wt_page_modify {
* write any implicitly created deleted records for the page.
*/
uint64_t split_recno;
- } leaf;
-#define mod_append u2.leaf.append
-#define mod_update u2.leaf.update
-#define mod_split_recno u2.leaf.split_recno
+ } column_leaf;
+#undef mod_col_append
+#define mod_col_append u2.column_leaf.append
+#undef mod_col_update
+#define mod_col_update u2.column_leaf.update
+#undef mod_col_split_recno
+#define mod_col_split_recno u2.column_leaf.split_recno
+ struct {
+ /* Inserted items for row-store. */
+ WT_INSERT_HEAD **insert;
+
+ /* Updated items for row-stores. */
+ WT_UPDATE **update;
+ } row_leaf;
+#undef mod_row_insert
+#define mod_row_insert u2.row_leaf.insert
+#undef mod_row_update
+#define mod_row_update u2.row_leaf.update
} u2;
/*
@@ -433,7 +451,6 @@ struct __wt_page {
* doesn't read it multiple times).
*/
struct {
- uint64_t recno; /* Starting recno */
WT_REF *parent_ref; /* Parent reference */
struct __wt_page_index {
@@ -442,8 +459,7 @@ struct __wt_page {
WT_REF **index;
} * volatile __index; /* Collated children */
} intl;
-#undef pg_intl_recno
-#define pg_intl_recno u.intl.recno
+#undef pg_intl_parent_ref
#define pg_intl_parent_ref u.intl.parent_ref
/*
@@ -482,40 +498,19 @@ struct __wt_page {
/* Row-store leaf page. */
struct {
- /*
- * The column-store leaf page modification structures
- * live in the WT_PAGE_MODIFY structure to keep the
- * WT_PAGE structure as small as possible for read-only
- * pages. For consistency, we could move the row-store
- * modification structures into WT_PAGE_MODIFY too, but
- * that doesn't shrink WT_PAGE any further and it would
- * require really ugly naming inside of WT_PAGE_MODIFY
- * to avoid growing that structure.
- */
- WT_INSERT_HEAD **ins; /* Inserts */
- WT_UPDATE **upd; /* Updates */
-
WT_ROW *d; /* Key/value pairs */
uint32_t entries; /* Entries */
} row;
#undef pg_row_d
#define pg_row_d u.row.d
-#undef pg_row_ins
-#define pg_row_ins u.row.ins
-#undef pg_row_upd
-#define pg_row_upd u.row.upd
#undef pg_row_entries
#define pg_row_entries u.row.entries
/* Fixed-length column-store leaf page. */
struct {
- uint64_t recno; /* Starting recno */
-
uint8_t *bitf; /* Values */
uint32_t entries; /* Entries */
} col_fix;
-#undef pg_fix_recno
-#define pg_fix_recno u.col_fix.recno
#undef pg_fix_bitf
#define pg_fix_bitf u.col_fix.bitf
#undef pg_fix_entries
@@ -523,8 +518,6 @@ struct __wt_page {
/* Variable-length column-store leaf page. */
struct {
- uint64_t recno; /* Starting recno */
-
WT_COL *d; /* Values */
/*
@@ -537,8 +530,6 @@ struct __wt_page {
uint32_t entries; /* Entries */
} col_var;
-#undef pg_var_recno
-#define pg_var_recno u.col_var.recno
#undef pg_var_d
#define pg_var_d u.col_var.d
#undef pg_var_repeats
@@ -732,6 +723,10 @@ struct __wt_ref {
uint64_t recno; /* Column-store: starting recno */
void *ikey; /* Row-store: key */
} key;
+#undef ref_recno
+#define ref_recno key.recno
+#undef ref_ikey
+#define ref_ikey key.ikey
WT_PAGE_DELETED *page_del; /* Deleted on-disk page information */
};
@@ -1007,12 +1002,15 @@ struct __wt_insert_head {
* of pointers and the specific structure exist, else NULL.
*/
#define WT_ROW_INSERT_SLOT(page, slot) \
- ((page)->pg_row_ins == NULL ? NULL : (page)->pg_row_ins[slot])
+ ((page)->modify == NULL || \
+ (page)->modify->mod_row_insert == NULL ? \
+ NULL : (page)->modify->mod_row_insert[slot])
#define WT_ROW_INSERT(page, ip) \
WT_ROW_INSERT_SLOT(page, WT_ROW_SLOT(page, ip))
#define WT_ROW_UPDATE(page, ip) \
- ((page)->pg_row_upd == NULL ? \
- NULL : (page)->pg_row_upd[WT_ROW_SLOT(page, ip)])
+ ((page)->modify == NULL || \
+ (page)->modify->mod_row_update == NULL ? \
+ NULL : (page)->modify->mod_row_update[WT_ROW_SLOT(page, ip)])
/*
* WT_ROW_INSERT_SMALLEST references an additional slot past the end of the
* the "one per WT_ROW slot" insert array. That's because the insert array
@@ -1020,8 +1018,9 @@ struct __wt_insert_head {
* original page.
*/
#define WT_ROW_INSERT_SMALLEST(page) \
- ((page)->pg_row_ins == NULL ? \
- NULL : (page)->pg_row_ins[(page)->pg_row_entries])
+ ((page)->modify == NULL || \
+ (page)->modify->mod_row_insert == NULL ? \
+ NULL : (page)->modify->mod_row_insert[(page)->pg_row_entries])
/*
* The column-store leaf page update lists are arrays of pointers to structures,
@@ -1029,8 +1028,9 @@ struct __wt_insert_head {
* of pointers and the specific structure exist, else NULL.
*/
#define WT_COL_UPDATE_SLOT(page, slot) \
- ((page)->modify == NULL || (page)->modify->mod_update == NULL ? \
- NULL : (page)->modify->mod_update[slot])
+ ((page)->modify == NULL || \
+ (page)->modify->mod_col_update == NULL ? \
+ NULL : (page)->modify->mod_col_update[slot])
#define WT_COL_UPDATE(page, ip) \
WT_COL_UPDATE_SLOT(page, WT_COL_SLOT(page, ip))
@@ -1046,8 +1046,9 @@ struct __wt_insert_head {
* appends.
*/
#define WT_COL_APPEND(page) \
- ((page)->modify != NULL && (page)->modify->mod_append != NULL ? \
- (page)->modify->mod_append[0] : NULL)
+ ((page)->modify == NULL || \
+ (page)->modify->mod_col_append == NULL ? \
+ NULL : (page)->modify->mod_col_append[0])
/* WT_FIX_FOREACH walks fixed-length bit-fields on a disk page. */
#define WT_FIX_FOREACH(btree, dsk, v, i) \
diff --git a/src/include/btree.i b/src/include/btree.i
index 6df7f87073f..4c8166ca6a6 100644
--- a/src/include/btree.i
+++ b/src/include/btree.i
@@ -511,8 +511,8 @@ __wt_ref_key(WT_PAGE *page, WT_REF *ref, void *keyp, size_t *sizep)
/*
* An internal page key is in one of two places: if we instantiated the
- * key (for example, when reading the page), WT_REF.key.ikey references
- * a WT_IKEY structure, otherwise WT_REF.key.ikey references an on-page
+ * key (for example, when reading the page), WT_REF.ref_ikey references
+ * a WT_IKEY structure, otherwise WT_REF.ref_ikey references an on-page
* key offset/length pair.
*
* Now the magic: allocated memory must be aligned to store any standard
@@ -536,14 +536,14 @@ __wt_ref_key(WT_PAGE *page, WT_REF *ref, void *keyp, size_t *sizep)
#define WT_IK_DECODE_KEY_LEN(v) ((v) >> 32)
#define WT_IK_ENCODE_KEY_OFFSET(v) ((uintptr_t)(v) << 1)
#define WT_IK_DECODE_KEY_OFFSET(v) (((v) & 0xFFFFFFFF) >> 1)
- v = (uintptr_t)ref->key.ikey;
+ v = (uintptr_t)ref->ref_ikey;
if (v & WT_IK_FLAG) {
*(void **)keyp =
WT_PAGE_REF_OFFSET(page, WT_IK_DECODE_KEY_OFFSET(v));
*sizep = WT_IK_DECODE_KEY_LEN(v);
} else {
- *(void **)keyp = WT_IKEY_DATA(ref->key.ikey);
- *sizep = ((WT_IKEY *)ref->key.ikey)->size;
+ *(void **)keyp = WT_IKEY_DATA(ref->ref_ikey);
+ *sizep = ((WT_IKEY *)ref->ref_ikey)->size;
}
}
@@ -562,7 +562,7 @@ __wt_ref_key_onpage_set(WT_PAGE *page, WT_REF *ref, WT_CELL_UNPACK *unpack)
v = WT_IK_ENCODE_KEY_LEN(unpack->size) |
WT_IK_ENCODE_KEY_OFFSET(WT_PAGE_DISK_OFFSET(page, unpack->data)) |
WT_IK_FLAG;
- ref->key.ikey = (void *)v;
+ ref->ref_ikey = (void *)v;
}
/*
@@ -577,8 +577,8 @@ __wt_ref_key_instantiated(WT_REF *ref)
/*
* See the comment in __wt_ref_key for an explanation of the magic.
*/
- v = (uintptr_t)ref->key.ikey;
- return (v & WT_IK_FLAG ? NULL : ref->key.ikey);
+ v = (uintptr_t)ref->ref_ikey;
+ return (v & WT_IK_FLAG ? NULL : ref->ref_ikey);
}
/*
@@ -591,10 +591,10 @@ __wt_ref_key_clear(WT_REF *ref)
/*
* The key union has 2 8B fields; this is equivalent to:
*
- * ref->key.recno = WT_RECNO_OOB;
- * ref->key.ikey = NULL;
+ * ref->ref_recno = WT_RECNO_OOB;
+ * ref->ref_ikey = NULL;
*/
- ref->key.recno = 0;
+ ref->ref_recno = 0;
}
/*
diff --git a/src/include/cache.h b/src/include/cache.h
index 9184a2fe6ed..4f7981a5df9 100644
--- a/src/include/cache.h
+++ b/src/include/cache.h
@@ -26,6 +26,19 @@ struct __wt_evict_entry {
WT_REF *ref; /* Page to flush/evict */
};
+#define WT_EVICT_QUEUE_MAX 2
+/*
+ * WT_EVICT_QUEUE --
+ * Encapsulation of an eviction candidate queue.
+ */
+struct __wt_evict_queue {
+ WT_SPINLOCK evict_lock; /* Eviction LRU queue */
+ WT_EVICT_ENTRY *evict_queue; /* LRU pages being tracked */
+ uint32_t evict_candidates; /* LRU list pages to evict */
+ uint32_t evict_entries; /* LRU entries in the queue */
+ volatile uint32_t evict_max; /* LRU maximum eviction slot used */
+};
+
/*
* WT_EVICT_WORKER --
* Encapsulation of an eviction worker thread.
@@ -67,8 +80,10 @@ struct __wt_cache {
uint64_t pages_dirty;
uint64_t bytes_read; /* Bytes read into memory */
- uint64_t app_evicts; /* Pages evicted by user threads */
uint64_t app_waits; /* User threads waited for cache */
+ uint64_t app_evicts; /* Pages evicted by user threads */
+ uint64_t server_evicts; /* Pages evicted by server thread */
+ uint64_t worker_evicts; /* Pages evicted by worker threads */
uint64_t evict_max_page_size; /* Largest page seen at eviction */
@@ -83,7 +98,6 @@ struct __wt_cache {
* Eviction thread information.
*/
WT_CONDVAR *evict_cond; /* Eviction server condition */
- WT_SPINLOCK evict_lock; /* Eviction LRU queue */
WT_SPINLOCK evict_walk_lock; /* Eviction walk location */
/* Condition signalled when the eviction server populates the queue */
WT_CONDVAR *evict_waiter_cond;
@@ -98,11 +112,11 @@ struct __wt_cache {
/*
* LRU eviction list information.
*/
- WT_EVICT_ENTRY *evict_queue; /* LRU pages being tracked */
+ WT_SPINLOCK evict_queue_lock; /* Eviction current queue lock */
+ WT_EVICT_QUEUE evict_queues[WT_EVICT_QUEUE_MAX];
+ WT_EVICT_QUEUE *evict_current_queue;/* LRU current queue in use */
WT_EVICT_ENTRY *evict_current; /* LRU current page to be evicted */
- uint32_t evict_candidates; /* LRU list pages to evict */
- uint32_t evict_entries; /* LRU entries in the queue */
- volatile uint32_t evict_max; /* LRU maximum eviction slot used */
+ uint32_t evict_queue_fill; /* LRU eviction queue index to fill */
uint32_t evict_slots; /* LRU list eviction slots */
WT_DATA_HANDLE
*evict_file_next; /* LRU next file to search */
diff --git a/src/include/column.i b/src/include/column.i
index d64e68420a5..d15f874b281 100644
--- a/src/include/column.i
+++ b/src/include/column.i
@@ -209,9 +209,12 @@ __col_insert_search(WT_INSERT_HEAD *ins_head,
* Return the last record number for a variable-length column-store page.
*/
static inline uint64_t
-__col_var_last_recno(WT_PAGE *page)
+__col_var_last_recno(WT_REF *ref)
{
WT_COL_RLE *repeat;
+ WT_PAGE *page;
+
+ page = ref->page;
/*
* If there's an append list, there may be more records on the page.
@@ -220,7 +223,7 @@ __col_var_last_recno(WT_PAGE *page)
*/
if (page->pg_var_nrepeats == 0)
return (page->pg_var_entries == 0 ? 0 :
- page->pg_var_recno + (page->pg_var_entries - 1));
+ ref->ref_recno + (page->pg_var_entries - 1));
repeat = &page->pg_var_repeats[page->pg_var_nrepeats - 1];
return ((repeat->recno + repeat->rle) - 1 +
@@ -232,15 +235,19 @@ __col_var_last_recno(WT_PAGE *page)
* Return the last record number for a fixed-length column-store page.
*/
static inline uint64_t
-__col_fix_last_recno(WT_PAGE *page)
+__col_fix_last_recno(WT_REF *ref)
{
+ WT_PAGE *page;
+
+ page = ref->page;
+
/*
* If there's an append list, there may be more records on the page.
* This function ignores those records, our callers must handle that
* explicitly, if they care.
*/
- return (page->pg_fix_entries == 0 ? 0 :
- page->pg_fix_recno + (page->pg_fix_entries - 1));
+ return (page->pg_fix_entries == 0 ?
+ 0 : ref->ref_recno + (page->pg_fix_entries - 1));
}
/*
@@ -248,12 +255,15 @@ __col_fix_last_recno(WT_PAGE *page)
* Search a variable-length column-store page for a record.
*/
static inline WT_COL *
-__col_var_search(WT_PAGE *page, uint64_t recno, uint64_t *start_recnop)
+__col_var_search(WT_REF *ref, uint64_t recno, uint64_t *start_recnop)
{
WT_COL_RLE *repeat;
+ WT_PAGE *page;
uint64_t start_recno;
uint32_t base, indx, limit, start_indx;
+ page = ref->page;
+
/*
* Find the matching slot.
*
@@ -285,7 +295,7 @@ __col_var_search(WT_PAGE *page, uint64_t recno, uint64_t *start_recnop)
*/
if (base == 0) {
start_indx = 0;
- start_recno = page->pg_var_recno;
+ start_recno = ref->ref_recno;
} else {
repeat = page->pg_var_repeats + (base - 1);
start_indx = repeat->indx + 1;
diff --git a/src/include/config.h b/src/include/config.h
index 48a255134af..486aa50e86c 100644
--- a/src/include/config.h
+++ b/src/include/config.h
@@ -59,41 +59,42 @@ struct __wt_config_parser_impl {
#define WT_CONFIG_ENTRY_WT_CONNECTION_load_extension 7
#define WT_CONFIG_ENTRY_WT_CONNECTION_open_session 8
#define WT_CONFIG_ENTRY_WT_CONNECTION_reconfigure 9
-#define WT_CONFIG_ENTRY_WT_CURSOR_close 10
-#define WT_CONFIG_ENTRY_WT_CURSOR_reconfigure 11
-#define WT_CONFIG_ENTRY_WT_SESSION_begin_transaction 12
-#define WT_CONFIG_ENTRY_WT_SESSION_checkpoint 13
-#define WT_CONFIG_ENTRY_WT_SESSION_close 14
-#define WT_CONFIG_ENTRY_WT_SESSION_commit_transaction 15
-#define WT_CONFIG_ENTRY_WT_SESSION_compact 16
-#define WT_CONFIG_ENTRY_WT_SESSION_create 17
-#define WT_CONFIG_ENTRY_WT_SESSION_drop 18
-#define WT_CONFIG_ENTRY_WT_SESSION_join 19
-#define WT_CONFIG_ENTRY_WT_SESSION_log_flush 20
-#define WT_CONFIG_ENTRY_WT_SESSION_log_printf 21
-#define WT_CONFIG_ENTRY_WT_SESSION_open_cursor 22
-#define WT_CONFIG_ENTRY_WT_SESSION_rebalance 23
-#define WT_CONFIG_ENTRY_WT_SESSION_reconfigure 24
-#define WT_CONFIG_ENTRY_WT_SESSION_rename 25
-#define WT_CONFIG_ENTRY_WT_SESSION_reset 26
-#define WT_CONFIG_ENTRY_WT_SESSION_rollback_transaction 27
-#define WT_CONFIG_ENTRY_WT_SESSION_salvage 28
-#define WT_CONFIG_ENTRY_WT_SESSION_snapshot 29
-#define WT_CONFIG_ENTRY_WT_SESSION_strerror 30
-#define WT_CONFIG_ENTRY_WT_SESSION_transaction_sync 31
-#define WT_CONFIG_ENTRY_WT_SESSION_truncate 32
-#define WT_CONFIG_ENTRY_WT_SESSION_upgrade 33
-#define WT_CONFIG_ENTRY_WT_SESSION_verify 34
-#define WT_CONFIG_ENTRY_colgroup_meta 35
-#define WT_CONFIG_ENTRY_file_config 36
-#define WT_CONFIG_ENTRY_file_meta 37
-#define WT_CONFIG_ENTRY_index_meta 38
-#define WT_CONFIG_ENTRY_lsm_meta 39
-#define WT_CONFIG_ENTRY_table_meta 40
-#define WT_CONFIG_ENTRY_wiredtiger_open 41
-#define WT_CONFIG_ENTRY_wiredtiger_open_all 42
-#define WT_CONFIG_ENTRY_wiredtiger_open_basecfg 43
-#define WT_CONFIG_ENTRY_wiredtiger_open_usercfg 44
+#define WT_CONFIG_ENTRY_WT_CONNECTION_set_file_system 10
+#define WT_CONFIG_ENTRY_WT_CURSOR_close 11
+#define WT_CONFIG_ENTRY_WT_CURSOR_reconfigure 12
+#define WT_CONFIG_ENTRY_WT_SESSION_begin_transaction 13
+#define WT_CONFIG_ENTRY_WT_SESSION_checkpoint 14
+#define WT_CONFIG_ENTRY_WT_SESSION_close 15
+#define WT_CONFIG_ENTRY_WT_SESSION_commit_transaction 16
+#define WT_CONFIG_ENTRY_WT_SESSION_compact 17
+#define WT_CONFIG_ENTRY_WT_SESSION_create 18
+#define WT_CONFIG_ENTRY_WT_SESSION_drop 19
+#define WT_CONFIG_ENTRY_WT_SESSION_join 20
+#define WT_CONFIG_ENTRY_WT_SESSION_log_flush 21
+#define WT_CONFIG_ENTRY_WT_SESSION_log_printf 22
+#define WT_CONFIG_ENTRY_WT_SESSION_open_cursor 23
+#define WT_CONFIG_ENTRY_WT_SESSION_rebalance 24
+#define WT_CONFIG_ENTRY_WT_SESSION_reconfigure 25
+#define WT_CONFIG_ENTRY_WT_SESSION_rename 26
+#define WT_CONFIG_ENTRY_WT_SESSION_reset 27
+#define WT_CONFIG_ENTRY_WT_SESSION_rollback_transaction 28
+#define WT_CONFIG_ENTRY_WT_SESSION_salvage 29
+#define WT_CONFIG_ENTRY_WT_SESSION_snapshot 30
+#define WT_CONFIG_ENTRY_WT_SESSION_strerror 31
+#define WT_CONFIG_ENTRY_WT_SESSION_transaction_sync 32
+#define WT_CONFIG_ENTRY_WT_SESSION_truncate 33
+#define WT_CONFIG_ENTRY_WT_SESSION_upgrade 34
+#define WT_CONFIG_ENTRY_WT_SESSION_verify 35
+#define WT_CONFIG_ENTRY_colgroup_meta 36
+#define WT_CONFIG_ENTRY_file_config 37
+#define WT_CONFIG_ENTRY_file_meta 38
+#define WT_CONFIG_ENTRY_index_meta 39
+#define WT_CONFIG_ENTRY_lsm_meta 40
+#define WT_CONFIG_ENTRY_table_meta 41
+#define WT_CONFIG_ENTRY_wiredtiger_open 42
+#define WT_CONFIG_ENTRY_wiredtiger_open_all 43
+#define WT_CONFIG_ENTRY_wiredtiger_open_basecfg 44
+#define WT_CONFIG_ENTRY_wiredtiger_open_usercfg 45
/*
* configuration section: END
* DO NOT EDIT: automatically built by dist/flags.py.
diff --git a/src/include/connection.h b/src/include/connection.h
index c2b1dd68c18..e6cff08f0ae 100644
--- a/src/include/connection.h
+++ b/src/include/connection.h
@@ -145,20 +145,6 @@ struct __wt_named_extractor {
} while (0)
/*
- * Macros to ensure the file handle is inserted or removed from both the
- * main queue and the hashed queue.
- */
-#define WT_CONN_FILE_INSERT(conn, fh, bucket) do { \
- TAILQ_INSERT_HEAD(&(conn)->fhqh, fh, q); \
- TAILQ_INSERT_HEAD(&(conn)->fhhash[bucket], fh, hashq); \
-} while (0)
-
-#define WT_CONN_FILE_REMOVE(conn, fh, bucket) do { \
- TAILQ_REMOVE(&(conn)->fhqh, fh, q); \
- TAILQ_REMOVE(&(conn)->fhhash[bucket], fh, hashq); \
-} while (0)
-
-/*
* WT_CONNECTION_IMPL --
* Implementation of WT_CONNECTION
*/
@@ -333,7 +319,7 @@ struct __wt_connection_impl {
bool stat_tid_set; /* Statistics log thread set */
WT_CONDVAR *stat_cond; /* Statistics log wait mutex */
const char *stat_format; /* Statistics log timestamp format */
- WT_FH *stat_fh; /* Statistics log file handle */
+ WT_FSTREAM *stat_fs; /* Statistics log stream */
char *stat_path; /* Statistics log path format */
char **stat_sources; /* Statistics log list of objects */
const char *stat_stamp; /* Statistics log entry timestamp */
@@ -414,32 +400,26 @@ struct __wt_connection_impl {
wt_off_t data_extend_len; /* file_extend data length */
wt_off_t log_extend_len; /* file_extend log length */
- /* O_DIRECT/FILE_FLAG_NO_BUFFERING file type flags */
- uint32_t direct_io;
- uint32_t write_through; /* FILE_FLAG_WRITE_THROUGH type flags */
+#define WT_DIRECT_IO_CHECKPOINT 0x01 /* Checkpoints */
+#define WT_DIRECT_IO_DATA 0x02 /* Data files */
+#define WT_DIRECT_IO_LOG 0x04 /* Log files */
+ uint32_t direct_io; /* O_DIRECT, FILE_FLAG_NO_BUFFERING */
+
+ uint32_t write_through; /* FILE_FLAG_WRITE_THROUGH */
+
bool mmap; /* mmap configuration */
int page_size; /* OS page size for mmap alignment */
uint32_t verbose;
- void *inmemory; /* In-memory configuration cookie */
-
#define WT_STDERR(s) (&S2C(s)->wt_stderr)
#define WT_STDOUT(s) (&S2C(s)->wt_stdout)
- WT_FH wt_stderr, wt_stdout;
+ WT_FSTREAM wt_stderr, wt_stdout;
/*
- * OS library/system call jump table, to support in-memory and readonly
- * configurations as well as special devices with other non-POSIX APIs.
+ * File system interface abstracted to support alternative file system
+ * implementations.
*/
- int (*file_directory_list)(WT_SESSION_IMPL *,
- const char *, const char *, uint32_t, char ***, u_int *);
- int (*file_directory_sync)(WT_SESSION_IMPL *, const char *);
- int (*file_exist)(WT_SESSION_IMPL *, const char *, bool *);
- int (*file_remove)(WT_SESSION_IMPL *, const char *);
- int (*file_rename)(WT_SESSION_IMPL *, const char *, const char *);
- int (*file_size)(WT_SESSION_IMPL *, const char *, bool, wt_off_t *);
- int (*handle_open)(WT_SESSION_IMPL *,
- WT_FH *, const char *, uint32_t, uint32_t);
+ WT_FILE_SYSTEM *file_system;
uint32_t flags;
};
diff --git a/src/include/cursor.h b/src/include/cursor.h
index 1d2ce1bfd82..6357523a03f 100644
--- a/src/include/cursor.h
+++ b/src/include/cursor.h
@@ -67,7 +67,7 @@ struct __wt_cursor_backup {
WT_CURSOR iface;
size_t next; /* Cursor position */
- WT_FH *bfh; /* Backup file */
+ WT_FSTREAM *bfs; /* Backup file stream */
uint32_t maxid; /* Maximum log file ID seen */
WT_CURSOR_BACKUP_ENTRY *list; /* List of files to be copied. */
@@ -284,18 +284,50 @@ struct __wt_cursor_index {
uint8_t *cg_needvalue;
};
+/*
+ * A join iterator structure is used to generate candidate primary keys. It
+ * is the responsibility of the caller of the iterator to filter these
+ * primary key against the other conditions of the join before returning
+ * them the caller of WT_CURSOR::next.
+ *
+ * For a conjunction join (the default), entry_count will be 1, meaning that
+ * the iterator only consumes the first entry (WT_CURSOR_JOIN_ENTRY). That
+ * is, it successively returns primary keys from a cursor for the first
+ * index that was joined. When the values returned by that cursor are
+ * exhausted, the iterator has completed. For a disjunction join,
+ * exhausting a cursor just means that the iterator advances to the next
+ * entry. If the next entry represents an index, a new cursor is opened and
+ * primary keys from that index are then successively returned.
+ *
+ * When positioned on an entry that represents a nested join, a new child
+ * iterator is created that will be bound to the nested WT_CURSOR_JOIN.
+ * That iterator is then used to generate candidate primary keys. When its
+ * iteration is completed, that iterator is destroyed and the parent
+ * iterator advances to the next entry. Thus, depending on how deeply joins
+ * are nested, a similarly deep stack of iterators is created.
+ */
struct __wt_cursor_join_iter {
WT_SESSION_IMPL *session;
WT_CURSOR_JOIN *cjoin;
WT_CURSOR_JOIN_ENTRY *entry;
+ WT_CURSOR_JOIN_ITER *child;
WT_CURSOR *cursor; /* has null projection */
- WT_CURSOR *main; /* main table with projection */
WT_ITEM *curkey; /* primary key */
WT_ITEM idxkey;
+ u_int entry_pos; /* the current entry */
+ u_int entry_count; /* entries to walk */
+ u_int end_pos; /* the current endpoint */
+ u_int end_count; /* endpoints to walk */
+ u_int end_skip; /* when testing for inclusion */
+ /* can we skip current end? */
bool positioned;
- bool isequal; /* advancing means we're done */
+ bool is_equal;
};
+/*
+ * A join endpoint represents a positioned cursor that is 'captured' by a
+ * WT_SESSION::join call.
+ */
struct __wt_cursor_join_endpoint {
WT_ITEM key;
uint8_t recno_buf[10]; /* holds packed recno */
@@ -313,9 +345,17 @@ struct __wt_cursor_join_endpoint {
((endp)->flags & \
(WT_CURJOIN_END_GT | WT_CURJOIN_END_EQ | WT_CURJOIN_END_LT))
+/*
+ * Each join entry typically represents an index's participation in a join.
+ * For example, if 'k' is an index, then "t.k > 10 && t.k < 20" would be
+ * represented by a single entry, with two endpoints. When the index and
+ * subjoin fields are NULL, the join is on the main table. When subjoin is
+ * non-NULL, there is a nested join clause.
+ */
struct __wt_cursor_join_entry {
WT_INDEX *index;
WT_CURSOR *main; /* raw main table cursor */
+ WT_CURSOR_JOIN *subjoin; /* a nested join clause */
WT_BLOOM *bloom; /* Bloom filter handle */
char *repack_format; /* target format for repack */
uint32_t bloom_bit_count; /* bits per item in bloom */
@@ -339,15 +379,17 @@ struct __wt_cursor_join {
WT_TABLE *table;
const char *projection;
- WT_CURSOR_JOIN_ITER *iter;
+ WT_CURSOR *main; /* main table with projection */
+ WT_CURSOR_JOIN *parent; /* parent of nested group */
+ WT_CURSOR_JOIN_ITER *iter; /* chain of iterators */
WT_CURSOR_JOIN_ENTRY *entries;
size_t entries_allocated;
u_int entries_next;
uint8_t recno_buf[10]; /* holds packed recno */
-#define WT_CURJOIN_ERROR 0x01 /* Error in initialization */
-#define WT_CURJOIN_INITIALIZED 0x02 /* Successful initialization */
-#define WT_CURJOIN_SKIP_FIRST_LEFT 0x04 /* First check not needed */
+#define WT_CURJOIN_DISJUNCTION 0x01 /* Entries are or-ed */
+#define WT_CURJOIN_ERROR 0x02 /* Error in initialization */
+#define WT_CURJOIN_INITIALIZED 0x04 /* Successful initialization */
uint8_t flags;
};
diff --git a/src/include/cursor.i b/src/include/cursor.i
index 8ab96c0a69d..553dd03f958 100644
--- a/src/include/cursor.i
+++ b/src/include/cursor.i
@@ -270,7 +270,7 @@ __cursor_func_init(WT_CURSOR_BTREE *cbt, bool reenter)
* to read.
*/
if (!F_ISSET(cbt, WT_CBT_NO_TXN))
- __wt_txn_cursor_op(session);
+ WT_RET(__wt_txn_cursor_op(session));
return (0);
}
diff --git a/src/include/extern.h b/src/include/extern.h
index 292bcfb1c7c..53e49e51a26 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -41,8 +41,8 @@ extern int __wt_block_extlist_write(WT_SESSION_IMPL *session, WT_BLOCK *block, W
extern int __wt_block_extlist_truncate( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *el);
extern int __wt_block_extlist_init(WT_SESSION_IMPL *session, WT_EXTLIST *el, const char *name, const char *extname, bool track_size);
extern void __wt_block_extlist_free(WT_SESSION_IMPL *session, WT_EXTLIST *el);
-extern int __wt_block_map( WT_SESSION_IMPL *session, WT_BLOCK *block, void *mapp, size_t *maplenp, void **mappingcookie);
-extern int __wt_block_unmap( WT_SESSION_IMPL *session, WT_BLOCK *block, void *map, size_t maplen, void **mappingcookie);
+extern int __wt_block_map(WT_SESSION_IMPL *session, WT_BLOCK *block, void *mapped_regionp, size_t *lengthp, void *mapped_cookiep);
+extern int __wt_block_unmap(WT_SESSION_IMPL *session, WT_BLOCK *block, void *mapped_region, size_t length, void *mapped_cookie);
extern int __wt_block_manager_open(WT_SESSION_IMPL *session, const char *filename, const char *cfg[], bool forced_salvage, bool readonly, uint32_t allocsize, WT_BM **bmp);
extern int __wt_block_manager_drop(WT_SESSION_IMPL *session, const char *filename);
extern int __wt_block_manager_create( WT_SESSION_IMPL *session, const char *filename, uint32_t allocsize);
@@ -118,9 +118,9 @@ extern int __wt_debug_offset_blind( WT_SESSION_IMPL *session, wt_off_t offset, c
extern int __wt_debug_offset(WT_SESSION_IMPL *session, wt_off_t offset, uint32_t size, uint32_t cksum, const char *ofile);
extern int __wt_debug_disk( WT_SESSION_IMPL *session, const WT_PAGE_HEADER *dsk, const char *ofile);
extern int __wt_debug_tree_shape( WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile);
-extern int __wt_debug_tree_all( WT_SESSION_IMPL *session, WT_BTREE *btree, WT_PAGE *page, const char *ofile);
-extern int __wt_debug_tree( WT_SESSION_IMPL *session, WT_BTREE *btree, WT_PAGE *page, const char *ofile);
-extern int __wt_debug_page(WT_SESSION_IMPL *session, WT_PAGE *page, const char *ofile);
+extern int __wt_debug_tree_all( WT_SESSION_IMPL *session, WT_BTREE *btree, WT_REF *ref, const char *ofile);
+extern int __wt_debug_tree( WT_SESSION_IMPL *session, WT_BTREE *btree, WT_REF *ref, const char *ofile);
+extern int __wt_debug_page(WT_SESSION_IMPL *session, WT_REF *ref, const char *ofile);
extern int __wt_delete_page(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp);
extern void __wt_delete_page_rollback(WT_SESSION_IMPL *session, WT_REF *ref);
extern bool __wt_delete_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, bool visible_all);
@@ -134,7 +134,7 @@ 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, bool is_recno);
extern int __wt_btree_tree_open( WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size);
-extern int __wt_btree_new_leaf_page( WT_SESSION_IMPL *session, uint64_t recno, WT_PAGE **pagep);
+extern int __wt_btree_new_leaf_page(WT_SESSION_IMPL *session, WT_PAGE **pagep);
extern void __wt_btree_evictable(WT_SESSION_IMPL *session, bool on);
extern int __wt_btree_huffman_open(WT_SESSION_IMPL *session);
extern void __wt_btree_huffman_close(WT_SESSION_IMPL *session);
@@ -148,7 +148,7 @@ extern const char *__wt_buf_set_printable( WT_SESSION_IMPL *session, const void
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, bool alloc_refs, WT_PAGE **pagep);
+extern int __wt_page_alloc(WT_SESSION_IMPL *session, uint8_t type, uint32_t alloc_entries, bool 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
@@ -203,6 +203,8 @@ extern int __wt_las_cursor_open(WT_SESSION_IMPL *session, WT_CURSOR **cursorp);
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 uint32_t __wt_cksum(const void *chunk, size_t len);
+extern void __wt_cksum_init(void);
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);
@@ -283,8 +285,8 @@ extern int __wt_curdump_create(WT_CURSOR *child, WT_CURSOR *owner, WT_CURSOR **c
extern int __wt_curfile_update_check(WT_CURSOR *cursor);
extern int __wt_curfile_create(WT_SESSION_IMPL *session, WT_CURSOR *owner, const char *cfg[], bool bulk, bool bitmap, WT_CURSOR **cursorp);
extern int __wt_curfile_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp);
-extern int __wt_curindex_joined(WT_CURSOR *cursor);
extern int __wt_curindex_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp);
+extern int __wt_curjoin_joined(WT_CURSOR *cursor);
extern int __wt_curjoin_open(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp);
extern int __wt_curjoin_join(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin, WT_INDEX *idx, WT_CURSOR *ref_cursor, uint8_t flags, uint8_t range, uint64_t count, uint32_t bloom_bit_count, uint32_t bloom_hash_count);
extern int __wt_json_alloc_unpack(WT_SESSION_IMPL *session, const void *buffer, size_t size, const char *fmt, WT_CURSOR_JSON *json, bool iskey, va_list ap);
@@ -356,7 +358,6 @@ 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, bool *recp);
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, bool 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);
@@ -580,8 +581,6 @@ extern void __wt_session_close_cache(WT_SESSION_IMPL *session);
extern int __wt_session_get_btree(WT_SESSION_IMPL *session, const char *uri, const char *checkpoint, const char *cfg[], uint32_t flags);
extern int __wt_session_lock_checkpoint(WT_SESSION_IMPL *session, const char *checkpoint);
extern int __wt_salvage(WT_SESSION_IMPL *session, const char *cfg[]);
-extern uint32_t __wt_cksum(const void *chunk, size_t len);
-extern void __wt_cksum_init(void);
extern int __wt_cond_auto_alloc( WT_SESSION_IMPL *session, const char *name, bool is_signalled, uint64_t min, uint64_t max, WT_CONDVAR **condp);
extern int __wt_cond_auto_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond);
extern int __wt_cond_auto_wait_signal( WT_SESSION_IMPL *session, WT_CONDVAR *cond, bool progress, bool *signalled);
@@ -676,8 +675,8 @@ extern void __wt_stat_join_clear_single(WT_JOIN_STATS *stats);
extern void __wt_stat_join_clear_all(WT_JOIN_STATS **stats);
extern void __wt_stat_join_aggregate( WT_JOIN_STATS **from, WT_JOIN_STATS *to);
extern void __wt_txn_release_snapshot(WT_SESSION_IMPL *session);
-extern void __wt_txn_get_snapshot(WT_SESSION_IMPL *session);
-extern void __wt_txn_update_oldest(WT_SESSION_IMPL *session, bool force);
+extern int __wt_txn_get_snapshot(WT_SESSION_IMPL *session);
+extern int __wt_txn_update_oldest(WT_SESSION_IMPL *session, bool force);
extern int __wt_txn_config(WT_SESSION_IMPL *session, const char *cfg[]);
extern void __wt_txn_release(WT_SESSION_IMPL *session);
extern int __wt_txn_commit(WT_SESSION_IMPL *session, const char *cfg[]);
@@ -713,7 +712,7 @@ extern int __wt_txn_named_snapshot_config(WT_SESSION_IMPL *session, const char *
extern int __wt_txn_named_snapshot_destroy(WT_SESSION_IMPL *session);
extern int __wt_txn_recover(WT_SESSION_IMPL *session);
extern bool __wt_absolute_path(const char *path);
-extern bool __wt_handle_search(WT_SESSION_IMPL *session, const char *name, bool increment_ref, WT_FH *newfh, WT_FH **fhp);
+extern bool __wt_handle_is_open(WT_SESSION_IMPL *session, const char *name);
extern bool __wt_has_priv(void);
extern const char *__wt_path_separator(void);
extern const char *__wt_strerror(WT_SESSION_IMPL *session, int error, char *errbuf, size_t errlen);
@@ -731,49 +730,43 @@ extern int __wt_dlsym(WT_SESSION_IMPL *session, WT_DLH *dlh, const char *name, b
extern int __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp);
extern int __wt_errno(void);
extern int __wt_filename(WT_SESSION_IMPL *session, const char *name, char **path);
+extern int __wt_fopen(WT_SESSION_IMPL *session, const char *name, uint32_t open_flags, uint32_t flags, WT_FSTREAM **fsp);
extern int __wt_get_vm_pagesize(void);
extern int __wt_getenv(WT_SESSION_IMPL *session, const char *variable, const char **envp);
extern int __wt_getlasterror(void);
-extern int __wt_getline(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_FH *fh);
extern int __wt_getopt( const char *progname, int nargc, char *const *nargv, const char *ostr);
extern int __wt_malloc(WT_SESSION_IMPL *session, size_t bytes_to_allocate, void *retp);
extern int __wt_map_error_rdonly(int error);
extern int __wt_nfilename( WT_SESSION_IMPL *session, const char *name, size_t namelen, char **path);
extern int __wt_once(void (*init_routine)(void));
-extern int __wt_open(WT_SESSION_IMPL *session, const char *name, uint32_t file_type, uint32_t flags, WT_FH **fhp);
-extern int __wt_os_cleanup(WT_SESSION_IMPL *session);
-extern int __wt_os_init(WT_SESSION_IMPL *session);
+extern int __wt_open(WT_SESSION_IMPL *session, const char *name, WT_OPEN_FILE_TYPE file_type, u_int flags, WT_FH **fhp);
extern int __wt_os_inmemory(WT_SESSION_IMPL *session);
-extern int __wt_os_inmemory_cleanup(WT_SESSION_IMPL *session);
extern int __wt_os_posix(WT_SESSION_IMPL *session);
-extern int __wt_os_posix_cleanup(WT_SESSION_IMPL *session);
extern int __wt_os_stdio(WT_SESSION_IMPL *session);
extern int __wt_os_win(WT_SESSION_IMPL *session);
-extern int __wt_os_win_cleanup(WT_SESSION_IMPL *session);
-extern int __wt_posix_directory_list(WT_SESSION_IMPL *session, const char *dir, const char *prefix, uint32_t flags, char ***dirlist, u_int *countp);
-extern int __wt_posix_handle_allocate( WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, wt_off_t len);
-extern int __wt_posix_map(WT_SESSION_IMPL *session, WT_FH *fh, void *mapp, size_t *lenp, void **mappingcookie);
-extern int __wt_posix_map_discard( WT_SESSION_IMPL *session, WT_FH *fh, void *p, size_t size);
-extern int __wt_posix_map_preload( WT_SESSION_IMPL *session, WT_FH *fh, const void *p, size_t size);
-extern int __wt_posix_map_unmap(WT_SESSION_IMPL *session, WT_FH *fh, void *map, size_t len, void **mappingcookie);
+extern int __wt_posix_directory_list(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *directory, const char *prefix, char ***dirlistp, uint32_t *countp);
+extern int __wt_posix_directory_list_free(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, char **dirlist, uint32_t count);
+extern int __wt_posix_file_fallocate(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, wt_off_t offset, wt_off_t len);
+extern int __wt_posix_map(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *mapped_regionp, size_t *lenp, void *mapped_cookiep);
+extern int __wt_posix_map_discard(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *map, size_t length, void *mapped_cookie);
+extern int __wt_posix_map_preload(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, const void *map, size_t length, void *mapped_cookie);
+extern int __wt_posix_unmap(WT_FILE_HANDLE *fh, WT_SESSION *wt_session, void *mapped_region, size_t len, void *mapped_cookie);
extern int __wt_realloc(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp);
extern int __wt_realloc_aligned(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp);
extern int __wt_realloc_noclear(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp);
extern int __wt_remove_if_exists(WT_SESSION_IMPL *session, const char *name);
extern int __wt_rename_and_sync_directory( WT_SESSION_IMPL *session, const char *from, const char *to);
extern int __wt_strndup(WT_SESSION_IMPL *session, const void *str, size_t len, void *retp);
-extern int __wt_sync_handle_and_rename( WT_SESSION_IMPL *session, WT_FH **fhp, const char *from, const char *to);
extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg);
extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid);
-extern int __wt_win_directory_list(WT_SESSION_IMPL *session, const char *dir, const char *prefix, uint32_t flags, char ***dirlist, u_int *countp);
-extern int __wt_win_map(WT_SESSION_IMPL *session, WT_FH *fh, void *mapp, size_t *lenp, void **mappingcookie);
-extern int __wt_win_map_discard(WT_SESSION_IMPL *session, WT_FH *fh, void *p, size_t size);
-extern int __wt_win_map_preload( WT_SESSION_IMPL *session, WT_FH *fh, const void *p, size_t size);
-extern int __wt_win_map_unmap(WT_SESSION_IMPL *session, WT_FH *fh, void *map, size_t len, void **mappingcookie);
+extern int __wt_win_directory_list(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *directory, const char *prefix, char ***dirlistp, uint32_t *countp);
+extern int __wt_win_directory_list_free(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, char **dirlist, uint32_t count);
+extern int __wt_win_fs_size(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const char *name, wt_off_t *sizep);
+extern int __wt_win_map(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, void *mapped_regionp, size_t *lenp, void *mapped_cookiep);
+extern int __wt_win_unmap(WT_FILE_HANDLE *file_handle, WT_SESSION *wt_session, void *mapped_region, size_t length, void *mapped_cookie);
extern uint64_t __wt_strtouq(const char *nptr, char **endptr, int base);
extern void __wt_abort(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn));
extern void __wt_free_int(WT_SESSION_IMPL *session, const void *p_arg);
-extern void __wt_posix_handle_allocate_configure(WT_SESSION_IMPL *session, WT_FH *fh);
extern void __wt_sleep(uint64_t seconds, uint64_t micro_seconds);
extern void __wt_stream_set_line_buffer(FILE *fp);
extern void __wt_stream_set_no_buffer(FILE *fp);
diff --git a/src/include/flags.h b/src/include/flags.h
index 3d9b0ed716b..da7aee7b059 100644
--- a/src/include/flags.h
+++ b/src/include/flags.h
@@ -24,11 +24,6 @@
#define WT_EVICT_IN_MEMORY 0x00000002
#define WT_EVICT_LOOKASIDE 0x00000004
#define WT_EVICT_UPDATE_RESTORE 0x00000008
-#define WT_FILE_TYPE_CHECKPOINT 0x00000001
-#define WT_FILE_TYPE_DATA 0x00000002
-#define WT_FILE_TYPE_DIRECTORY 0x00000004
-#define WT_FILE_TYPE_LOG 0x00000008
-#define WT_FILE_TYPE_REGULAR 0x00000010
#define WT_LOGSCAN_FIRST 0x00000001
#define WT_LOGSCAN_FROM_CKP 0x00000002
#define WT_LOGSCAN_ONE 0x00000004
diff --git a/src/include/log.h b/src/include/log.h
index 0e676d47b66..387d0c6c154 100644
--- a/src/include/log.h
+++ b/src/include/log.h
@@ -46,10 +46,12 @@ union __wt_lsn {
*/
#define WT_IS_INIT_LSN(l) ((l)->file_offset == ((uint64_t)1 << 32))
/*
- * XXX Original tested INT32_MAX.
+ * Original tested INT32_MAX. But if we read one from an older
+ * release we may see UINT32_MAX.
*/
#define WT_IS_MAX_LSN(lsn) \
- ((lsn)->l.file == UINT32_MAX && (lsn)->l.offset == INT32_MAX)
+ ((lsn)->l.file == UINT32_MAX && \
+ ((lsn)->l.offset == INT32_MAX || (lsn)->l.offset == UINT32_MAX))
/*
* Both of the macros below need to change if the content of __wt_lsn
diff --git a/src/include/meta.h b/src/include/meta.h
index ac0f5fedac4..ba4149979ef 100644
--- a/src/include/meta.h
+++ b/src/include/meta.h
@@ -14,8 +14,10 @@
#define WT_USERCONFIG "WiredTiger.config" /* User configuration */
+#define WT_BACKUP_TMP "WiredTiger.backup.tmp" /* Backup tmp file */
#define WT_METADATA_BACKUP "WiredTiger.backup" /* Hot backup file */
#define WT_INCREMENTAL_BACKUP "WiredTiger.ibackup" /* Incremental backup */
+#define WT_INCREMENTAL_SRC "WiredTiger.isrc" /* Incremental source */
#define WT_METADATA_TURTLE "WiredTiger.turtle" /* Metadata metadata */
#define WT_METADATA_TURTLE_SET "WiredTiger.turtle.set" /* Turtle temp file */
diff --git a/src/include/misc.h b/src/include/misc.h
index 07d52c61eac..4c7c9572905 100644
--- a/src/include/misc.h
+++ b/src/include/misc.h
@@ -96,8 +96,9 @@
* the caller remember to put the & operator on the pointer.
*/
#define __wt_free(session, p) do { \
- if ((p) != NULL) \
- __wt_free_int(session, (void *)&(p)); \
+ void *__p = &(p); \
+ if (*(void **)__p != NULL) \
+ __wt_free_int(session, __p); \
} while (0)
#ifdef HAVE_DIAGNOSTIC
#define __wt_overwrite_and_free(session, p) do { \
diff --git a/src/include/misc.i b/src/include/misc.i
index 114b711ac88..eaa7a328ff1 100644
--- a/src/include/misc.i
+++ b/src/include/misc.i
@@ -70,248 +70,3 @@ __wt_verbose(WT_SESSION_IMPL *session, int flag, const char *fmt, ...)
return (0);
#endif
}
-
-/*
- * __wt_dirlist --
- * Get a list of files from a directory.
- */
-static inline int
-__wt_dirlist(WT_SESSION_IMPL *session, const char *dir,
- const char *prefix, uint32_t flags, char ***dirlist, u_int *countp)
-{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY));
-
- WT_RET(__wt_verbose(session, WT_VERB_FILEOPS,
- "%s: directory-list: %s prefix %s",
- dir, LF_ISSET(WT_DIRLIST_INCLUDE) ? "include" : "exclude",
- prefix == NULL ? "all" : prefix));
-
- return (S2C(session)->file_directory_list(
- session, dir, prefix, flags, dirlist, countp));
-}
-
-/*
- * __wt_directory_sync --
- * Flush a directory to ensure file creation is durable.
- */
-static inline int
-__wt_directory_sync(WT_SESSION_IMPL *session, const char *name)
-{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
-
- WT_RET(__wt_verbose(
- session, WT_VERB_FILEOPS, "%s: directory-sync", name));
-
- return (S2C(session)->file_directory_sync(session, name));
-}
-
-/*
- * __wt_exist --
- * Return if the file exists.
- */
-static inline int
-__wt_exist(WT_SESSION_IMPL *session, const char *name, bool *existp)
-{
- WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-exist", name));
-
- return (S2C(session)->file_exist(session, name, existp));
-}
-
-/*
- * __wt_remove --
- * POSIX remove.
- */
-static inline int
-__wt_remove(WT_SESSION_IMPL *session, const char *name)
-{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
-
- WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-remove", name));
-
- return (S2C(session)->file_remove(session, name));
-}
-
-/*
- * __wt_rename --
- * POSIX rename.
- */
-static inline int
-__wt_rename(WT_SESSION_IMPL *session, const char *from, const char *to)
-{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
-
- WT_RET(__wt_verbose(
- session, WT_VERB_FILEOPS, "%s to %s: file-rename", from, to));
-
- return (S2C(session)->file_rename(session, from, to));
-}
-
-/*
- * __wt_filesize_name --
- * Get the size of a file in bytes, by file name.
- */
-static inline int
-__wt_filesize_name(
- WT_SESSION_IMPL *session, const char *name, bool silent, wt_off_t *sizep)
-{
- WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-size", name));
-
- return (S2C(session)->file_size(session, name, silent, sizep));
-}
-
-/*
- * __wt_directory_sync_fh --
- * Flush a directory file handle to ensure file creation is durable.
- *
- * We don't use the normal sync path because many file systems don't require
- * this step and we don't want to penalize them.
- */
-static inline int
-__wt_directory_sync_fh(WT_SESSION_IMPL *session, WT_FH *fh)
-{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
-
- return (fh->fh_sync(session, fh, true));
-}
-
-/*
- * __wt_fallocate --
- * Extend a file.
- */
-static inline int
-__wt_fallocate(
- WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, wt_off_t len)
-{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY));
-
- WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
- "%s: handle-allocate: %" PRIuMAX " at %" PRIuMAX,
- fh->name, (uintmax_t)len, (uintmax_t)offset));
-
- return (fh->fh_allocate(session, fh, offset, len));
-}
-
-/*
- * __wt_file_lock --
- * Lock/unlock a file.
- */
-static inline int
-__wt_file_lock(WT_SESSION_IMPL * session, WT_FH *fh, bool lock)
-{
- WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
- "%s: handle-lock: %s", fh->name, lock ? "lock" : "unlock"));
-
- return (fh->fh_lock(session, fh, lock));
-}
-
-/*
- * __wt_vfprintf --
- * ANSI C vfprintf.
- */
-static inline int
-__wt_vfprintf(WT_SESSION_IMPL *session, WT_FH *fh, const char *fmt, va_list ap)
-{
- WT_RET(__wt_verbose(
- session, WT_VERB_HANDLEOPS, "%s: handle-printf", fh->name));
-
- return (fh->fh_printf(session, fh, fmt, ap));
-}
-
-/*
- * __wt_fprintf --
- * ANSI C fprintf.
- */
-static inline int
-__wt_fprintf(WT_SESSION_IMPL *session, WT_FH *fh, const char *fmt, ...)
- WT_GCC_FUNC_ATTRIBUTE((format (printf, 3, 4)))
-{
- WT_DECL_RET;
- va_list ap;
-
- va_start(ap, fmt);
- ret = __wt_vfprintf(session, fh, fmt, ap);
- va_end(ap);
-
- return (ret);
-}
-
-/*
- * __wt_read --
- * POSIX pread.
- */
-static inline int
-__wt_read(
- WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, size_t len, void *buf)
-{
- WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
- "%s: handle-read: %" WT_SIZET_FMT " at %" PRIuMAX,
- fh->name, len, (uintmax_t)offset));
-
- WT_STAT_FAST_CONN_INCR(session, read_io);
-
- return (fh->fh_read(session, fh, offset, len, buf));
-}
-
-/*
- * __wt_filesize --
- * Get the size of a file in bytes, by file handle.
- */
-static inline int
-__wt_filesize(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t *sizep)
-{
- WT_RET(__wt_verbose(
- session, WT_VERB_HANDLEOPS, "%s: handle-size", fh->name));
-
- return (fh->fh_size(session, fh, sizep));
-}
-
-/*
- * __wt_fsync --
- * POSIX fflush/fsync.
- */
-static inline int
-__wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh, bool block)
-{
- WT_RET(__wt_verbose(
- session, WT_VERB_HANDLEOPS, "%s: handle-sync", fh->name));
-
- return (fh->fh_sync(session, fh, block));
-}
-
-/*
- * __wt_ftruncate --
- * POSIX ftruncate.
- */
-static inline int
-__wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len)
-{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
-
- WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
- "%s: handle-truncate: %" PRIuMAX,
- fh->name, (uintmax_t)len));
-
- return (fh->fh_truncate(session, fh, len));
-}
-
-/*
- * __wt_write --
- * POSIX pwrite.
- */
-static inline int
-__wt_write(WT_SESSION_IMPL *session,
- WT_FH *fh, wt_off_t offset, size_t len, const void *buf)
-{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY) ||
- WT_STRING_MATCH(fh->name,
- WT_SINGLETHREAD, strlen(WT_SINGLETHREAD)));
-
- WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
- "%s: handle-write: %" WT_SIZET_FMT " at %" PRIuMAX,
- fh->name, len, (uintmax_t)offset));
-
- WT_STAT_FAST_CONN_INCR(session, write_io);
-
- return (fh->fh_write(session, fh, offset, len, buf));
-}
diff --git a/src/include/os.h b/src/include/os.h
index 2ff41d39f46..bf60f32f764 100644
--- a/src/include/os.h
+++ b/src/include/os.h
@@ -6,14 +6,6 @@
* See the file LICENSE for redistribution information.
*/
-/*
- * Number of directory entries can grow dynamically.
- */
-#define WT_DIR_ENTRY 32
-
-#define WT_DIRLIST_EXCLUDE 0x1 /* Exclude files matching prefix */
-#define WT_DIRLIST_INCLUDE 0x2 /* Include files matching prefix */
-
#define WT_SYSCALL_RETRY(call, ret) do { \
int __retry; \
for (__retry = 0; __retry < 10; ++__retry) { \
@@ -59,81 +51,97 @@
(t1).tv_nsec == (t2).tv_nsec ? 0 : 1 : 1)
/*
- * The underlying OS calls return ENOTSUP if posix_fadvise functionality isn't
- * available, but WiredTiger uses the POSIX flag names in the API. Use distinct
- * values so the underlying code can distinguish.
+ * Macros to ensure a file handle is inserted or removed from both the main and
+ * the hashed queue, used by connection-level and in-memory data structures.
*/
-#ifndef POSIX_FADV_DONTNEED
-#define POSIX_FADV_DONTNEED 0x01
-#endif
-#ifndef POSIX_FADV_WILLNEED
-#define POSIX_FADV_WILLNEED 0x02
-#endif
+#define WT_FILE_HANDLE_INSERT(h, fh, bucket) do { \
+ TAILQ_INSERT_HEAD(&(h)->fhqh, fh, q); \
+ TAILQ_INSERT_HEAD(&(h)->fhhash[bucket], fh, hashq); \
+} while (0)
-#define WT_OPEN_CREATE 0x001 /* Create is OK */
-#define WT_OPEN_EXCLUSIVE 0x002 /* Exclusive open */
-#define WT_OPEN_FIXED 0x004 /* Path isn't relative to home */
-#define WT_OPEN_READONLY 0x008 /* Readonly open */
-#define WT_STREAM_APPEND 0x010 /* Open a stream: append */
-#define WT_STREAM_LINE_BUFFER 0x020 /* Line buffer the stream */
-#define WT_STREAM_READ 0x040 /* Open a stream: read */
-#define WT_STREAM_WRITE 0x080 /* Open a stream: write */
+#define WT_FILE_HANDLE_REMOVE(h, fh, bucket) do { \
+ TAILQ_REMOVE(&(h)->fhqh, fh, q); \
+ TAILQ_REMOVE(&(h)->fhhash[bucket], fh, hashq); \
+} while (0)
struct __wt_fh {
+ /*
+ * There is a file name field in both the WT_FH and WT_FILE_HANDLE
+ * structures, which isn't ideal. There would be compromises to keeping
+ * a single copy: If it were in WT_FH, file systems could not access
+ * the name field, if it were just in the WT_FILE_HANDLE internal
+ * WiredTiger code would need to maintain a string inside a structure
+ * that is owned by the user (since we care about the content of the
+ * file name). Keeping two copies seems most reasonable.
+ */
const char *name; /* File name */
- uint64_t name_hash; /* Hash of name */
- TAILQ_ENTRY(__wt_fh) q; /* List of open handles */
- TAILQ_ENTRY(__wt_fh) hashq; /* Hashed list of handles */
- u_int ref; /* Reference count */
+ uint64_t name_hash; /* hash of name */
+ TAILQ_ENTRY(__wt_fh) q; /* internal queue */
+ TAILQ_ENTRY(__wt_fh) hashq; /* internal hash queue */
+ u_int ref; /* reference count */
+
+ WT_FILE_HANDLE *handle;
+};
+
+#ifdef _WIN32
+struct __wt_file_handle_win {
+ WT_FILE_HANDLE iface;
/*
- * Underlying file system handle support.
+ * Windows specific file handle fields
*/
-#ifdef _WIN32
HANDLE filehandle; /* Windows file handle */
HANDLE filehandle_secondary; /* Windows file handle
for file size changes */
+ bool direct_io; /* O_DIRECT configured */
+};
+
#else
+
+struct __wt_file_handle_posix {
+ WT_FILE_HANDLE iface;
+
+ /*
+ * POSIX specific file handle fields
+ */
int fd; /* POSIX file handle */
+
+ bool direct_io; /* O_DIRECT configured */
+};
#endif
- FILE *fp; /* ANSI C stdio handle */
+
+struct __wt_file_handle_inmem {
+ WT_FILE_HANDLE iface;
/*
- * Underlying in-memory handle support.
+ * In memory specific file handle fields
*/
+ uint64_t name_hash; /* hash of name */
+ TAILQ_ENTRY(__wt_file_handle_inmem) q; /* internal queue, hash queue */
+ TAILQ_ENTRY(__wt_file_handle_inmem) hashq;
+
size_t off; /* Read/write offset */
WT_ITEM buf; /* Data */
+ u_int ref; /* Reference count */
+};
- bool direct_io; /* O_DIRECT configured */
+struct __wt_fstream {
+ const char *name; /* Stream name */
- enum { /* file extend configuration */
- WT_FALLOCATE_AVAILABLE,
- WT_FALLOCATE_NOT_AVAILABLE,
- WT_FALLOCATE_POSIX,
- WT_FALLOCATE_STD,
- WT_FALLOCATE_SYS } fallocate_available;
- bool fallocate_requires_locking;
+ FILE *fp; /* stdio FILE stream */
+ WT_FH *fh; /* WT file handle */
+ wt_off_t off; /* Read/write offset */
+ wt_off_t size; /* File size */
+ WT_ITEM buf; /* Data */
-#define WT_FH_FLUSH_ON_CLOSE 0x01 /* Flush when closing */
-#define WT_FH_IN_MEMORY 0x02 /* In-memory, don't remove */
+#define WT_STREAM_APPEND 0x01 /* Open a stream for append */
+#define WT_STREAM_READ 0x02 /* Open a stream for read */
+#define WT_STREAM_WRITE 0x04 /* Open a stream for write */
uint32_t flags;
- int (*fh_advise)(WT_SESSION_IMPL *, WT_FH *, wt_off_t, wt_off_t, int);
- int (*fh_allocate)(WT_SESSION_IMPL *, WT_FH *, wt_off_t, wt_off_t);
- int (*fh_close)(WT_SESSION_IMPL *, WT_FH *);
- int (*fh_getc)(WT_SESSION_IMPL *, WT_FH *, int *);
- int (*fh_lock)(WT_SESSION_IMPL *, WT_FH *, bool);
- int (*fh_map)(WT_SESSION_IMPL *, WT_FH *, void *, size_t *, void **);
- int (*fh_map_discard)(WT_SESSION_IMPL *, WT_FH *, void *, size_t);
- int (*fh_map_preload)(WT_SESSION_IMPL *, WT_FH *, const void *, size_t);
- int (*fh_map_unmap)(
- WT_SESSION_IMPL *, WT_FH *, void *, size_t, void **);
- int (*fh_printf)(WT_SESSION_IMPL *, WT_FH *, const char *, va_list);
- int (*fh_read)(WT_SESSION_IMPL *, WT_FH *, wt_off_t, size_t, void *);
- int (*fh_size)(WT_SESSION_IMPL *, WT_FH *, wt_off_t *);
- int (*fh_sync)(WT_SESSION_IMPL *, WT_FH *, bool);
- int (*fh_truncate)(WT_SESSION_IMPL *, WT_FH *, wt_off_t);
- int (*fh_write)(
- WT_SESSION_IMPL *, WT_FH *, wt_off_t, size_t, const void *);
+ int (*close)(WT_SESSION_IMPL *, WT_FSTREAM *);
+ int (*flush)(WT_SESSION_IMPL *, WT_FSTREAM *);
+ int (*getline)(WT_SESSION_IMPL *, WT_FSTREAM *, WT_ITEM *);
+ int (*printf)(WT_SESSION_IMPL *, WT_FSTREAM *, const char *, va_list);
};
diff --git a/src/include/os_fhandle.i b/src/include/os_fhandle.i
new file mode 100644
index 00000000000..8d2cda4b305
--- /dev/null
+++ b/src/include/os_fhandle.i
@@ -0,0 +1,154 @@
+/*-
+ * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+/*
+ * __wt_fsync --
+ * POSIX fsync.
+ */
+static inline int
+__wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh, bool block)
+{
+ WT_FILE_HANDLE *handle;
+
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
+
+ WT_RET(__wt_verbose(
+ session, WT_VERB_HANDLEOPS, "%s: handle-sync", fh->handle->name));
+
+ handle = fh->handle;
+ if (block)
+ return (handle->sync == NULL ? 0 :
+ handle->sync(handle, (WT_SESSION *)session));
+ else
+ return (handle->sync_nowait == NULL ? 0 :
+ handle->sync_nowait(handle, (WT_SESSION *)session));
+}
+
+/*
+ * __wt_fallocate --
+ * Extend a file.
+ */
+static inline int
+__wt_fallocate(
+ WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, wt_off_t len)
+{
+ WT_DECL_RET;
+ WT_FILE_HANDLE *handle;
+
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY));
+
+ WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
+ "%s: handle-allocate: %" PRIuMAX " at %" PRIuMAX,
+ fh->handle->name, (uintmax_t)len, (uintmax_t)offset));
+
+ /*
+ * Our caller is responsible for handling any locking issues, all we
+ * have to do is find a function to call.
+ *
+ * Be cautious, the underlying system might have configured the nolock
+ * flavor, that failed, and we have to fallback to the locking flavor.
+ */
+ handle = fh->handle;
+ if (handle->fallocate_nolock != NULL) {
+ if ((ret = handle->fallocate_nolock(
+ handle, (WT_SESSION *)session, offset, len)) == 0)
+ return (0);
+ WT_RET_ERROR_OK(ret, ENOTSUP);
+ }
+ if (handle->fallocate != NULL)
+ return (handle->fallocate(
+ handle, (WT_SESSION *)session, offset, len));
+ return (ENOTSUP);
+}
+
+/*
+ * __wt_file_lock --
+ * Lock/unlock a file.
+ */
+static inline int
+__wt_file_lock(WT_SESSION_IMPL * session, WT_FH *fh, bool lock)
+{
+ WT_FILE_HANDLE *handle;
+
+ WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
+ "%s: handle-lock: %s", fh->handle->name, lock ? "lock" : "unlock"));
+
+ handle = fh->handle;
+ return (handle->lock == NULL ? 0 :
+ handle->lock(handle, (WT_SESSION*)session, lock));
+}
+
+/*
+ * __wt_read --
+ * POSIX pread.
+ */
+static inline int
+__wt_read(
+ WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, size_t len, void *buf)
+{
+ WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
+ "%s: handle-read: %" WT_SIZET_FMT " at %" PRIuMAX,
+ fh->handle->name, len, (uintmax_t)offset));
+
+ WT_STAT_FAST_CONN_INCR(session, read_io);
+
+ return (fh->handle->read(
+ fh->handle, (WT_SESSION *)session, offset, len, buf));
+}
+
+/*
+ * __wt_filesize --
+ * Get the size of a file in bytes, by file handle.
+ */
+static inline int
+__wt_filesize(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t *sizep)
+{
+ WT_RET(__wt_verbose(
+ session, WT_VERB_HANDLEOPS, "%s: handle-size", fh->handle->name));
+
+ return (fh->handle->size(fh->handle, (WT_SESSION *)session, sizep));
+}
+
+/*
+ * __wt_ftruncate --
+ * POSIX ftruncate.
+ */
+static inline int
+__wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len)
+{
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
+
+ WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
+ "%s: handle-truncate: %" PRIuMAX,
+ fh->handle->name, (uintmax_t)len));
+
+ return (fh->handle->truncate(fh->handle, (WT_SESSION *)session, len));
+}
+
+/*
+ * __wt_write --
+ * POSIX pwrite.
+ */
+static inline int
+__wt_write(WT_SESSION_IMPL *session,
+ WT_FH *fh, wt_off_t offset, size_t len, const void *buf)
+{
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY) ||
+ WT_STRING_MATCH(fh->name,
+ WT_SINGLETHREAD, strlen(WT_SINGLETHREAD)));
+
+ WT_RET(__wt_verbose(session, WT_VERB_HANDLEOPS,
+ "%s: handle-write: %" WT_SIZET_FMT " at %" PRIuMAX,
+ fh->handle->name, len, (uintmax_t)offset));
+
+ WT_STAT_FAST_CONN_INCR(session, write_io);
+
+ return (fh->handle->write(
+ fh->handle, (WT_SESSION *)session, offset, len, buf));
+}
diff --git a/src/include/os_fs.i b/src/include/os_fs.i
new file mode 100644
index 00000000000..151898711d8
--- /dev/null
+++ b/src/include/os_fs.i
@@ -0,0 +1,243 @@
+/*-
+ * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+/*
+ * __wt_fs_directory_list --
+ * Get a list of files from a directory.
+ */
+static inline int
+__wt_fs_directory_list(WT_SESSION_IMPL *session,
+ const char *dir, const char *prefix, char ***dirlistp, u_int *countp)
+{
+ WT_DECL_RET;
+ WT_FILE_SYSTEM *file_system;
+ WT_SESSION *wt_session;
+ char *path;
+
+ *dirlistp = NULL;
+ *countp = 0;
+
+ WT_RET(__wt_verbose(session, WT_VERB_FILEOPS,
+ "%s: directory-list: %s prefix %s",
+ dir, prefix == NULL ? "all" : prefix));
+
+ WT_RET(__wt_filename(session, dir, &path));
+
+ file_system = S2C(session)->file_system;
+ wt_session = (WT_SESSION *)session;
+ ret = file_system->directory_list(
+ file_system, wt_session, path, prefix, dirlistp, countp);
+
+ __wt_free(session, path);
+ return (ret);
+}
+
+/*
+ * __wt_fs_directory_list_free --
+ * Free memory allocated by __wt_fs_directory_list.
+ */
+static inline int
+__wt_fs_directory_list_free(
+ WT_SESSION_IMPL *session, char ***dirlistp, u_int count)
+{
+ WT_DECL_RET;
+ WT_FILE_SYSTEM *file_system;
+ WT_SESSION *wt_session;
+
+ if (*dirlistp != NULL) {
+ file_system = S2C(session)->file_system;
+ wt_session = (WT_SESSION *)session;
+ ret = file_system->directory_list_free(
+ file_system, wt_session, *dirlistp, count);
+ }
+
+ *dirlistp = NULL;
+ return (ret);
+}
+
+/*
+ * __wt_fs_directory_sync --
+ * Flush a directory to ensure file creation is durable.
+ */
+static inline int
+__wt_fs_directory_sync(WT_SESSION_IMPL *session, const char *name)
+{
+ WT_DECL_RET;
+ WT_FILE_SYSTEM *file_system;
+ WT_SESSION *wt_session;
+ char *copy, *dir;
+
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
+
+ WT_RET(__wt_verbose(
+ session, WT_VERB_FILEOPS, "%s: directory-sync", name));
+
+ /*
+ * POSIX 1003.1 does not require that fsync of a file handle ensures the
+ * entry in the directory containing the file has also reached disk (and
+ * there are historic Linux filesystems requiring it). If the underlying
+ * filesystem method is set, do an explicit fsync on a file descriptor
+ * for the directory to be sure.
+ *
+ * directory-sync is not a required call, no method means the call isn't
+ * needed.
+ */
+ file_system = S2C(session)->file_system;
+ if (file_system->directory_sync == NULL)
+ return (0);
+
+ copy = NULL;
+ if (name == NULL || strchr(name, '/') == NULL)
+ name = S2C(session)->home;
+ else {
+ /*
+ * File name construction should not return a path without any
+ * slash separator, but caution isn't unreasonable.
+ */
+ WT_RET(__wt_filename(session, name, &copy));
+ if ((dir = strrchr(copy, '/')) == NULL)
+ name = S2C(session)->home;
+ else {
+ dir[1] = '\0';
+ name = copy;
+ }
+ }
+
+ wt_session = (WT_SESSION *)session;
+ ret = file_system->directory_sync(file_system, wt_session, name);
+
+ __wt_free(session, copy);
+ return (ret);
+}
+
+/*
+ * __wt_fs_exist --
+ * Return if the file exists.
+ */
+static inline int
+__wt_fs_exist(WT_SESSION_IMPL *session, const char *name, bool *existp)
+{
+ WT_DECL_RET;
+ WT_FILE_SYSTEM *file_system;
+ WT_SESSION *wt_session;
+ char *path;
+
+ WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-exist", name));
+
+ WT_RET(__wt_filename(session, name, &path));
+
+ file_system = S2C(session)->file_system;
+ wt_session = (WT_SESSION *)session;
+ ret = file_system->exist(file_system, wt_session, path, existp);
+
+ __wt_free(session, path);
+ return (ret);
+}
+
+/*
+ * __wt_fs_remove --
+ * POSIX remove.
+ */
+static inline int
+__wt_fs_remove(WT_SESSION_IMPL *session, const char *name)
+{
+ WT_DECL_RET;
+ WT_FILE_SYSTEM *file_system;
+ WT_SESSION *wt_session;
+ char *path;
+
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
+
+ WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-remove", name));
+
+#ifdef HAVE_DIAGNOSTIC
+ /*
+ * It is a layering violation to retrieve a WT_FH here, but it is a
+ * useful diagnostic to ensure WiredTiger doesn't have the handle open.
+ */
+ if (__wt_handle_is_open(session, name))
+ WT_RET_MSG(session, EINVAL,
+ "%s: file-remove: file has open handles", name);
+#endif
+
+ WT_RET(__wt_filename(session, name, &path));
+
+ file_system = S2C(session)->file_system;
+ wt_session = (WT_SESSION *)session;
+ ret = file_system->remove(file_system, wt_session, path);
+
+ __wt_free(session, path);
+ return (ret);
+}
+
+/*
+ * __wt_fs_rename --
+ * POSIX rename.
+ */
+static inline int
+__wt_fs_rename(WT_SESSION_IMPL *session, const char *from, const char *to)
+{
+ WT_DECL_RET;
+ WT_FILE_SYSTEM *file_system;
+ WT_SESSION *wt_session;
+ char *from_path, *to_path;
+
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
+
+ WT_RET(__wt_verbose(
+ session, WT_VERB_FILEOPS, "%s to %s: file-rename", from, to));
+
+#ifdef HAVE_DIAGNOSTIC
+ /*
+ * It is a layering violation to retrieve a WT_FH here, but it is a
+ * useful diagnostic to ensure WiredTiger doesn't have the handle open.
+ */
+ if (__wt_handle_is_open(session, from))
+ WT_RET_MSG(session, EINVAL,
+ "%s: file-rename: file has open handles", from);
+ if (__wt_handle_is_open(session, to))
+ WT_RET_MSG(session, EINVAL,
+ "%s: file-rename: file has open handles", to);
+#endif
+
+ from_path = to_path = NULL;
+ WT_ERR(__wt_filename(session, from, &from_path));
+ WT_ERR(__wt_filename(session, to, &to_path));
+
+ file_system = S2C(session)->file_system;
+ wt_session = (WT_SESSION *)session;
+ ret = file_system->rename(file_system, wt_session, from_path, to_path);
+
+err: __wt_free(session, from_path);
+ __wt_free(session, to_path);
+ return (ret);
+}
+
+/*
+ * __wt_fs_size --
+ * Get the size of a file in bytes, by file name.
+ */
+static inline int
+__wt_fs_size(WT_SESSION_IMPL *session, const char *name, wt_off_t *sizep)
+{
+ WT_DECL_RET;
+ WT_FILE_SYSTEM *file_system;
+ WT_SESSION *wt_session;
+ char *path;
+
+ WT_RET(__wt_verbose(session, WT_VERB_FILEOPS, "%s: file-size", name));
+
+ WT_RET(__wt_filename(session, name, &path));
+
+ file_system = S2C(session)->file_system;
+ wt_session = (WT_SESSION *)session;
+ ret = file_system->size(file_system, wt_session, path, sizep);
+
+ __wt_free(session, path);
+ return (ret);
+}
diff --git a/src/include/os_fstream.i b/src/include/os_fstream.i
new file mode 100644
index 00000000000..37a6039d1b7
--- /dev/null
+++ b/src/include/os_fstream.i
@@ -0,0 +1,97 @@
+/*-
+ * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+/*
+ * __wt_getline --
+ * Get a line from a stream.
+ */
+static inline int
+__wt_getline(WT_SESSION_IMPL *session, WT_FSTREAM *fs, WT_ITEM *buf)
+{
+ return (fs->getline(session, fs, buf));
+}
+
+/*
+ * __wt_fclose --
+ * Close a stream.
+ */
+static inline int
+__wt_fclose(WT_SESSION_IMPL *session, WT_FSTREAM **fsp)
+{
+ WT_FSTREAM *fs;
+
+ if ((fs = *fsp) == NULL)
+ return (0);
+ *fsp = NULL;
+ return (fs->close(session, fs));
+}
+
+/*
+ * __wt_fflush --
+ * Flush a stream.
+ */
+static inline int
+__wt_fflush(WT_SESSION_IMPL *session, WT_FSTREAM *fs)
+{
+ return (fs->flush(session, fs));
+}
+
+/*
+ * __wt_vfprintf --
+ * ANSI C vfprintf.
+ */
+static inline int
+__wt_vfprintf(
+ WT_SESSION_IMPL *session, WT_FSTREAM *fs, const char *fmt, va_list ap)
+{
+ WT_RET(__wt_verbose(
+ session, WT_VERB_HANDLEOPS, "%s: handle-printf", fs->name));
+
+ return (fs->printf(session, fs, fmt, ap));
+}
+
+/*
+ * __wt_fprintf --
+ * ANSI C fprintf.
+ */
+static inline int
+__wt_fprintf(WT_SESSION_IMPL *session, WT_FSTREAM *fs, const char *fmt, ...)
+ WT_GCC_FUNC_ATTRIBUTE((format (printf, 3, 4)))
+{
+ WT_DECL_RET;
+ va_list ap;
+
+ va_start(ap, fmt);
+ ret = __wt_vfprintf(session, fs, fmt, ap);
+ va_end(ap);
+
+ return (ret);
+}
+
+/*
+ * __wt_sync_and_rename --
+ * Flush and close a stream, then swap it into place.
+ */
+static inline int
+__wt_sync_and_rename(WT_SESSION_IMPL *session,
+ WT_FSTREAM **fsp, const char *from, const char *to)
+{
+ WT_DECL_RET;
+ WT_FSTREAM *fs;
+
+ fs = *fsp;
+ *fsp = NULL;
+
+ /* Flush to disk and close the handle. */
+ WT_TRET(__wt_fflush(session, fs));
+ WT_TRET(__wt_fsync(session, fs->fh, true));
+ WT_TRET(__wt_fclose(session, &fs));
+ WT_RET(ret);
+
+ return (__wt_rename_and_sync_directory(session, from, to));
+}
diff --git a/src/include/serial.i b/src/include/serial.i
index fa920de7e37..c0cd9c85ee9 100644
--- a/src/include/serial.i
+++ b/src/include/serial.i
@@ -306,7 +306,7 @@ __wt_update_serial(WT_SESSION_IMPL *session, WT_PAGE *page,
if ((txn = page->modify->obsolete_check_txn) != WT_TXN_NONE) {
if (!__wt_txn_visible_all(session, txn)) {
/* Try to move the oldest ID forward and re-check. */
- __wt_txn_update_oldest(session, false);
+ WT_RET(__wt_txn_update_oldest(session, false));
if (!__wt_txn_visible_all(session, txn))
return (0);
diff --git a/src/include/stat.h b/src/include/stat.h
index f9170dc1a79..18461b1ee38 100644
--- a/src/include/stat.h
+++ b/src/include/stat.h
@@ -261,11 +261,16 @@ struct __wt_connection_stats {
int64_t cache_bytes_read;
int64_t cache_bytes_write;
int64_t cache_eviction_checkpoint;
+ int64_t cache_eviction_get_ref;
+ int64_t cache_eviction_get_ref_empty;
+ int64_t cache_eviction_get_ref_empty2;
int64_t cache_eviction_aggressive_set;
int64_t cache_eviction_queue_empty;
int64_t cache_eviction_queue_not_empty;
int64_t cache_eviction_server_evicting;
int64_t cache_eviction_server_not_evicting;
+ int64_t cache_eviction_server_toobig;
+ int64_t cache_eviction_server_slept;
int64_t cache_eviction_slow;
int64_t cache_eviction_worker_evicting;
int64_t cache_eviction_force_fail;
@@ -288,6 +293,7 @@ struct __wt_connection_stats {
int64_t cache_eviction_app;
int64_t cache_read;
int64_t cache_read_lookaside;
+ int64_t cache_pages_requested;
int64_t cache_eviction_fail;
int64_t cache_eviction_walk;
int64_t cache_write;
@@ -458,6 +464,7 @@ struct __wt_dsrc_stats {
int64_t cache_write_lookaside;
int64_t cache_read;
int64_t cache_read_lookaside;
+ int64_t cache_pages_requested;
int64_t cache_write;
int64_t cache_write_restore;
int64_t cache_eviction_clean;
diff --git a/src/include/txn.h b/src/include/txn.h
index 1e82e2d982a..d10738cc670 100644
--- a/src/include/txn.h
+++ b/src/include/txn.h
@@ -74,7 +74,7 @@ struct __wt_txn_global {
volatile uint64_t current; /* Current transaction ID. */
/* The oldest running transaction ID (may race). */
- uint64_t last_running;
+ volatile uint64_t last_running;
/*
* The oldest transaction ID that is not yet visible to some
@@ -82,8 +82,11 @@ struct __wt_txn_global {
*/
volatile uint64_t oldest_id;
- /* Count of scanning threads, or -1 for exclusive access. */
- volatile int32_t scan_count;
+ /*
+ * Prevents the oldest ID moving forwards while threads are scanning
+ * the global transaction state.
+ */
+ WT_RWLOCK *scan_rwlock;
/*
* Track information about the running checkpoint. The transaction
diff --git a/src/include/txn.i b/src/include/txn.i
index f5ca44c2ada..96f7426e421 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -261,14 +261,14 @@ __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[])
* eviction, it's better to do it beforehand.
*/
WT_RET(__wt_cache_eviction_check(session, false, NULL));
-
- __wt_txn_get_snapshot(session);
+ WT_RET(__wt_txn_get_snapshot(session));
}
F_SET(txn, WT_TXN_RUNNING);
if (F_ISSET(S2C(session), WT_CONN_READONLY))
F_SET(txn, WT_TXN_READONLY);
- return (false);
+
+ return (0);
}
/*
@@ -450,7 +450,7 @@ __wt_txn_read_last(WT_SESSION_IMPL *session)
* __wt_txn_cursor_op --
* Called for each cursor operation.
*/
-static inline void
+static inline int
__wt_txn_cursor_op(WT_SESSION_IMPL *session)
{
WT_TXN *txn;
@@ -482,7 +482,9 @@ __wt_txn_cursor_op(WT_SESSION_IMPL *session)
if (txn_state->snap_min == WT_TXN_NONE)
txn_state->snap_min = txn_global->last_running;
} else if (!F_ISSET(txn, WT_TXN_HAS_SNAPSHOT))
- __wt_txn_get_snapshot(session);
+ WT_RET(__wt_txn_get_snapshot(session));
+
+ return (0);
}
/*
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index 279858a808e..007df44f257 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -71,6 +71,8 @@ struct __wt_encryptor; typedef struct __wt_encryptor WT_ENCRYPTOR;
struct __wt_event_handler; typedef struct __wt_event_handler WT_EVENT_HANDLER;
struct __wt_extension_api; typedef struct __wt_extension_api WT_EXTENSION_API;
struct __wt_extractor; typedef struct __wt_extractor WT_EXTRACTOR;
+struct __wt_file_handle; typedef struct __wt_file_handle WT_FILE_HANDLE;
+struct __wt_file_system; typedef struct __wt_file_system WT_FILE_SYSTEM;
struct __wt_item; typedef struct __wt_item WT_ITEM;
struct __wt_session; typedef struct __wt_session WT_SESSION;
@@ -421,6 +423,9 @@ struct __wt_cursor {
* @errors
* In particular, if \c overwrite is not configured and a record with
* the specified key already exists, ::WT_DUPLICATE_KEY is returned.
+ * Also, if \c in_memory is configured for the database and the insert
+ * requires more than the configured cache size to complete,
+ * ::WT_CACHE_FULL is returned.
*/
int __F(insert)(WT_CURSOR *cursor);
@@ -451,6 +456,9 @@ struct __wt_cursor {
* @errors
* In particular, if \c overwrite is not configured and no record with
* the specified key exists, ::WT_NOTFOUND is returned.
+ * Also, if \c in_memory is configured for the database and the insert
+ * requires more than the configured cache size to complete,
+ * ::WT_CACHE_FULL is returned.
*/
int __F(update)(WT_CURSOR *cursor);
@@ -1241,18 +1249,21 @@ struct __wt_session {
* @param join_cursor a cursor that was opened using a
* \c "join:" URI. It may not have been used for any operations
* other than other join calls.
- * @param ref_cursor either an index cursor having the same base table
- * as the join_cursor, or a table cursor open on the same base table.
- * The ref_cursor must be positioned.
+ * @param ref_cursor an index cursor having the same base table
+ * as the join_cursor, or a table cursor open on the same base table,
+ * or another join cursor. Unless the ref_cursor is another join
+ * cursor, it must be positioned.
*
* The ref_cursor limits the results seen by iterating the
* join_cursor to table items referred to by the key in this
* index. The set of keys referred to is modified by the compare
* config option.
*
- * Multiple join calls builds up a set of ref_cursors, and the
- * results seen by iteration are the intersection of the cursor
- * ranges participating in the join.
+ * Multiple join calls builds up a set of ref_cursors, and
+ * by default, the results seen by iteration are the intersection
+ * of the cursor ranges participating in the join. When configured
+ * with \c "operation=or", the results seen are the union of
+ * the participating cursor ranges.
*
* After the join call completes, the ref_cursor cursor may not be
* used for any purpose other than get_key and get_value. Any other
@@ -1275,6 +1286,13 @@ struct __wt_session {
* also influences evaluation order for cursors in the join. When the
* count is equal for multiple bloom filters in a composition of joins\,
* the bloom filter may be shared., an integer; default \c .}
+ * @config{operation, the operation applied between this and other
+ * joined cursors. When "operation=and" is specified\, all the
+ * conditions implied by joins must be satisfied for an entry to be
+ * returned by the join cursor; when "operation=or" is specified\, only
+ * one must be satisfied. All cursors joined to a join cursor must have
+ * matching operations., a string\, chosen from the following options:
+ * \c "and"\, \c "or"; default \c "and".}
* @config{strategy, when set to bloom\, a bloom filter is created and
* populated for this index. This has an up front cost but may reduce
* the number of accesses to the main table when iterating the joined
@@ -2018,6 +2036,10 @@ struct __wt_connection {
* @configstart{WT_CONNECTION.load_extension, see dist/api_data.py}
* @config{config, configuration string passed to the entry point of the
* extension as its WT_CONFIG_ARG argument., a string; default empty.}
+ * @config{early_load, whether this extension should be loaded at the
+ * beginning of ::wiredtiger_open. Only applicable to extensions loaded
+ * via the wiredtiger_open configurations string., a boolean flag;
+ * default \c false.}
* @config{entry, the entry point of the extension\, called to
* initialize the extension when it is loaded. The signature of the
* function must match ::wiredtiger_extension_init., a string; default
@@ -2129,6 +2151,23 @@ struct __wt_connection {
WT_EXTRACTOR *extractor, const char *config);
/*!
+ * Configure a custom file system.
+ *
+ * This method can only be called from an early loaded extension
+ * module. The application must first implement the WT_FILE_SYSTEM
+ * interface and then register the implementation with WiredTiger:
+ *
+ * @snippet ex_file_system.c WT_FILE_SYSTEM register
+ *
+ * @param connection the connection handle
+ * @param fs the populated file system structure
+ * @configempty{WT_CONNECTION.set_file_system, see dist/api_data.py}
+ * @errors
+ */
+ int __F(set_file_system)(
+ WT_CONNECTION *connection, WT_FILE_SYSTEM *fs, const char *config);
+
+ /*!
* Return a reference to the WiredTiger extension functions.
*
* @snippet ex_data_source.c WT_EXTENSION_API declaration
@@ -2289,6 +2328,8 @@ struct __wt_connection {
* @config{ ),,}
* @config{hazard_max, maximum number of simultaneous hazard pointers per
* session handle., an integer greater than or equal to 15; default \c 1000.}
+ * @config{in_memory, keep data in-memory only. See @ref in_memory for more
+ * information., a boolean flag; default \c false.}
* @config{log = (, enable logging. Enabling logging uses three sessions from
* the configured session_max., a set of related configuration options defined
* below.}
@@ -3003,15 +3044,15 @@ const char *wiredtiger_version(int *majorp, int *minorp, int *patchp);
* if recovery is required to use the database.
*/
#define WT_RUN_RECOVERY -31806
-/*! @cond internal */
/*!
* Operation would overflow cache.
- * This error is generated when wiredtiger_open is configured to run in-memory,
- * and an insert or update operation requires more than the configured cache
- * size to complete.
+ * This error is only generated when wiredtiger_open is configured to run in-
+ * memory, and an insert or update operation requires more than the configured
+ * cache size to complete. The operation may be retried; if a transaction is in
+ * progress, it should be rolled back and the operation retried in a new
+ * transaction.
*/
#define WT_CACHE_FULL -31807
-/*! @endcond */
/*! @cond internal */
/*! Permission denied (internal). */
#define WT_PERM_DENIED -31808
@@ -3038,7 +3079,7 @@ const char *wiredtiger_version(int *majorp, int *minorp, int *patchp);
/*******************************************
* Forward structure declarations for the extension API
*******************************************/
-struct __wt_config_arg; typedef struct __wt_config_arg WT_CONFIG_ARG;
+struct __wt_config_arg; typedef struct __wt_config_arg WT_CONFIG_ARG;
/*!
* The interface implemented by applications to provide custom ordering of
@@ -3569,7 +3610,7 @@ struct __wt_encryptor {
* number of bytes needed.
*
* @param[out] expansion_constantp the additional number of bytes needed
- * when encrypting.
+ * when encrypting.
* @returns zero for success, non-zero to indicate an error.
*
* @snippet nop_encrypt.c WT_ENCRYPTOR sizing
@@ -3588,8 +3629,7 @@ struct __wt_encryptor {
* is used instead of this one for any callbacks.
*
* @param[in] encrypt_config the "encryption" portion of the
- * configuration from the wiredtiger_open or
- * WT_SESSION::create call
+ * configuration from the wiredtiger_open or WT_SESSION::create call
* @param[out] customp the new modified encryptor, or NULL.
* @returns zero for success, non-zero to indicate an error.
*/
@@ -3664,6 +3704,466 @@ struct __wt_extractor {
int (*terminate)(WT_EXTRACTOR *extractor, WT_SESSION *session);
};
+#if !defined(SWIG)
+/*! WT_FILE_SYSTEM::open_file file types */
+typedef enum {
+ WT_OPEN_FILE_TYPE_CHECKPOINT, /*!< open a data file checkpoint */
+ WT_OPEN_FILE_TYPE_DATA, /*!< open a data file */
+ WT_OPEN_FILE_TYPE_DIRECTORY, /*!< open a directory */
+ WT_OPEN_FILE_TYPE_LOG, /*!< open a log file */
+ WT_OPEN_FILE_TYPE_REGULAR /*!< open a regular file */
+} WT_OPEN_FILE_TYPE;
+
+/*! WT_FILE_SYSTEM::open_file flags: create if does not exist */
+#define WT_OPEN_CREATE 0x001
+/*! WT_FILE_SYSTEM::open_file flags: direct I/O requested */
+#define WT_OPEN_DIRECTIO 0x002
+/*! WT_FILE_SYSTEM::open_file flags: error if exclusive use not available */
+#define WT_OPEN_EXCLUSIVE 0x004
+#ifndef DOXYGEN
+#define WT_OPEN_FIXED 0x008 /* Path not home relative (internal) */
+#endif
+/*! WT_FILE_SYSTEM::open_file flags: open is read-only */
+#define WT_OPEN_READONLY 0x010
+
+/*!
+ * The interface implemented by applications to provide a custom file system
+ * implementation.
+ *
+ * <b>Thread safety:</b> WiredTiger may invoke methods on the WT_FILE_SYSTEM
+ * interface from multiple threads concurrently. It is the responsibility of
+ * the implementation to protect any shared data.
+ *
+ * Applications register implementations with WiredTiger by calling
+ * WT_CONNECTION::add_file_system. See @ref custom_file_systems for more
+ * information.
+ *
+ * @snippet ex_file_system.c WT_FILE_SYSTEM register
+ */
+struct __wt_file_system {
+ /*!
+ * Return a list of file names for the named directory.
+ *
+ * @errors
+ *
+ * @param file_system the WT_FILE_SYSTEM
+ * @param session the current WiredTiger session
+ * @param directory the name of the directory
+ * @param prefix if not NULL, only files with names matching the prefix
+ * are returned
+ * @param[out] dirlist the method returns an allocated array of
+ * individually allocated strings, one for each entry in the
+ * directory.
+ * @param[out] countp the method the number of entries returned
+ */
+ int (*directory_list)(WT_FILE_SYSTEM *file_system, WT_SESSION *session,
+ const char *directory, const char *prefix, char ***dirlist,
+ uint32_t *countp);
+
+ /*!
+ * Free memory allocated by WT_FILE_SYSTEM::directory_list.
+ *
+ * @errors
+ *
+ * @param file_system the WT_FILE_SYSTEM
+ * @param session the current WiredTiger session
+ * @param dirlist array returned by WT_FILE_SYSTEM::directory_list
+ * @param count count returned by WT_FILE_SYSTEM::directory_list
+ */
+ int (*directory_list_free)(WT_FILE_SYSTEM *file_system,
+ WT_SESSION *session, char **dirlist, uint32_t count);
+
+ /*!
+ * Flush the named directory.
+ *
+ * This method is not required for readonly file systems or file systems
+ * where it is not necessary to flush a file's directory to ensure the
+ * durability of file system operations, and should be set to NULL when
+ * not required by the file system.
+ *
+ * @errors
+ *
+ * @param file_system the WT_FILE_SYSTEM
+ * @param session the current WiredTiger session
+ * @param directory the name of the directory
+ */
+ int (*directory_sync)(WT_FILE_SYSTEM *file_system,
+ WT_SESSION *session, const char *directory);
+
+ /*!
+ * Return if the named file system object exists.
+ *
+ * @errors
+ *
+ * @param file_system the WT_FILE_SYSTEM
+ * @param session the current WiredTiger session
+ * @param name the name of the file
+ * @param[out] existp If the named file system object exists
+ */
+ int (*exist)(WT_FILE_SYSTEM *file_system,
+ WT_SESSION *session, const char *name, bool *existp);
+
+ /*!
+ * Open a handle for a named file system object
+ *
+ * @errors
+ *
+ * @param file_system the WT_FILE_SYSTEM
+ * @param session the current WiredTiger session
+ * @param name the name of the file system object
+ * @param file_type the type of the file
+ * The file type is provided to allow optimization for different file
+ * access patterns.
+ * @param flags flags indicating how to open the file, one or more of
+ * ::WT_OPEN_CREATE, ::WT_OPEN_DIRECTIO, ::WT_OPEN_EXCLUSIVE or
+ * ::WT_OPEN_READONLY.
+ * @param[out] file_handlep the handle to the newly opened file. File
+ * system implementations must allocate memory for the handle and
+ * the WT_FILE_HANDLE::name field, and fill in the WT_FILE_HANDLE::
+ * fields. Applications wanting to associate private information
+ * with the WT_FILE_HANDLE:: structure should declare and allocate
+ * their own structure as a superset of a WT_FILE_HANDLE:: structure.
+ */
+ int (*open_file)(WT_FILE_SYSTEM *file_system, WT_SESSION *session,
+ const char *name, WT_OPEN_FILE_TYPE file_type, uint32_t flags,
+ WT_FILE_HANDLE **file_handlep);
+
+ /*!
+ * Remove a named file system object
+ *
+ * This method is not required for readonly file systems and should be
+ * set to NULL when not required by the file system.
+ *
+ * @errors
+ *
+ * @param file_system the WT_FILE_SYSTEM
+ * @param session the current WiredTiger session
+ * @param name the name of the file system object
+ */
+ int (*remove)(
+ WT_FILE_SYSTEM *file_system, WT_SESSION *session, const char *name);
+
+ /*!
+ * Rename a named file system object
+ *
+ * This method is not required for readonly file systems and should be
+ * set to NULL when not required by the file system.
+ *
+ * @errors
+ *
+ * @param file_system the WT_FILE_SYSTEM
+ * @param session the current WiredTiger session
+ * @param from the original name of the object
+ * @param to the new name for the object
+ */
+ int (*rename)(WT_FILE_SYSTEM *file_system,
+ WT_SESSION *session, const char *from, const char *to);
+
+ /*!
+ * Return the size of a named file system object
+ *
+ * @errors
+ *
+ * @param file_system the WT_FILE_SYSTEM
+ * @param session the current WiredTiger session
+ * @param name the name of the file system object
+ * @param[out] sizep the size of the file system entry
+ */
+ int (*size)(WT_FILE_SYSTEM *file_system,
+ WT_SESSION *session, const char *name, wt_off_t *sizep);
+
+ /*!
+ * A callback performed when the file system is closed and will no
+ * longer be accessed by the WiredTiger database.
+ *
+ * This method is not required and should be set to NULL when not
+ * required by the file system.
+ *
+ * The WT_FILE_SYSTEM::terminate callback is intended to allow cleanup,
+ * the handle will not be subsequently accessed by WiredTiger.
+ */
+ int (*terminate)(WT_FILE_SYSTEM *file_system, WT_SESSION *session);
+};
+
+/*! WT_FILE_HANDLE::fadvise flags: no longer need */
+#define WT_FILE_HANDLE_DONTNEED 1
+/*! WT_FILE_HANDLE::fadvise flags: will need */
+#define WT_FILE_HANDLE_WILLNEED 2
+
+/*!
+ * A file handle implementation returned by WT_FILE_SYSTEM::open_file.
+ *
+ * <b>Thread safety:</b> Unless explicitly stated otherwise, WiredTiger may
+ * invoke methods on the WT_FILE_HANDLE interface from multiple threads
+ * concurrently. It is the responsibility of the implementation to protect
+ * any shared data.
+ *
+ * See @ref custom_file_systems for more information.
+ */
+struct __wt_file_handle {
+ /*!
+ * The enclosing file system, set by WT_FILE_SYSTEM::open_file.
+ */
+ WT_FILE_SYSTEM *file_system;
+
+ /*!
+ * The name of the file, set by WT_FILE_SYSTEM::open_file.
+ */
+ char *name;
+
+ /*!
+ * Close a file handle, the handle will not be further accessed by
+ * WiredTiger.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ */
+ int (*close)(WT_FILE_HANDLE *file_handle, WT_SESSION *session);
+
+ /*!
+ * Indicate expected future use of file ranges, based on the POSIX
+ * 1003.1 standard fadvise.
+ *
+ * This method is not required, and should be set to NULL when not
+ * supported by the file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param offset the file offset
+ * @param len the size of the advisory
+ * @param advice one of ::WT_FILE_HANDLE_WILLNEED or
+ * ::WT_FILE_HANDLE_DONTNEED.
+ */
+ int (*fadvise)(WT_FILE_HANDLE *file_handle,
+ WT_SESSION *session, wt_off_t offset, wt_off_t len, int advice);
+
+ /*!
+ * Ensure disk space is allocated for the file, based on the POSIX
+ * 1003.1 standard fallocate.
+ *
+ * This method is not required, and should be set to NULL when not
+ * supported by the file.
+ *
+ * This method is not called by multiple threads concurrently (on the
+ * same file handle). If the file handle's fallocate method supports
+ * concurrent calls, set the WT_FILE_HANDLE::fallocate_nolock method
+ * instead.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param offset the file offset
+ * @param len the size of the advisory
+ */
+ int (*fallocate)(WT_FILE_HANDLE *file_handle,
+ WT_SESSION *session, wt_off_t, wt_off_t);
+
+ /*!
+ * Ensure disk space is allocated for the file, based on the POSIX
+ * 1003.1 standard fallocate.
+ *
+ * This method is not required, and should be set to NULL when not
+ * supported by the file.
+ *
+ * This method may be called by multiple threads concurrently (on the
+ * same file handle). If the file handle's fallocate method does not
+ * support concurrent calls, set the WT_FILE_HANDLE::fallocate method
+ * instead.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param offset the file offset
+ * @param len the size of the advisory
+ */
+ int (*fallocate_nolock)(WT_FILE_HANDLE *file_handle,
+ WT_SESSION *session, wt_off_t, wt_off_t);
+
+ /*!
+ * Lock/unlock a file from the perspective of other processes running
+ * in the system.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param lock whether to lock or unlock
+ */
+ int (*lock)(
+ WT_FILE_HANDLE *file_handle, WT_SESSION *session, bool lock);
+
+ /*!
+ * Map a file into memory, based on the POSIX 1003.1 standard mmap.
+ *
+ * This method is not required, and should be set to NULL when not
+ * supported by the file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param[out] mapped_regionp a reference to a memory location into
+ * which should be stored a pointer to the start of the mapped region
+ * @param[out] lengthp a reference to a memory location into which
+ * should be stored the length of the region
+ * @param[out] mapped_cookiep a reference to a memory location into
+ * which can be optionally stored a pointer to an opaque cookie
+ * which is subsequently passed to WT_FILE_HANDLE::unmap.
+ */
+ int (*map)(WT_FILE_HANDLE *file_handle, WT_SESSION *session,
+ void *mapped_regionp, size_t *lengthp, void *mapped_cookiep);
+
+ /*!
+ * Unmap part of a memory mapped file, based on the POSIX 1003.1
+ * standard madvise.
+ *
+ * This method is not required, and should be set to NULL when not
+ * supported by the file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param map a location in the mapped region unlikely to be used in the
+ * near future
+ * @param length the length of the mapped region to discard
+ * @param mapped_cookie any cookie set by the WT_FILE_HANDLE::map method
+ */
+ int (*map_discard)(WT_FILE_HANDLE *file_handle,
+ WT_SESSION *session, void *map, size_t length, void *mapped_cookie);
+
+ /*!
+ * Preload part of a memory mapped file, based on the POSIX 1003.1
+ * standard madvise.
+ *
+ * This method is not required, and should be set to NULL when not
+ * supported by the file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param map a location in the mapped region likely to be used in the
+ * near future
+ * @param length the size of the mapped region to preload
+ * @param mapped_cookie any cookie set by the WT_FILE_HANDLE::map method
+ */
+ int (*map_preload)(WT_FILE_HANDLE *file_handle, WT_SESSION *session,
+ const void *map, size_t length, void *mapped_cookie);
+
+ /*!
+ * Unmap a memory mapped file, based on the POSIX 1003.1 standard
+ * munmap.
+ *
+ * This method is only required if a valid implementation of map is
+ * provided by the file, and should be set to NULL otherwise.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param mapped_region a pointer to the start of the mapped region
+ * @param length the length of the mapped region
+ * @param mapped_cookie any cookie set by the WT_FILE_HANDLE::map method
+ */
+ int (*unmap)(WT_FILE_HANDLE *file_handle, WT_SESSION *session,
+ void *mapped_region, size_t length, void *mapped_cookie);
+
+ /*!
+ * Read from a file, based on the POSIX 1003.1 standard pread.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param offset the offset in the file to start reading from
+ * @param len the amount to read
+ * @param[out] buf buffer to hold the content read from file
+ */
+ int (*read)(WT_FILE_HANDLE *file_handle,
+ WT_SESSION *session, wt_off_t offset, size_t len, void *buf);
+
+ /*!
+ * Return the size of a file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param sizep the size of the file
+ */
+ int (*size)(
+ WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t *sizep);
+
+ /*!
+ * Make outstanding file writes durable and do not return until writes
+ * are complete.
+ *
+ * This method is not required for read-only files, and should be set
+ * to NULL when not supported by the file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ */
+ int (*sync)(WT_FILE_HANDLE *file_handle, WT_SESSION *session);
+
+ /*!
+ * Schedule the outstanding file writes required for durability and
+ * return immediately.
+ *
+ * This method is not required, and should be set to NULL when not
+ * supported by the file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ */
+ int (*sync_nowait)(WT_FILE_HANDLE *file_handle, WT_SESSION *session);
+
+ /*!
+ * Lengthen or shorten a file to the specified length, based on the
+ * POSIX 1003.1 standard ftruncate.
+ *
+ * This method is not required for read-only files, and should be set
+ * to NULL when not supported by the file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param length desired file size after truncate
+ */
+ int (*truncate)(
+ WT_FILE_HANDLE *file_handle, WT_SESSION *session, wt_off_t length);
+
+ /*!
+ * Write to a file, based on the POSIX 1003.1 standard pwrite.
+ *
+ * This method is not required for read-only files, and should be set
+ * to NULL when not supported by the file.
+ *
+ * @errors
+ *
+ * @param file_handle the WT_FILE_HANDLE
+ * @param session the current WiredTiger session
+ * @param offset offset at which to start writing
+ * @param length amount of data to write
+ * @param buf content to be written to the file
+ */
+ int (*write)(WT_FILE_HANDLE *file_handle, WT_SESSION *session,
+ wt_off_t offset, size_t length, const void *buf);
+};
+#endif /* !defined(SWIG) */
+
/*!
* Entry point to an extension, called when the extension is loaded.
*
@@ -3774,273 +4274,286 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection);
#define WT_STAT_CONN_CACHE_BYTES_WRITE 1032
/*! cache: checkpoint blocked page eviction */
#define WT_STAT_CONN_CACHE_EVICTION_CHECKPOINT 1033
+/*! cache: eviction calls to get a page */
+#define WT_STAT_CONN_CACHE_EVICTION_GET_REF 1034
+/*! cache: eviction calls to get a page found queue empty */
+#define WT_STAT_CONN_CACHE_EVICTION_GET_REF_EMPTY 1035
+/*! cache: eviction calls to get a page found queue empty after locking */
+#define WT_STAT_CONN_CACHE_EVICTION_GET_REF_EMPTY2 1036
/*! cache: eviction currently operating in aggressive mode */
-#define WT_STAT_CONN_CACHE_EVICTION_AGGRESSIVE_SET 1034
+#define WT_STAT_CONN_CACHE_EVICTION_AGGRESSIVE_SET 1037
/*! cache: eviction server candidate queue empty when topping up */
-#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_EMPTY 1035
+#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_EMPTY 1038
/*! cache: eviction server candidate queue not empty when topping up */
-#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1036
+#define WT_STAT_CONN_CACHE_EVICTION_QUEUE_NOT_EMPTY 1039
/*! cache: eviction server evicting pages */
-#define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1037
+#define WT_STAT_CONN_CACHE_EVICTION_SERVER_EVICTING 1040
/*! cache: eviction server populating queue, but not evicting pages */
-#define WT_STAT_CONN_CACHE_EVICTION_SERVER_NOT_EVICTING 1038
+#define WT_STAT_CONN_CACHE_EVICTION_SERVER_NOT_EVICTING 1041
+/*! cache: eviction server skipped very large page */
+#define WT_STAT_CONN_CACHE_EVICTION_SERVER_TOOBIG 1042
+/*! cache: eviction server slept, because we did not make progress with
+ * eviction */
+#define WT_STAT_CONN_CACHE_EVICTION_SERVER_SLEPT 1043
/*! cache: eviction server unable to reach eviction goal */
-#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1039
+#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1044
/*! cache: eviction worker thread evicting pages */
-#define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1040
+#define WT_STAT_CONN_CACHE_EVICTION_WORKER_EVICTING 1045
/*! cache: failed eviction of pages that exceeded the in-memory maximum */
-#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1041
+#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1046
/*! cache: hazard pointer blocked page eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1042
+#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1047
/*! cache: in-memory page passed criteria to be split */
-#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1043
+#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1048
/*! cache: in-memory page splits */
-#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1044
+#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1049
/*! cache: internal pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1045
+#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1050
/*! cache: internal pages split during eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1046
+#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1051
/*! cache: leaf pages split during eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1047
+#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1052
/*! cache: lookaside table insert calls */
-#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1048
+#define WT_STAT_CONN_CACHE_LOOKASIDE_INSERT 1053
/*! cache: lookaside table remove calls */
-#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1049
+#define WT_STAT_CONN_CACHE_LOOKASIDE_REMOVE 1054
/*! cache: maximum bytes configured */
-#define WT_STAT_CONN_CACHE_BYTES_MAX 1050
+#define WT_STAT_CONN_CACHE_BYTES_MAX 1055
/*! cache: maximum page size at eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1051
+#define WT_STAT_CONN_CACHE_EVICTION_MAXIMUM_PAGE_SIZE 1056
/*! cache: modified pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1052
+#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1057
/*! cache: page split during eviction deepened the tree */
-#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1053
+#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1058
/*! cache: page written requiring lookaside records */
-#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1054
+#define WT_STAT_CONN_CACHE_WRITE_LOOKASIDE 1059
/*! cache: pages currently held in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_INUSE 1055
+#define WT_STAT_CONN_CACHE_PAGES_INUSE 1060
/*! cache: pages evicted because they exceeded the in-memory maximum */
-#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1056
+#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1061
/*! cache: pages evicted because they had chains of deleted items */
-#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1057
+#define WT_STAT_CONN_CACHE_EVICTION_FORCE_DELETE 1062
/*! cache: pages evicted by application threads */
-#define WT_STAT_CONN_CACHE_EVICTION_APP 1058
+#define WT_STAT_CONN_CACHE_EVICTION_APP 1063
/*! cache: pages read into cache */
-#define WT_STAT_CONN_CACHE_READ 1059
+#define WT_STAT_CONN_CACHE_READ 1064
/*! cache: pages read into cache requiring lookaside entries */
-#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1060
+#define WT_STAT_CONN_CACHE_READ_LOOKASIDE 1065
+/*! cache: pages requested from the cache */
+#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1066
/*! cache: pages selected for eviction unable to be evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1061
+#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1067
/*! cache: pages walked for eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_WALK 1062
+#define WT_STAT_CONN_CACHE_EVICTION_WALK 1068
/*! cache: pages written from cache */
-#define WT_STAT_CONN_CACHE_WRITE 1063
+#define WT_STAT_CONN_CACHE_WRITE 1069
/*! cache: pages written requiring in-memory restoration */
-#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1064
+#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1070
/*! cache: percentage overhead */
-#define WT_STAT_CONN_CACHE_OVERHEAD 1065
+#define WT_STAT_CONN_CACHE_OVERHEAD 1071
/*! cache: tracked bytes belonging to internal pages in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1066
+#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1072
/*! cache: tracked bytes belonging to leaf pages in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_LEAF 1067
+#define WT_STAT_CONN_CACHE_BYTES_LEAF 1073
/*! cache: tracked bytes belonging to overflow pages in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_OVERFLOW 1068
+#define WT_STAT_CONN_CACHE_BYTES_OVERFLOW 1074
/*! cache: tracked dirty bytes in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1069
+#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1075
/*! cache: tracked dirty pages in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1070
+#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1076
/*! cache: unmodified pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1071
+#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1077
/*! connection: auto adjusting condition resets */
-#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1072
+#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1078
/*! connection: auto adjusting condition wait calls */
-#define WT_STAT_CONN_COND_AUTO_WAIT 1073
+#define WT_STAT_CONN_COND_AUTO_WAIT 1079
/*! connection: files currently open */
-#define WT_STAT_CONN_FILE_OPEN 1074
+#define WT_STAT_CONN_FILE_OPEN 1080
/*! connection: memory allocations */
-#define WT_STAT_CONN_MEMORY_ALLOCATION 1075
+#define WT_STAT_CONN_MEMORY_ALLOCATION 1081
/*! connection: memory frees */
-#define WT_STAT_CONN_MEMORY_FREE 1076
+#define WT_STAT_CONN_MEMORY_FREE 1082
/*! connection: memory re-allocations */
-#define WT_STAT_CONN_MEMORY_GROW 1077
+#define WT_STAT_CONN_MEMORY_GROW 1083
/*! connection: pthread mutex condition wait calls */
-#define WT_STAT_CONN_COND_WAIT 1078
+#define WT_STAT_CONN_COND_WAIT 1084
/*! connection: pthread mutex shared lock read-lock calls */
-#define WT_STAT_CONN_RWLOCK_READ 1079
+#define WT_STAT_CONN_RWLOCK_READ 1085
/*! connection: pthread mutex shared lock write-lock calls */
-#define WT_STAT_CONN_RWLOCK_WRITE 1080
+#define WT_STAT_CONN_RWLOCK_WRITE 1086
/*! connection: total read I/Os */
-#define WT_STAT_CONN_READ_IO 1081
+#define WT_STAT_CONN_READ_IO 1087
/*! connection: total write I/Os */
-#define WT_STAT_CONN_WRITE_IO 1082
+#define WT_STAT_CONN_WRITE_IO 1088
/*! cursor: cursor create calls */
-#define WT_STAT_CONN_CURSOR_CREATE 1083
+#define WT_STAT_CONN_CURSOR_CREATE 1089
/*! cursor: cursor insert calls */
-#define WT_STAT_CONN_CURSOR_INSERT 1084
+#define WT_STAT_CONN_CURSOR_INSERT 1090
/*! cursor: cursor next calls */
-#define WT_STAT_CONN_CURSOR_NEXT 1085
+#define WT_STAT_CONN_CURSOR_NEXT 1091
/*! cursor: cursor prev calls */
-#define WT_STAT_CONN_CURSOR_PREV 1086
+#define WT_STAT_CONN_CURSOR_PREV 1092
/*! cursor: cursor remove calls */
-#define WT_STAT_CONN_CURSOR_REMOVE 1087
+#define WT_STAT_CONN_CURSOR_REMOVE 1093
/*! cursor: cursor reset calls */
-#define WT_STAT_CONN_CURSOR_RESET 1088
+#define WT_STAT_CONN_CURSOR_RESET 1094
/*! cursor: cursor restarted searches */
-#define WT_STAT_CONN_CURSOR_RESTART 1089
+#define WT_STAT_CONN_CURSOR_RESTART 1095
/*! cursor: cursor search calls */
-#define WT_STAT_CONN_CURSOR_SEARCH 1090
+#define WT_STAT_CONN_CURSOR_SEARCH 1096
/*! cursor: cursor search near calls */
-#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1091
+#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1097
/*! cursor: cursor update calls */
-#define WT_STAT_CONN_CURSOR_UPDATE 1092
+#define WT_STAT_CONN_CURSOR_UPDATE 1098
/*! cursor: truncate calls */
-#define WT_STAT_CONN_CURSOR_TRUNCATE 1093
+#define WT_STAT_CONN_CURSOR_TRUNCATE 1099
/*! data-handle: connection data handles currently active */
-#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1094
+#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1100
/*! data-handle: connection sweep candidate became referenced */
-#define WT_STAT_CONN_DH_SWEEP_REF 1095
+#define WT_STAT_CONN_DH_SWEEP_REF 1101
/*! data-handle: connection sweep dhandles closed */
-#define WT_STAT_CONN_DH_SWEEP_CLOSE 1096
+#define WT_STAT_CONN_DH_SWEEP_CLOSE 1102
/*! data-handle: connection sweep dhandles removed from hash list */
-#define WT_STAT_CONN_DH_SWEEP_REMOVE 1097
+#define WT_STAT_CONN_DH_SWEEP_REMOVE 1103
/*! data-handle: connection sweep time-of-death sets */
-#define WT_STAT_CONN_DH_SWEEP_TOD 1098
+#define WT_STAT_CONN_DH_SWEEP_TOD 1104
/*! data-handle: connection sweeps */
-#define WT_STAT_CONN_DH_SWEEPS 1099
+#define WT_STAT_CONN_DH_SWEEPS 1105
/*! data-handle: session dhandles swept */
-#define WT_STAT_CONN_DH_SESSION_HANDLES 1100
+#define WT_STAT_CONN_DH_SESSION_HANDLES 1106
/*! data-handle: session sweep attempts */
-#define WT_STAT_CONN_DH_SESSION_SWEEPS 1101
+#define WT_STAT_CONN_DH_SESSION_SWEEPS 1107
/*! log: busy returns attempting to switch slots */
-#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1102
+#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1108
/*! log: consolidated slot closures */
-#define WT_STAT_CONN_LOG_SLOT_CLOSES 1103
+#define WT_STAT_CONN_LOG_SLOT_CLOSES 1109
/*! log: consolidated slot join races */
-#define WT_STAT_CONN_LOG_SLOT_RACES 1104
+#define WT_STAT_CONN_LOG_SLOT_RACES 1110
/*! log: consolidated slot join transitions */
-#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1105
+#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1111
/*! log: consolidated slot joins */
-#define WT_STAT_CONN_LOG_SLOT_JOINS 1106
+#define WT_STAT_CONN_LOG_SLOT_JOINS 1112
/*! log: consolidated slot unbuffered writes */
-#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1107
+#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1113
/*! log: log bytes of payload data */
-#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1108
+#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1114
/*! log: log bytes written */
-#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1109
+#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1115
/*! log: log files manually zero-filled */
-#define WT_STAT_CONN_LOG_ZERO_FILLS 1110
+#define WT_STAT_CONN_LOG_ZERO_FILLS 1116
/*! log: log flush operations */
-#define WT_STAT_CONN_LOG_FLUSH 1111
+#define WT_STAT_CONN_LOG_FLUSH 1117
/*! log: log force write operations */
-#define WT_STAT_CONN_LOG_FORCE_WRITE 1112
+#define WT_STAT_CONN_LOG_FORCE_WRITE 1118
/*! log: log force write operations skipped */
-#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1113
+#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1119
/*! log: log records compressed */
-#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1114
+#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1120
/*! log: log records not compressed */
-#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1115
+#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1121
/*! log: log records too small to compress */
-#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1116
+#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1122
/*! log: log release advances write LSN */
-#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1117
+#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1123
/*! log: log scan operations */
-#define WT_STAT_CONN_LOG_SCANS 1118
+#define WT_STAT_CONN_LOG_SCANS 1124
/*! log: log scan records requiring two reads */
-#define WT_STAT_CONN_LOG_SCAN_REREADS 1119
+#define WT_STAT_CONN_LOG_SCAN_REREADS 1125
/*! log: log server thread advances write LSN */
-#define WT_STAT_CONN_LOG_WRITE_LSN 1120
+#define WT_STAT_CONN_LOG_WRITE_LSN 1126
/*! log: log server thread write LSN walk skipped */
-#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1121
+#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1127
/*! log: log sync operations */
-#define WT_STAT_CONN_LOG_SYNC 1122
+#define WT_STAT_CONN_LOG_SYNC 1128
/*! log: log sync_dir operations */
-#define WT_STAT_CONN_LOG_SYNC_DIR 1123
+#define WT_STAT_CONN_LOG_SYNC_DIR 1129
/*! log: log write operations */
-#define WT_STAT_CONN_LOG_WRITES 1124
+#define WT_STAT_CONN_LOG_WRITES 1130
/*! log: logging bytes consolidated */
-#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1125
+#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1131
/*! log: maximum log file size */
-#define WT_STAT_CONN_LOG_MAX_FILESIZE 1126
+#define WT_STAT_CONN_LOG_MAX_FILESIZE 1132
/*! log: number of pre-allocated log files to create */
-#define WT_STAT_CONN_LOG_PREALLOC_MAX 1127
+#define WT_STAT_CONN_LOG_PREALLOC_MAX 1133
/*! log: pre-allocated log files not ready and missed */
-#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1128
+#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1134
/*! log: pre-allocated log files prepared */
-#define WT_STAT_CONN_LOG_PREALLOC_FILES 1129
+#define WT_STAT_CONN_LOG_PREALLOC_FILES 1135
/*! log: pre-allocated log files used */
-#define WT_STAT_CONN_LOG_PREALLOC_USED 1130
+#define WT_STAT_CONN_LOG_PREALLOC_USED 1136
/*! log: records processed by log scan */
-#define WT_STAT_CONN_LOG_SCAN_RECORDS 1131
+#define WT_STAT_CONN_LOG_SCAN_RECORDS 1137
/*! log: total in-memory size of compressed records */
-#define WT_STAT_CONN_LOG_COMPRESS_MEM 1132
+#define WT_STAT_CONN_LOG_COMPRESS_MEM 1138
/*! log: total log buffer size */
-#define WT_STAT_CONN_LOG_BUFFER_SIZE 1133
+#define WT_STAT_CONN_LOG_BUFFER_SIZE 1139
/*! log: total size of compressed records */
-#define WT_STAT_CONN_LOG_COMPRESS_LEN 1134
+#define WT_STAT_CONN_LOG_COMPRESS_LEN 1140
/*! log: written slots coalesced */
-#define WT_STAT_CONN_LOG_SLOT_COALESCED 1135
+#define WT_STAT_CONN_LOG_SLOT_COALESCED 1141
/*! log: yields waiting for previous log file close */
-#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1136
+#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1142
/*! reconciliation: fast-path pages deleted */
-#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1137
+#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1143
/*! reconciliation: page reconciliation calls */
-#define WT_STAT_CONN_REC_PAGES 1138
+#define WT_STAT_CONN_REC_PAGES 1144
/*! reconciliation: page reconciliation calls for eviction */
-#define WT_STAT_CONN_REC_PAGES_EVICTION 1139
+#define WT_STAT_CONN_REC_PAGES_EVICTION 1145
/*! reconciliation: pages deleted */
-#define WT_STAT_CONN_REC_PAGE_DELETE 1140
+#define WT_STAT_CONN_REC_PAGE_DELETE 1146
/*! reconciliation: split bytes currently awaiting free */
-#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1141
+#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1147
/*! reconciliation: split objects currently awaiting free */
-#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1142
+#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1148
/*! session: open cursor count */
-#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1143
+#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1149
/*! session: open session count */
-#define WT_STAT_CONN_SESSION_OPEN 1144
+#define WT_STAT_CONN_SESSION_OPEN 1150
/*! thread-yield: page acquire busy blocked */
-#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1145
+#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1151
/*! thread-yield: page acquire eviction blocked */
-#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1146
+#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1152
/*! thread-yield: page acquire locked blocked */
-#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1147
+#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1153
/*! thread-yield: page acquire read blocked */
-#define WT_STAT_CONN_PAGE_READ_BLOCKED 1148
+#define WT_STAT_CONN_PAGE_READ_BLOCKED 1154
/*! thread-yield: page acquire time sleeping (usecs) */
-#define WT_STAT_CONN_PAGE_SLEEP 1149
+#define WT_STAT_CONN_PAGE_SLEEP 1155
/*! transaction: number of named snapshots created */
-#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1150
+#define WT_STAT_CONN_TXN_SNAPSHOTS_CREATED 1156
/*! transaction: number of named snapshots dropped */
-#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1151
+#define WT_STAT_CONN_TXN_SNAPSHOTS_DROPPED 1157
/*! transaction: transaction begins */
-#define WT_STAT_CONN_TXN_BEGIN 1152
+#define WT_STAT_CONN_TXN_BEGIN 1158
/*! transaction: transaction checkpoint currently running */
-#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1153
+#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1159
/*! transaction: transaction checkpoint generation */
-#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1154
+#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1160
/*! transaction: transaction checkpoint max time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1155
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1161
/*! transaction: transaction checkpoint min time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1156
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1162
/*! transaction: transaction checkpoint most recent time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1157
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1163
/*! transaction: transaction checkpoint total time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1158
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1164
/*! transaction: transaction checkpoints */
-#define WT_STAT_CONN_TXN_CHECKPOINT 1159
+#define WT_STAT_CONN_TXN_CHECKPOINT 1165
/*! transaction: transaction failures due to cache overflow */
-#define WT_STAT_CONN_TXN_FAIL_CACHE 1160
+#define WT_STAT_CONN_TXN_FAIL_CACHE 1166
/*! transaction: transaction range of IDs currently pinned */
-#define WT_STAT_CONN_TXN_PINNED_RANGE 1161
+#define WT_STAT_CONN_TXN_PINNED_RANGE 1167
/*! transaction: transaction range of IDs currently pinned by a checkpoint */
-#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1162
+#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1168
/*! transaction: transaction range of IDs currently pinned by named
* snapshots */
-#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1163
+#define WT_STAT_CONN_TXN_PINNED_SNAPSHOT_RANGE 1169
/*! transaction: transaction sync calls */
-#define WT_STAT_CONN_TXN_SYNC 1164
+#define WT_STAT_CONN_TXN_SYNC 1170
/*! transaction: transactions committed */
-#define WT_STAT_CONN_TXN_COMMIT 1165
+#define WT_STAT_CONN_TXN_COMMIT 1171
/*! transaction: transactions rolled back */
-#define WT_STAT_CONN_TXN_ROLLBACK 1166
+#define WT_STAT_CONN_TXN_ROLLBACK 1172
/*!
* @}
@@ -4163,91 +4676,93 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection);
#define WT_STAT_DSRC_CACHE_READ 2055
/*! cache: pages read into cache requiring lookaside entries */
#define WT_STAT_DSRC_CACHE_READ_LOOKASIDE 2056
+/*! cache: pages requested from the cache */
+#define WT_STAT_DSRC_CACHE_PAGES_REQUESTED 2057
/*! cache: pages written from cache */
-#define WT_STAT_DSRC_CACHE_WRITE 2057
+#define WT_STAT_DSRC_CACHE_WRITE 2058
/*! cache: pages written requiring in-memory restoration */
-#define WT_STAT_DSRC_CACHE_WRITE_RESTORE 2058
+#define WT_STAT_DSRC_CACHE_WRITE_RESTORE 2059
/*! cache: unmodified pages evicted */
-#define WT_STAT_DSRC_CACHE_EVICTION_CLEAN 2059
+#define WT_STAT_DSRC_CACHE_EVICTION_CLEAN 2060
/*! compression: compressed pages read */
-#define WT_STAT_DSRC_COMPRESS_READ 2060
+#define WT_STAT_DSRC_COMPRESS_READ 2061
/*! compression: compressed pages written */
-#define WT_STAT_DSRC_COMPRESS_WRITE 2061
+#define WT_STAT_DSRC_COMPRESS_WRITE 2062
/*! compression: page written failed to compress */
-#define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 2062
+#define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 2063
/*! compression: page written was too small to compress */
-#define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 2063
+#define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 2064
/*! compression: raw compression call failed, additional data available */
-#define WT_STAT_DSRC_COMPRESS_RAW_FAIL_TEMPORARY 2064
+#define WT_STAT_DSRC_COMPRESS_RAW_FAIL_TEMPORARY 2065
/*! compression: raw compression call failed, no additional data available */
-#define WT_STAT_DSRC_COMPRESS_RAW_FAIL 2065
+#define WT_STAT_DSRC_COMPRESS_RAW_FAIL 2066
/*! compression: raw compression call succeeded */
-#define WT_STAT_DSRC_COMPRESS_RAW_OK 2066
+#define WT_STAT_DSRC_COMPRESS_RAW_OK 2067
/*! cursor: bulk-loaded cursor-insert calls */
-#define WT_STAT_DSRC_CURSOR_INSERT_BULK 2067
+#define WT_STAT_DSRC_CURSOR_INSERT_BULK 2068
/*! cursor: create calls */
-#define WT_STAT_DSRC_CURSOR_CREATE 2068
+#define WT_STAT_DSRC_CURSOR_CREATE 2069
/*! cursor: cursor-insert key and value bytes inserted */
-#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 2069
+#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 2070
/*! cursor: cursor-remove key bytes removed */
-#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 2070
+#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 2071
/*! cursor: cursor-update value bytes updated */
-#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 2071
+#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 2072
/*! cursor: insert calls */
-#define WT_STAT_DSRC_CURSOR_INSERT 2072
+#define WT_STAT_DSRC_CURSOR_INSERT 2073
/*! cursor: next calls */
-#define WT_STAT_DSRC_CURSOR_NEXT 2073
+#define WT_STAT_DSRC_CURSOR_NEXT 2074
/*! cursor: prev calls */
-#define WT_STAT_DSRC_CURSOR_PREV 2074
+#define WT_STAT_DSRC_CURSOR_PREV 2075
/*! cursor: remove calls */
-#define WT_STAT_DSRC_CURSOR_REMOVE 2075
+#define WT_STAT_DSRC_CURSOR_REMOVE 2076
/*! cursor: reset calls */
-#define WT_STAT_DSRC_CURSOR_RESET 2076
+#define WT_STAT_DSRC_CURSOR_RESET 2077
/*! cursor: restarted searches */
-#define WT_STAT_DSRC_CURSOR_RESTART 2077
+#define WT_STAT_DSRC_CURSOR_RESTART 2078
/*! cursor: search calls */
-#define WT_STAT_DSRC_CURSOR_SEARCH 2078
+#define WT_STAT_DSRC_CURSOR_SEARCH 2079
/*! cursor: search near calls */
-#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 2079
+#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 2080
/*! cursor: truncate calls */
-#define WT_STAT_DSRC_CURSOR_TRUNCATE 2080
+#define WT_STAT_DSRC_CURSOR_TRUNCATE 2081
/*! cursor: update calls */
-#define WT_STAT_DSRC_CURSOR_UPDATE 2081
+#define WT_STAT_DSRC_CURSOR_UPDATE 2082
/*! reconciliation: dictionary matches */
-#define WT_STAT_DSRC_REC_DICTIONARY 2082
+#define WT_STAT_DSRC_REC_DICTIONARY 2083
/*! reconciliation: fast-path pages deleted */
-#define WT_STAT_DSRC_REC_PAGE_DELETE_FAST 2083
+#define WT_STAT_DSRC_REC_PAGE_DELETE_FAST 2084
/*! reconciliation: internal page key bytes discarded using suffix
* compression */
-#define WT_STAT_DSRC_REC_SUFFIX_COMPRESSION 2084
+#define WT_STAT_DSRC_REC_SUFFIX_COMPRESSION 2085
/*! reconciliation: internal page multi-block writes */
-#define WT_STAT_DSRC_REC_MULTIBLOCK_INTERNAL 2085
+#define WT_STAT_DSRC_REC_MULTIBLOCK_INTERNAL 2086
/*! reconciliation: internal-page overflow keys */
-#define WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL 2086
+#define WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL 2087
/*! reconciliation: leaf page key bytes discarded using prefix compression */
-#define WT_STAT_DSRC_REC_PREFIX_COMPRESSION 2087
+#define WT_STAT_DSRC_REC_PREFIX_COMPRESSION 2088
/*! reconciliation: leaf page multi-block writes */
-#define WT_STAT_DSRC_REC_MULTIBLOCK_LEAF 2088
+#define WT_STAT_DSRC_REC_MULTIBLOCK_LEAF 2089
/*! reconciliation: leaf-page overflow keys */
-#define WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF 2089
+#define WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF 2090
/*! reconciliation: maximum blocks required for a page */
-#define WT_STAT_DSRC_REC_MULTIBLOCK_MAX 2090
+#define WT_STAT_DSRC_REC_MULTIBLOCK_MAX 2091
/*! reconciliation: overflow values written */
-#define WT_STAT_DSRC_REC_OVERFLOW_VALUE 2091
+#define WT_STAT_DSRC_REC_OVERFLOW_VALUE 2092
/*! reconciliation: page checksum matches */
-#define WT_STAT_DSRC_REC_PAGE_MATCH 2092
+#define WT_STAT_DSRC_REC_PAGE_MATCH 2093
/*! reconciliation: page reconciliation calls */
-#define WT_STAT_DSRC_REC_PAGES 2093
+#define WT_STAT_DSRC_REC_PAGES 2094
/*! reconciliation: page reconciliation calls for eviction */
-#define WT_STAT_DSRC_REC_PAGES_EVICTION 2094
+#define WT_STAT_DSRC_REC_PAGES_EVICTION 2095
/*! reconciliation: pages deleted */
-#define WT_STAT_DSRC_REC_PAGE_DELETE 2095
+#define WT_STAT_DSRC_REC_PAGE_DELETE 2096
/*! session: object compaction */
-#define WT_STAT_DSRC_SESSION_COMPACT 2096
+#define WT_STAT_DSRC_SESSION_COMPACT 2097
/*! session: open cursor count */
-#define WT_STAT_DSRC_SESSION_CURSOR_OPEN 2097
+#define WT_STAT_DSRC_SESSION_CURSOR_OPEN 2098
/*! transaction: update conflicts */
-#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 2098
+#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 2099
/*!
* @}
diff --git a/src/include/wt_internal.h b/src/include/wt_internal.h
index 9e5007b38ed..0c8abf36cfe 100644
--- a/src/include/wt_internal.h
+++ b/src/include/wt_internal.h
@@ -169,6 +169,8 @@ struct __wt_dsrc_stats;
typedef struct __wt_dsrc_stats WT_DSRC_STATS;
struct __wt_evict_entry;
typedef struct __wt_evict_entry WT_EVICT_ENTRY;
+struct __wt_evict_queue;
+ typedef struct __wt_evict_queue WT_EVICT_QUEUE;
struct __wt_evict_worker;
typedef struct __wt_evict_worker WT_EVICT_WORKER;
struct __wt_ext;
@@ -179,6 +181,14 @@ struct __wt_fair_lock;
typedef struct __wt_fair_lock WT_FAIR_LOCK;
struct __wt_fh;
typedef struct __wt_fh WT_FH;
+struct __wt_file_handle_inmem;
+ typedef struct __wt_file_handle_inmem WT_FILE_HANDLE_INMEM;
+struct __wt_file_handle_posix;
+ typedef struct __wt_file_handle_posix WT_FILE_HANDLE_POSIX;
+struct __wt_file_handle_win;
+ typedef struct __wt_file_handle_win WT_FILE_HANDLE_WIN;
+struct __wt_fstream;
+ typedef struct __wt_fstream WT_FSTREAM;
struct __wt_hazard;
typedef struct __wt_hazard WT_HAZARD;
struct __wt_ikey;
@@ -351,21 +361,23 @@ union __wt_rand_state;
#include "intpack.i" /* required by cell.i, packing.i */
-#include "buf.i"
+#include "buf.i" /* required by cell.i */
#include "cache.i" /* required by txn.i */
#include "cell.i" /* required by btree.i */
-#include "log.i"
-#include "misc.i"
#include "mutex.i" /* required by btree.i */
-#include "packing.i"
#include "txn.i" /* required by btree.i */
+#include "bitstring.i"
#include "btree.i" /* required by cursor.i */
#include "btree_cmp.i"
-#include "cursor.i"
-
-#include "bitstring.i"
#include "column.i"
+#include "cursor.i"
+#include "log.i"
+#include "misc.i"
+#include "os_fhandle.i"
+#include "os_fs.i"
+#include "os_fstream.i"
+#include "packing.i"
#include "serial.i"
#if defined(__cplusplus)