diff options
author | Will Korteland <will.korteland@mongodb.com> | 2022-03-31 03:12:56 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-31 03:42:18 +0000 |
commit | 5e16b3f30fb6e111816c25a678fd46e7b579abf0 (patch) | |
tree | 26088fa31aa0df56f220108ac3c8941e9fade26f | |
parent | 2c77d92ddcd9b1157cd13fb97dd3580b67e205a1 (diff) | |
download | mongo-5e16b3f30fb6e111816c25a678fd46e7b579abf0.tar.gz |
Import wiredtiger: c36aee23c42c7aa21b500263b9980b61b80679b1 from branch mongodb-master
ref: f35abcdb9c..c36aee23c4
for: 6.0.0
WT-8985 Extend test_tiered07.py to test all WT_SESSION::drop options
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/test/suite/test_tiered07.py | 27 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index bba407c9d1e..a70d13ecd00 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": "f35abcdb9cfb20549bfa451be34957cbbb5494eb" + "commit": "c36aee23c42c7aa21b500263b9980b61b80679b1" } diff --git a/src/third_party/wiredtiger/test/suite/test_tiered07.py b/src/third_party/wiredtiger/test/suite/test_tiered07.py index c13a47ff9ca..4be4b13b507 100644 --- a/src/third_party/wiredtiger/test/suite/test_tiered07.py +++ b/src/third_party/wiredtiger/test/suite/test_tiered07.py @@ -26,7 +26,7 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. -from helper_tiered import generate_s3_prefix, get_auth_token, get_bucket1_name +from helper_tiered import get_auth_token, get_bucket1_name from wtscenario import make_scenarios import os, wiredtiger, wttest StorageSource = wiredtiger.StorageSource # easy access to constants @@ -52,6 +52,7 @@ class test_tiered07(wttest.WiredTigerTestCase): uri = "table:abc" uri2 = "table:ab" uri3 = "table:abcd" + uri4 = "table:abcde" localuri = "table:local" newuri = "table:tier_new" @@ -130,6 +131,25 @@ class test_tiered07(wttest.WiredTigerTestCase): self.session.drop(self.localuri) self.session.drop(self.uri) + # By default, the remove_files configuration for drop is true. This means that the + # drop operation for tiered tables should both remove the files from the metadata + # file and remove the corresponding local object files in the directory. Currently the + # below code is commented as the files are not removed from the directory. FIXME: WT-9003 + # self.assertFalse(os.path.isfile("abc-0000000001.wtobj")) + # self.assertFalse(os.path.isfile("abc-0000000002.wtobj")) + + # Dropping a table using the force setting should succeed even if the table does not exist. + self.session.drop(self.localuri, 'force=true') + self.session.drop(self.uri, 'force=true') + + # Dropping a table should not succeed if the table does not exist. + # Test dropping a table that was previously dropped. + self.assertRaises(wiredtiger.WiredTigerError, + lambda: self.session.drop(self.localuri, None)) + # Test dropping a table that does not exist. + self.assertRaises(wiredtiger.WiredTigerError, + lambda: self.session.drop("table:random_non_existent", None)) + # Create new table with same name. This should error. msg = "/already exists/" self.pr('check cannot create with same name') @@ -149,5 +169,10 @@ class test_tiered07(wttest.WiredTigerTestCase): self.pr('create new table') self.session.create(self.newuri, 'key_format=S') + # Test the drop operation without removing associated files. + self.session.create(self.uri4, 'key_format=S,value_format=S') + self.session.drop(self.uri4, 'remove_files=false') + self.assertTrue(os.path.isfile("abcde-0000000001.wtobj")) + if __name__ == '__main__': wttest.run() |