From bd2abb1b3c22d071e7138b7e3edeeb5943690e5c Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Tue, 22 Feb 2022 13:40:37 +1100 Subject: Import wiredtiger: b1a6788043f564c5fe1956ceb94307cdd47ff9ca from branch mongodb-5.3 ref: 11425af9b5..b1a6788043 for: 5.3.0-rc1 WT-7596 Clean up internal interface for tiered switch to new object --- src/third_party/wiredtiger/import.data | 2 +- src/third_party/wiredtiger/src/block_cache/block_mgr.c | 14 ++------------ src/third_party/wiredtiger/src/btree/bt_handle.c | 4 ++-- src/third_party/wiredtiger/src/include/block.h | 2 +- src/third_party/wiredtiger/src/include/extern.h | 2 +- src/third_party/wiredtiger/src/tiered/tiered_handle.c | 4 ++-- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index f07a6bde910..417516cfabb 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-5.3", - "commit": "11425af9b5e47adb7a79ae94b392f50874220965" + "commit": "b1a6788043f564c5fe1956ceb94307cdd47ff9ca" } 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 ef480c18942..3e7df914f4d 100644 --- a/src/third_party/wiredtiger/src/block_cache/block_mgr.c +++ b/src/third_party/wiredtiger/src/block_cache/block_mgr.c @@ -560,7 +560,7 @@ __bm_stat(WT_BM *bm, WT_SESSION_IMPL *session, WT_DSRC_STATS *stats) * Switch the tiered object. */ static int -__bm_switch_object(WT_BM *bm, WT_SESSION_IMPL *session, uint32_t objectid, uint32_t flags) +__bm_switch_object(WT_BM *bm, WT_SESSION_IMPL *session, uint32_t objectid) { WT_BLOCK *block; @@ -570,15 +570,6 @@ __bm_switch_object(WT_BM *bm, WT_SESSION_IMPL *session, uint32_t objectid, uint3 WT_RET(__bm_close_block(session, block)); bm->block = NULL; - /* - * FIXME-WT-7596 the flags argument will be used in the future to perform various tasks, - * to efficiently mark objects in transition (that is during a switch): - * - mark this file as the writeable file (what currently happens) - * - disallow writes to this object (reads still allowed, we're about to switch) - * - close this object (about to move it, don't allow reopens yet) - * - allow opens on this object again - */ - WT_UNUSED(flags); WT_RET(__wt_blkcache_get_handle(session, NULL, objectid, &block)); /* @@ -603,10 +594,9 @@ __bm_switch_object(WT_BM *bm, WT_SESSION_IMPL *session, uint32_t objectid, uint3 * Switch the tiered object; readonly version. */ static int -__bm_switch_object_readonly(WT_BM *bm, WT_SESSION_IMPL *session, uint32_t objectid, uint32_t flags) +__bm_switch_object_readonly(WT_BM *bm, WT_SESSION_IMPL *session, uint32_t objectid) { WT_UNUSED(objectid); - WT_UNUSED(flags); return (__bm_readonly(bm, session)); } diff --git a/src/third_party/wiredtiger/src/btree/bt_handle.c b/src/third_party/wiredtiger/src/btree/bt_handle.c index 4b780de1646..7d5ef3da33e 100644 --- a/src/third_party/wiredtiger/src/btree/bt_handle.c +++ b/src/third_party/wiredtiger/src/btree/bt_handle.c @@ -998,7 +998,7 @@ __btree_page_sizes(WT_SESSION_IMPL *session) * Switch to a writeable object for a tiered btree. */ int -__wt_btree_switch_object(WT_SESSION_IMPL *session, uint32_t objectid, uint32_t flags) +__wt_btree_switch_object(WT_SESSION_IMPL *session, uint32_t objectid) { WT_BM *bm; @@ -1008,5 +1008,5 @@ __wt_btree_switch_object(WT_SESSION_IMPL *session, uint32_t objectid, uint32_t f * number. */ bm = S2BT(session)->bm; - return (bm == NULL ? 0 : bm->switch_object(bm, session, objectid, flags)); + return (bm == NULL ? 0 : bm->switch_object(bm, session, objectid)); } diff --git a/src/third_party/wiredtiger/src/include/block.h b/src/third_party/wiredtiger/src/include/block.h index e1d25ba1d52..f0aed0a3aac 100644 --- a/src/third_party/wiredtiger/src/include/block.h +++ b/src/third_party/wiredtiger/src/include/block.h @@ -199,7 +199,7 @@ struct __wt_bm { int (*salvage_valid)(WT_BM *, WT_SESSION_IMPL *, uint8_t *, size_t, bool); int (*size)(WT_BM *, WT_SESSION_IMPL *, wt_off_t *); int (*stat)(WT_BM *, WT_SESSION_IMPL *, WT_DSRC_STATS *stats); - int (*switch_object)(WT_BM *, WT_SESSION_IMPL *, uint32_t, uint32_t); + int (*switch_object)(WT_BM *, WT_SESSION_IMPL *, uint32_t); int (*sync)(WT_BM *, WT_SESSION_IMPL *, bool); int (*verify_addr)(WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t); int (*verify_end)(WT_BM *, WT_SESSION_IMPL *); diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h index 0a81847cd68..80ecdfc4908 100644 --- a/src/third_party/wiredtiger/src/include/extern.h +++ b/src/third_party/wiredtiger/src/include/extern.h @@ -302,7 +302,7 @@ extern int __wt_btree_open(WT_SESSION_IMPL *session, const char *op_cfg[]) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_btree_stat_init(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern int __wt_btree_switch_object(WT_SESSION_IMPL *session, uint32_t objectid, uint32_t flags) +extern int __wt_btree_switch_object(WT_SESSION_IMPL *session, uint32_t objectid) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern int __wt_btree_tree_open(WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); diff --git a/src/third_party/wiredtiger/src/tiered/tiered_handle.c b/src/third_party/wiredtiger/src/tiered/tiered_handle.c index 927ab86eb02..8ede34b64b3 100644 --- a/src/third_party/wiredtiger/src/tiered/tiered_handle.c +++ b/src/third_party/wiredtiger/src/tiered/tiered_handle.c @@ -215,7 +215,7 @@ __tiered_create_local(WT_SESSION_IMPL *session, WT_TIERED *tiered) F_SET(this_tier, WT_TIERS_OP_READ | WT_TIERS_OP_WRITE); WT_WITH_DHANDLE( - session, &tiered->iface, ret = __wt_btree_switch_object(session, tiered->current_id, 0)); + session, &tiered->iface, ret = __wt_btree_switch_object(session, tiered->current_id)); WT_ERR(ret); err: @@ -647,7 +647,7 @@ __tiered_open(WT_SESSION_IMPL *session, const char *cfg[]) WT_ERR(__wt_tiered_switch(session, config)); } WT_ERR(__wt_btree_open(session, tiered_cfg)); - WT_ERR(__wt_btree_switch_object(session, tiered->current_id, 0)); + WT_ERR(__wt_btree_switch_object(session, tiered->current_id)); #if 1 if (0) { -- cgit v1.2.1