diff options
author | Luke Chen <luke.chen@mongodb.com> | 2022-05-16 00:12:50 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-16 00:39:51 +0000 |
commit | 3e37098fa76e4882b502bdae02f5341b6d373b68 (patch) | |
tree | 53bb2b29547bfbc6a60a6dae2dcb0d010d5fe9c1 /src/third_party/wiredtiger/src/schema/schema_drop.c | |
parent | 4f68039a27c42a993454f701263b9a5d05720b0a (diff) | |
download | mongo-3e37098fa76e4882b502bdae02f5341b6d373b68.tar.gz |
Import wiredtiger: 91d67b193cb2981edfa5fc9e3bba1442d340c022 from branch mongodb-master
ref: 023918d163..91d67b193c
for: 6.1.0-rc0
WT-9030 Add a new undocumented configuration string remove_shared to WT_SESSION::drop
Diffstat (limited to 'src/third_party/wiredtiger/src/schema/schema_drop.c')
-rw-r--r-- | src/third_party/wiredtiger/src/schema/schema_drop.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/third_party/wiredtiger/src/schema/schema_drop.c b/src/third_party/wiredtiger/src/schema/schema_drop.c index 1133bcc9cb2..1ce21a7916f 100644 --- a/src/third_party/wiredtiger/src/schema/schema_drop.c +++ b/src/third_party/wiredtiger/src/schema/schema_drop.c @@ -182,10 +182,17 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char WT_TIERED *tiered; u_int i; const char *filename, *name; - bool exist, remove_files; + bool exist, remove_files, remove_shared; 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)); + remove_shared = cval.val != 0; + + if (!remove_files && remove_shared) + WT_RET_MSG(session, EINVAL, + "drop for tiered storage object must configure removal of underlying files " + "if forced removal of shared objects is enabled"); name = NULL; /* Get the tiered data handle. */ @@ -241,6 +248,13 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char WT_ERR(__wt_fs_exist(session, filename, &exist)); if (exist) WT_ERR(__wt_meta_track_drop(session, filename)); + + /* + * If a drop operation on tiered storage is configured to force removal of shared + * objects, we want to remove these files after the drop operation is successful. + */ + if (remove_shared) + WT_ERR(__wt_meta_track_drop_object(session, tiered->bstorage, filename)); } __wt_free(session, name); } @@ -256,6 +270,7 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char __wt_verbose(session, WT_VERB_TIERED, "DROP_TIERED: remove tiered table %s from metadata", uri); ret = __wt_metadata_remove(session, uri); + err: __wt_free(session, name); return (ret); |