diff options
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/meta/meta_turtle.c | 7 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_ckpt.c | 9 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_recover.c | 3 |
4 files changed, 18 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index d89f190d17f..43ded9f7593 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-4.4", - "commit": "c5b5e47d2c3023a41782be617dad72aa13ffa86c" + "commit": "b32ec77d65b3e5e8ce2d3acf4918a8df014c8e69" } diff --git a/src/third_party/wiredtiger/src/meta/meta_turtle.c b/src/third_party/wiredtiger/src/meta/meta_turtle.c index 309c80eaa05..a2b85285990 100644 --- a/src/third_party/wiredtiger/src/meta/meta_turtle.c +++ b/src/third_party/wiredtiger/src/meta/meta_turtle.c @@ -324,8 +324,11 @@ __wt_turtle_init(WT_SESSION_IMPL *session) WT_RET(ret); } - /* Remove the backup files, we'll never read them again. */ - return (__wt_backup_file_remove(session)); + /* + * We used to remove the backup file here. But we cannot do that until the metadata is fully + * synced to disk after recovery. + */ + return (ret); } /* diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c index e4ab6778af8..be072499e36 100644 --- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c +++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c @@ -1352,6 +1352,15 @@ __checkpoint_lock_dirty_tree_int(WT_SESSION_IMPL *session, bool is_checkpoint, b is_wt_ckpt = WT_PREFIX_MATCH(ckpt->name, WT_CHECKPOINT); /* + * If we are restarting from a backup and we're in recovery do not delete any checkpoints. + * In the event of a crash we may need to restart from the backup and all checkpoints that + * were in the backup file must remain. + */ + if (F_ISSET(conn, WT_CONN_RECOVERING) && F_ISSET(conn, WT_CONN_WAS_BACKUP)) { + F_CLR(ckpt, WT_CKPT_DELETE); + continue; + } + /* * If there is a hot backup, don't delete any WiredTiger checkpoint that could possibly have * been created before the backup started. Fail if trying to delete any other named * checkpoint. diff --git a/src/third_party/wiredtiger/src/txn/txn_recover.c b/src/third_party/wiredtiger/src/txn/txn_recover.c index 02d7d5e7a05..1036b761c37 100644 --- a/src/third_party/wiredtiger/src/txn/txn_recover.c +++ b/src/third_party/wiredtiger/src/txn/txn_recover.c @@ -1082,6 +1082,9 @@ done: */ WT_ERR(session->iface.checkpoint(&session->iface, "force=1")); + /* Remove any backup file now that metadata has been synced. */ + WT_ERR(__wt_backup_file_remove(session)); + /* * Update the open dhandles write generations and base write generation with the connection's * base write generation because the recovery checkpoint writes the pages to disk with new write |