summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/meta/meta_turtle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/meta/meta_turtle.c')
-rw-r--r--src/third_party/wiredtiger/src/meta/meta_turtle.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/third_party/wiredtiger/src/meta/meta_turtle.c b/src/third_party/wiredtiger/src/meta/meta_turtle.c
index 8e95510f99a..324de0237db 100644
--- a/src/third_party/wiredtiger/src/meta/meta_turtle.c
+++ b/src/third_party/wiredtiger/src/meta/meta_turtle.c
@@ -223,7 +223,7 @@ __wt_turtle_exists(WT_SESSION_IMPL *session, bool *existp)
* Check the turtle file and create if necessary.
*/
int
-__wt_turtle_init(WT_SESSION_IMPL *session)
+__wt_turtle_init(WT_SESSION_IMPL *session, bool verify_meta)
{
WT_DECL_RET;
char *metaconf, *unused_value;
@@ -307,6 +307,15 @@ __wt_turtle_init(WT_SESSION_IMPL *session)
if (exist_incr)
F_SET(S2C(session), WT_CONN_WAS_BACKUP);
+ /*
+ * Verifying the metadata is incompatible with restarting from a backup because the verify
+ * call will rewrite the metadata's checkpoint and could lead to skipping recovery. Test
+ * here before creating the metadata file and reading in the backup file.
+ */
+ if (verify_meta && exist_backup)
+ WT_RET_MSG(
+ session, EINVAL, "restoring a backup is incompatible with metadata verification");
+
/* Create the metadata file. */
WT_RET(__metadata_init(session));