summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwt-vendoring-bot[bot] <169275211+wt-vendoring-bot[bot]@users.noreply.github.com>2024-09-18 00:53:46 +0000
committerMongoDB Bot <mongo-bot@mongodb.com>2024-09-18 01:54:34 +0000
commitc574d635ef523a99ed3a4e9a9c2f07e4972f2c8a (patch)
treee4174266aa1a3726d6d5a08f2189c9d1770eee76 /src
parentffa83850217b177e2bcf61ab3b344f8626c7ff37 (diff)
Import wiredtiger: 800e74f9439fc857a3b4ff6d8a87266949ae6ca0 from branch mongodb-master (#27162)master
GitOrigin-RevId: 4346b7517643d72ceffcb1437557822f5bb4612f
Diffstat (limited to 'src')
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/block/block_ckpt.c12
-rw-r--r--src/third_party/wiredtiger/src/block/block_read.c2
-rw-r--r--src/third_party/wiredtiger/src/block_cache/block_cache.c45
-rw-r--r--src/third_party/wiredtiger/src/block_cache/block_mgr.c68
-rw-r--r--src/third_party/wiredtiger/src/include/extern.h7
6 files changed, 68 insertions, 68 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index b855340a595..69903682142 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-master",
- "commit": "6fd5c0ca8d33850c1a384d1dcc32a240acc2e593"
+ "commit": "800e74f9439fc857a3b4ff6d8a87266949ae6ca0"
}
diff --git a/src/third_party/wiredtiger/src/block/block_ckpt.c b/src/third_party/wiredtiger/src/block/block_ckpt.c
index 2256eb378a1..1433f4f5dfa 100644
--- a/src/third_party/wiredtiger/src/block/block_ckpt.c
+++ b/src/third_party/wiredtiger/src/block/block_ckpt.c
@@ -250,7 +250,7 @@ __wt_block_checkpoint_start(WT_SESSION_IMPL *session, WT_BLOCK *block)
"%s: an unexpected checkpoint start: the checkpoint has already started or was "
"configured for salvage",
block->name);
- __wt_blkcache_set_readonly(session);
+ __wt_bm_set_readonly(session);
break;
case WT_CKPT_NONE:
block->ckpt_state = WT_CKPT_INPROGRESS;
@@ -575,7 +575,7 @@ __ckpt_process(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_CKPT *ckptbase)
"%s: an unexpected checkpoint attempt: the checkpoint was never started or has already "
"completed",
block->name);
- __wt_blkcache_set_readonly(session);
+ __wt_bm_set_readonly(session);
break;
case WT_CKPT_SALVAGE:
/* Salvage doesn't use the standard checkpoint APIs. */
@@ -842,7 +842,7 @@ live_update:
err:
if (ret != 0 && fatal) {
ret = __wt_panic(session, ret, "%s: fatal checkpoint failure", block->name);
- __wt_blkcache_set_readonly(session);
+ __wt_bm_set_readonly(session);
}
__wt_spin_unlock_if_owned(session, &block->live_lock);
@@ -1000,14 +1000,14 @@ __wt_block_checkpoint_resolve(WT_SESSION_IMPL *session, WT_BLOCK *block, bool fa
"%s: an unexpected checkpoint resolution: the checkpoint was never started or completed, "
"or configured for salvage",
block->name);
- __wt_blkcache_set_readonly(session);
+ __wt_bm_set_readonly(session);
break;
case WT_CKPT_PANIC_ON_FAILURE:
if (!failed)
break;
ret = __wt_panic(
session, EINVAL, "%s: the checkpoint failed, the system must restart", block->name);
- __wt_blkcache_set_readonly(session);
+ __wt_bm_set_readonly(session);
break;
}
WT_ERR(ret);
@@ -1015,7 +1015,7 @@ __wt_block_checkpoint_resolve(WT_SESSION_IMPL *session, WT_BLOCK *block, bool fa
if ((ret = __wti_block_extlist_merge(session, block, &ci->ckpt_avail, &ci->avail)) != 0) {
ret = __wt_panic(
session, ret, "%s: fatal checkpoint failure during extent list merge", block->name);
- __wt_blkcache_set_readonly(session);
+ __wt_bm_set_readonly(session);
}
__wt_spin_unlock(session, &block->live_lock);
diff --git a/src/third_party/wiredtiger/src/block/block_read.c b/src/third_party/wiredtiger/src/block/block_read.c
index ad27af76c87..5fe333fade9 100644
--- a/src/third_party/wiredtiger/src/block/block_read.c
+++ b/src/third_party/wiredtiger/src/block/block_read.c
@@ -52,7 +52,7 @@ err:
last_release = false;
__wt_blkcache_release_handle(session, block, &last_release);
if (last_release && __wt_block_eligible_for_sweep(bm, block))
- WT_TRET(__wt_blkcache_sweep_handles(session, bm));
+ WT_TRET(__wt_bm_sweep_handles(session, bm));
}
return (ret);
diff --git a/src/third_party/wiredtiger/src/block_cache/block_cache.c b/src/third_party/wiredtiger/src/block_cache/block_cache.c
index 4d8b2e24b90..33556396897 100644
--- a/src/third_party/wiredtiger/src/block_cache/block_cache.c
+++ b/src/third_party/wiredtiger/src/block_cache/block_cache.c
@@ -719,6 +719,51 @@ __blkcache_reconfig(WT_SESSION_IMPL *session, bool reconfig, size_t cache_size,
}
/*
+ * __wt_blkcache_open --
+ * Open a file.
+ */
+int
+__wt_blkcache_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[],
+ bool forced_salvage, bool readonly, uint32_t allocsize, WT_BM **bmp)
+{
+ WT_BM *bm;
+ WT_DECL_RET;
+
+ *bmp = NULL;
+
+ __wt_verbose(session, WT_VERB_BLKCACHE, "open: %s", uri);
+
+ WT_RET(__wt_calloc_one(session, &bm));
+ __wti_bm_method_set(bm, false);
+ bm->is_multi_handle = false;
+
+ if (WT_PREFIX_MATCH(uri, "file:")) {
+ uri += strlen("file:");
+ WT_ERR(__wt_block_open(session, uri, WT_TIERED_OBJECTID_NONE, cfg, forced_salvage, readonly,
+ false, allocsize, &bm->block));
+ } else {
+ bm->is_multi_handle = true;
+ WT_ERR(__wt_rwlock_init(session, &bm->handle_array_lock));
+
+ /* Allocate space to store the handle (do first for simpler cleanup). */
+ WT_ERR(__wt_realloc_def(
+ session, &bm->handle_array_allocated, bm->handle_array_next + 1, &bm->handle_array));
+
+ /* Open the active file, and save in array */
+ WT_ERR(__wti_blkcache_tiered_open(session, uri, 0, &bm->block));
+ bm->handle_array[bm->handle_array_next++] = bm->block;
+ }
+
+ *bmp = bm;
+ return (0);
+
+err:
+ __wt_rwlock_destroy(session, &bm->handle_array_lock);
+ __wt_free(session, bm);
+ return (ret);
+}
+
+/*
* __wt_blkcache_setup --
* Set up the block cache.
*/
diff --git a/src/third_party/wiredtiger/src/block_cache/block_mgr.c b/src/third_party/wiredtiger/src/block_cache/block_mgr.c
index 8184a5c2b0d..d4c062c2eb5 100644
--- a/src/third_party/wiredtiger/src/block_cache/block_mgr.c
+++ b/src/third_party/wiredtiger/src/block_cache/block_mgr.c
@@ -8,7 +8,6 @@
#include "wt_internal.h"
-static void __bm_method_set(WT_BM *, bool);
static int __bm_sync_tiered_handles(WT_BM *, WT_SESSION_IMPL *);
/*
@@ -148,7 +147,7 @@ __bm_sync_tiered_handles(WT_BM *bm, WT_SESSION_IMPL *session)
} while (found);
if (need_sweep)
- WT_TRET(__wt_blkcache_sweep_handles(session, bm));
+ WT_TRET(__wt_bm_sweep_handles(session, bm));
return (ret);
}
@@ -243,7 +242,7 @@ __bm_checkpoint_load(WT_BM *bm, WT_SESSION_IMPL *session, const uint8_t *addr, s
* it. Although the btree layer prevents attempts to write a checkpoint reference, paranoia
* is healthy.
*/
- __bm_method_set(bm, true);
+ __wti_bm_method_set(bm, true);
}
return (0);
@@ -709,7 +708,7 @@ __bm_switch_object_end(WT_BM *bm, WT_SESSION_IMPL *session, uint32_t objectid)
WT_ASSERT(session, bm->max_flushed_objectid == 0 || objectid == bm->max_flushed_objectid + 1);
bm->max_flushed_objectid = objectid;
- return (__wt_blkcache_sweep_handles(session, bm));
+ return (__wt_bm_sweep_handles(session, bm));
}
/*
@@ -749,11 +748,11 @@ __bm_sync(WT_BM *bm, WT_SESSION_IMPL *session, bool block)
}
/*
- * __wt_blkcache_sweep_handles --
+ * __wt_bm_sweep_handles --
* Free blocks from the manager's handle array if possible.
*/
int
-__wt_blkcache_sweep_handles(WT_SESSION_IMPL *session, WT_BM *bm)
+__wt_bm_sweep_handles(WT_SESSION_IMPL *session, WT_BM *bm)
{
WT_BLOCK *block;
WT_DECL_RET;
@@ -891,11 +890,11 @@ __bm_write_size_readonly(WT_BM *bm, WT_SESSION_IMPL *session, size_t *sizep)
}
/*
- * __bm_method_set --
+ * __wti_bm_method_set --
* Set up the legal methods.
*/
-static void
-__bm_method_set(WT_BM *bm, bool readonly)
+void
+__wti_bm_method_set(WT_BM *bm, bool readonly)
{
bm->addr_invalid = __bm_addr_invalid;
bm->addr_string = __bm_addr_string;
@@ -956,57 +955,12 @@ __bm_method_set(WT_BM *bm, bool readonly)
}
/*
- * __wt_blkcache_open --
- * Open a file.
- */
-int
-__wt_blkcache_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[],
- bool forced_salvage, bool readonly, uint32_t allocsize, WT_BM **bmp)
-{
- WT_BM *bm;
- WT_DECL_RET;
-
- *bmp = NULL;
-
- __wt_verbose(session, WT_VERB_BLKCACHE, "open: %s", uri);
-
- WT_RET(__wt_calloc_one(session, &bm));
- __bm_method_set(bm, false);
- bm->is_multi_handle = false;
-
- if (WT_PREFIX_MATCH(uri, "file:")) {
- uri += strlen("file:");
- WT_ERR(__wt_block_open(session, uri, WT_TIERED_OBJECTID_NONE, cfg, forced_salvage, readonly,
- false, allocsize, &bm->block));
- } else {
- bm->is_multi_handle = true;
- WT_ERR(__wt_rwlock_init(session, &bm->handle_array_lock));
-
- /* Allocate space to store the handle (do first for simpler cleanup). */
- WT_ERR(__wt_realloc_def(
- session, &bm->handle_array_allocated, bm->handle_array_next + 1, &bm->handle_array));
-
- /* Open the active file, and save in array */
- WT_ERR(__wti_blkcache_tiered_open(session, uri, 0, &bm->block));
- bm->handle_array[bm->handle_array_next++] = bm->block;
- }
-
- *bmp = bm;
- return (0);
-
-err:
- __wt_rwlock_destroy(session, &bm->handle_array_lock);
- __wt_free(session, bm);
- return (ret);
-}
-
-/*
- * __wt_blkcache_set_readonly --
+ * __wt_bm_set_readonly --
* Set the block API to read-only.
*/
void
-__wt_blkcache_set_readonly(WT_SESSION_IMPL *session) WT_GCC_FUNC_ATTRIBUTE((cold))
+__wt_bm_set_readonly(WT_SESSION_IMPL *session) WT_GCC_FUNC_ATTRIBUTE((cold))
{
/* Switch the handle into read-only mode. */
- __bm_method_set(S2BT(session)->bm, true);
+ __wti_bm_method_set(S2BT(session)->bm, true);
}
diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h
index fe0741392f7..8502233094d 100644
--- a/src/third_party/wiredtiger/src/include/extern.h
+++ b/src/third_party/wiredtiger/src/include/extern.h
@@ -111,8 +111,6 @@ extern int __wt_blkcache_read(WT_SESSION_IMPL *session, WT_ITEM *buf, const uint
size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_blkcache_setup(WT_SESSION_IMPL *session, const char *cfg[], bool reconfig)
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
-extern int __wt_blkcache_sweep_handles(WT_SESSION_IMPL *session, WT_BM *bm)
- WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_blkcache_write(WT_SESSION_IMPL *session, WT_ITEM *buf, uint8_t *addr,
size_t *addr_sizep, size_t *compressed_sizep, bool checkpoint, bool checkpoint_io,
bool compressed) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
@@ -215,6 +213,8 @@ extern int __wt_bm_corrupt(WT_BM *bm, WT_SESSION_IMPL *session, const uint8_t *a
size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, WT_ITEM *buf, const uint8_t *addr,
size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
+extern int __wt_bm_sweep_handles(WT_SESSION_IMPL *session, WT_BM *bm)
+ WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_btcur_close(WT_CURSOR_BTREE *cbt, bool lowlevel)
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_btcur_compare(WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *cmpp)
@@ -1821,7 +1821,6 @@ extern void __wt_backup_destroy(WT_SESSION_IMPL *session);
extern void __wt_blkcache_destroy(WT_SESSION_IMPL *session);
extern void __wt_blkcache_release_handle(
WT_SESSION_IMPL *session, WT_BLOCK *block, bool *last_release);
-extern void __wt_blkcache_set_readonly(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((cold));
extern void __wt_block_compact_get_progress_stats(
WT_SESSION_IMPL *session, WT_BM *bm, uint64_t *pages_reviewedp);
extern void __wt_block_compact_progress(WT_SESSION_IMPL *session, WT_BLOCK *block);
@@ -1829,6 +1828,7 @@ extern void __wt_block_stat(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_DSRC_S
extern void __wt_bloom_hash(WT_BLOOM *bloom, WT_ITEM *key, WT_BLOOM_HASH *bhash);
extern void __wt_bloom_insert(WT_BLOOM *bloom, WT_ITEM *key)
WT_GCC_FUNC_DECL_ATTRIBUTE((visibility("default")));
+extern void __wt_bm_set_readonly(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((cold));
extern void __wt_btcur_free_cached_memory(WT_CURSOR_BTREE *cbt);
extern void __wt_btcur_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt);
extern void __wt_btcur_open(WT_CURSOR_BTREE *cbt);
@@ -1998,6 +1998,7 @@ extern void __wti_block_configure_first_fit(WT_BLOCK *block, bool on);
extern void __wti_block_ext_free(WT_SESSION_IMPL *session, WT_EXT **ext);
extern void __wti_block_extlist_free(WT_SESSION_IMPL *session, WT_EXTLIST *el);
extern void __wti_block_size_free(WT_SESSION_IMPL *session, WT_SIZE **sz);
+extern void __wti_bm_method_set(WT_BM *bm, bool readonly);
extern void __wti_btcur_iterate_setup(WT_CURSOR_BTREE *cbt);
extern void __wti_cache_stats_update(WT_SESSION_IMPL *session);
extern void __wti_ckpt_verbose(WT_SESSION_IMPL *session, WT_BLOCK *block, const char *tag,