diff options
author | Luke Chen <luke.chen@mongodb.com> | 2022-12-21 15:39:16 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-12-21 05:14:15 +0000 |
commit | 8b3116816b533f1bdb8602c89b9551426db6aa5f (patch) | |
tree | 62cbb87ae4625f85c4ed050438e72cc69ebc16f8 | |
parent | bfeab9f4ebc4a6154c432b6b8cc41c6f118370ca (diff) | |
download | mongo-8b3116816b533f1bdb8602c89b9551426db6aa5f.tar.gz |
Import wiredtiger: 824e26b67715b4e0f4be20bd46c969b9c8748bf9 from branch mongodb-master
ref: eccc369904..824e26b677
for: 6.3.0-rc0
WT-9538 Release dhandle on error.
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/schema/schema_drop.c | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index d5ee4337569..872326944a9 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": "eccc369904708f4f076ce279fe65b62dbfad1ad5" + "commit": "824e26b67715b4e0f4be20bd46c969b9c8748bf9" } diff --git a/src/third_party/wiredtiger/src/schema/schema_drop.c b/src/third_party/wiredtiger/src/schema/schema_drop.c index 0908047680b..354e779b908 100644 --- a/src/third_party/wiredtiger/src/schema/schema_drop.c +++ b/src/third_party/wiredtiger/src/schema/schema_drop.c @@ -183,10 +183,10 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char WT_TIERED *tiered; u_int i, localid; const char *filename, *name; - bool exist, locked, remove_files, remove_shared; + bool exist, got_dhandle, locked, remove_files, remove_shared; conn = S2C(session); - locked = false; + got_dhandle = locked = false; WT_RET(__wt_config_gets(session, cfg, "remove_files", &cval)); remove_files = cval.val != 0; WT_RET(__wt_config_gets(session, cfg, "remove_shared", &cval)); @@ -200,6 +200,7 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char name = NULL; /* Get the tiered data handle. */ WT_RET(__wt_session_get_dhandle(session, uri, NULL, NULL, WT_DHANDLE_EXCLUSIVE)); + got_dhandle = true; tiered = (WT_TIERED *)session->dhandle; /* @@ -284,6 +285,7 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char * the tiered structure because that is from the dhandle. */ WT_ERR(__wt_session_release_dhandle(session)); + got_dhandle = false; WT_WITH_HANDLE_LIST_WRITE_LOCK( session, ret = __wt_conn_dhandle_close_all(session, uri, true, force)); WT_ERR(ret); @@ -297,6 +299,8 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char ret = __wt_metadata_remove(session, uri); err: + if (got_dhandle) + WT_TRET(__wt_session_release_dhandle(session)); __wt_free(session, name); if (locked) __wt_spin_unlock(session, &conn->tiered_lock); |