diff options
author | Luke Chen <luke.chen@mongodb.com> | 2022-12-19 09:01:37 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-12-18 22:47:19 +0000 |
commit | 782c15086f3277c853b987be49e095c9ca15d17b (patch) | |
tree | 727755bbcd368fe4d7475893f808580da75a43fc | |
parent | 38c5aab661a2c2e55c8ddcb6674df1ec0d2c4c62 (diff) | |
download | mongo-782c15086f3277c853b987be49e095c9ca15d17b.tar.gz |
Import wiredtiger: c83ae3e1e8d44f45831aa89ab1b9bd58e1407f86 from branch mongodb-master
ref: f2e8e83ae1..c83ae3e1e8
for: 6.3.0-rc0
WT-10112 Tiered structure fixes to properly initialize tiers.
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/schema/schema_drop.c | 11 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/tiered/tiered_handle.c | 31 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_ckpt.c | 2 | ||||
-rwxr-xr-x | src/third_party/wiredtiger/test/suite/test_tiered14.py | 2 |
5 files changed, 24 insertions, 24 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index f2ca26a6f64..47b835feebb 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": "f2e8e83ae1dfa80f9ada06eb76ba175a5710d73b" + "commit": "c83ae3e1e8d44f45831aa89ab1b9bd58e1407f86" } diff --git a/src/third_party/wiredtiger/src/schema/schema_drop.c b/src/third_party/wiredtiger/src/schema/schema_drop.c index c3f1348fd3e..0908047680b 100644 --- a/src/third_party/wiredtiger/src/schema/schema_drop.c +++ b/src/third_party/wiredtiger/src/schema/schema_drop.c @@ -237,15 +237,8 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char WT_ERR(__wt_metadata_remove(session, tier->name)); tiered->tiers[WT_TIERED_INDEX_SHARED].tier = NULL; } else - /* - * If we don't have a shared tier we better be on the first object. - * - * FIXME-WT-10112: This assertion fails on every run of test_base04 and should be re-added - * once the root cause is fixed. - * - * WT_ASSERT(session, localid == 1); - */ - WT_UNUSED(localid); + /* If we don't have a shared tier we better be on the first object. */ + WT_ASSERT(session, localid == 1); /* * We remove all metadata entries for both the file and object versions of an object. The local diff --git a/src/third_party/wiredtiger/src/tiered/tiered_handle.c b/src/third_party/wiredtiger/src/tiered/tiered_handle.c index 3fb90dfc178..004b2532893 100644 --- a/src/third_party/wiredtiger/src/tiered/tiered_handle.c +++ b/src/third_party/wiredtiger/src/tiered/tiered_handle.c @@ -97,11 +97,7 @@ __tiered_dhandle_setup(WT_SESSION_IMPL *session, WT_TIERED *tiered, uint32_t i, else if (type == WT_DHANDLE_TYPE_TIERED) id = WT_TIERED_INDEX_LOCAL; else if (type == WT_DHANDLE_TYPE_TIERED_TREE) - /* - * FIXME-WT-7731: this type can be removed. For now, there is nothing to do for this - * type. - */ - goto err; + id = WT_TIERED_INDEX_SHARED; else WT_ERR_MSG( session, EINVAL, "Unknown or unsupported tiered dhandle type %" PRIu32, type); @@ -133,7 +129,7 @@ __tiered_init_tiers(WT_SESSION_IMPL *session, WT_TIERED *tiered, WT_CONFIG_ITEM WT_CONFIG_ITEM ckey, cval; WT_DECL_ITEM(tmp); WT_DECL_RET; - WT_TIERED_TIERS *local_tier; + WT_TIERED_TIERS *tier; uint32_t object_id; const char *cfg, *name; @@ -171,11 +167,19 @@ __tiered_init_tiers(WT_SESSION_IMPL *session, WT_TIERED *tiered, WT_CONFIG_ITEM session, tiered, WT_TIERED_INDEX_INVALID, (const char *)tmp->data)); WT_ERR(ret); } - local_tier = &tiered->tiers[WT_TIERED_INDEX_LOCAL]; - if (local_tier->name == NULL) { + /* Set up the name for any tier that needs it. */ + tier = &tiered->tiers[WT_TIERED_INDEX_LOCAL]; + if (tier->name == NULL) { WT_ERR(__wt_tiered_name( - session, &tiered->iface, tiered->current_id, WT_TIERED_NAME_LOCAL, &local_tier->name)); - F_SET(local_tier, WT_TIERS_OP_READ | WT_TIERS_OP_WRITE); + session, &tiered->iface, tiered->current_id, WT_TIERED_NAME_LOCAL, &tier->name)); + F_SET(tier, WT_TIERS_OP_READ | WT_TIERS_OP_WRITE); + } + /* Set up the tiered name if we're not on the first object. */ + tier = &tiered->tiers[WT_TIERED_INDEX_SHARED]; + if (tier != NULL && tier->name == NULL && tiered->current_id != 1) { + WT_ERR(__wt_tiered_name( + session, &tiered->iface, tiered->current_id, WT_TIERED_NAME_SHARED, &tier->name)); + F_SET(tier, WT_TIERS_OP_FLUSH | WT_TIERS_OP_READ); } WT_ERR_NOTFOUND_OK(ret, false); err: @@ -391,8 +395,10 @@ __tiered_create_tier_tree(WT_SESSION_IMPL *session, WT_TIERED *tiered) WT_ERR(__wt_schema_create(session, name, config)); this_tier = &tiered->tiers[WT_TIERED_INDEX_SHARED]; - WT_ASSERT(session, this_tier->name == NULL); - this_tier->name = name; + if (this_tier->name == NULL) + this_tier->name = name; + else + WT_ASSERT(session, strcmp(this_tier->name, name) == 0); F_SET(this_tier, WT_TIERS_OP_FLUSH | WT_TIERS_OP_READ); if (0) @@ -733,6 +739,7 @@ __tiered_open(WT_SESSION_IMPL *session, const char *cfg[]) tiered->obj_config = metaconf; metaconf = NULL; __wt_verbose(session, WT_VERB_TIERED, "TIERED_OPEN: obj_config %s", tiered->obj_config); + __wt_verbose(session, WT_VERB_TIERED, "TIERED_OPEN: tiered config %s", config); WT_ERR(__wt_config_getones(session, config, "key_format", &cval)); WT_ERR(__wt_strndup(session, cval.str, cval.len, &tiered->key_format)); diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c index 352334d234c..fff1c86403a 100644 --- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c +++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c @@ -106,7 +106,7 @@ __checkpoint_flush_tier(WT_SESSION_IMPL *session, bool force) cursor->get_value(cursor, &value); /* For now just switch tiers which just does metadata manipulation. */ if (WT_PREFIX_MATCH(key, "tiered:")) { - __wt_verbose_debug2( + __wt_verbose( session, WT_VERB_TIERED, "CKPT_FLUSH_TIER: %s %s force %d", key, value, force); if (!force) { /* diff --git a/src/third_party/wiredtiger/test/suite/test_tiered14.py b/src/third_party/wiredtiger/test/suite/test_tiered14.py index d7e01a6e925..b4643742088 100755 --- a/src/third_party/wiredtiger/test/suite/test_tiered14.py +++ b/src/third_party/wiredtiger/test/suite/test_tiered14.py @@ -128,7 +128,7 @@ class test_tiered14(wttest.WiredTigerTestCase, TieredConfigMixin): self.progress('check') ds.check() except Exception as e: - self.progress('Failed at position {} in {}: {}'.format(idx, ops, str(e))) + self.progress('Failed at position {} in {}: {}'.format(self.position, ops, str(e))) raise(e) # Test tiered storage with checkpoints and flush_tier calls. |