-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
Doing incremental backups can prevent future recovery.
This diff drops core after the incremental backup file has been created but before it's removed:
diff --git a/src/cursor/cur_backup.c b/src/cursor/cur_backup.c
index c89f002..b39ab79 100644
--- a/src/cursor/cur_backup.c
+++ b/src/cursor/cur_backup.c
@@ -412,6 +412,8 @@ err: __wt_scr_free(session, &tmp);
return (ret);
}
+int xxx;
+
/*
* __backup_file_create --
* Create the meta-data backup file.
@@ -420,6 +422,7 @@ static int
__backup_file_create(
WT_SESSION_IMPL *session, WT_CURSOR_BACKUP *cb, bool incremental)
{
+ if (incremental) xxx = 1;
return (__wt_fopen(session,
incremental ? WT_INCREMENTAL_BACKUP : WT_METADATA_BACKUP,
WT_OPEN_CREATE, WT_STREAM_WRITE, &cb->bfs));
@@ -434,6 +437,8 @@ __wt_backup_file_remove(WT_SESSION_IMPL *session)
{
WT_DECL_RET;
+ if (xxx) abort();
+
WT_TRET(__wt_remove_if_exists(session, WT_INCREMENTAL_BACKUP));
WT_TRET(__wt_remove_if_exists(session, WT_METADATA_BACKUP));
return (ret);
run test/format and wait for the abort, then run recovery:
% ./t -q logging=1 backups=on logging_archive=off timer=100 ops=0 t: process 26351 Abort (core dumped) % egrep data_source RUNDIR/CONFIG data_source=file % ../../wt -R -h RUNDIR verify file:wt [1461431979:437735][26360:0x803006400], t, connection: Incremental backup after running recovery is not allowed.: Invalid argument
The problem is WT_INCREMENTAL_BACKUP is created in the current directory, and if we fail before it's removed, we'll disallow recovery.