diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-05-04 16:46:19 +1000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-04 07:11:56 +0000 |
commit | 7ee91c876d36ccb8dc0e7547d0b9471dad42d47d (patch) | |
tree | 0afe9f82b9339eec4aa0cff2541159d211682b5d | |
parent | 54fe37a42a34725ff6192117686e4c797d7176f3 (diff) | |
download | mongo-7ee91c876d36ccb8dc0e7547d0b9471dad42d47d.tar.gz |
Import wiredtiger: c17327160788b8da7766b7ff8e47ae4610b1660b from branch mongodb-5.0
ref: 87c819c15a..c173271607
for: 5.0.0
WT-6204 Possible race between backup and checkpoint at file close
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_ckpt.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index ec33577edd3..11b8f5ec284 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.0", - "commit": "87c819c15a2bc52ac5b949a7ffe0b84e8b68ebcf" + "commit": "c17327160788b8da7766b7ff8e47ae4610b1660b" } diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c index 250ff740765..dba739792a2 100644 --- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c +++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c @@ -1949,6 +1949,16 @@ __wt_checkpoint_close(WT_SESSION_IMPL *session, bool final) return (__wt_set_return(session, EBUSY)); /* + * Make sure there isn't a potential race between backup copying the metadata and a checkpoint + * changing the metadata. Backup holds both the checkpoint and schema locks. Checkpoint should + * hold those also except on the final checkpoint during close. Confirm the caller either is the + * final checkpoint or holds at least one of the locks. + */ + WT_ASSERT(session, + final || + (FLD_ISSET(session->lock_flags, WT_SESSION_LOCKED_CHECKPOINT) || + FLD_ISSET(session->lock_flags, WT_SESSION_LOCKED_SCHEMA))); + /* * Turn on metadata tracking if: * - The session is not already doing metadata tracking. * - The file was not bulk loaded. |