NBackup don't validate invalid level in some special occasions, leading to
invalid files impossible to restore
--------------------------------------------------------------------------------------------------------------
Key: CORE-6391
URL: http://tracker.firebirdsql.org/browse/CORE-6391
Project: Firebird Core
Issue Type: Bug
Components: NBACKUP
Affects Versions: 3.0.6
Environment: Win 10, Fb 3.0.6
Reporter: Lucas Schatz
Example:
Do nbackup level 0 - OK
Do nbackup level 1 - OK
Do nbackup level 2 - OK
Do nbackup level 0 - OK
Do nbackup level 2 - OK (WTF?)
Try to restore the last level 2 nbackup:
Invalid level 2 of incremental backup file: db.n2.nbackup, expected 1
Try to use latest level 2 with latest level 1 and latest level 0:
Wrong order of backup files or invalid incremental backup file detected, file:
db.n1.nbackup
Example:
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 0 c:\temp\MASTER.FDB
MASTER.n0.nbackup
time elapsed 1 sec
page reads 231
page writes 231
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 1 c:\temp\MASTER.FDB
MASTER.n1.nbackup
time elapsed 1 sec
page reads 13
page writes 13
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 2 c:\temp\MASTER.FDB
MASTER.n2.nbackup
time elapsed 1 sec
page reads 12
page writes 12
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 0 c:\temp\MASTER.FDB
MASTER.n0.1.nbackup
time elapsed 0 sec
page reads 232
page writes 232
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 2 c:\temp\MASTER.FDB
MASTER.n2.1.nbackup
time elapsed 0 sec
page reads 12
page writes 12
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -R masterrestore0e2.fdb
MASTER.n0.1.nbackup MASTER.n2.1.nbackup
Invalid level 2 of incremental backup file: MASTER.n2.1.nbackup, expected 1
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -R masterrestore0e2.fdb
MASTER.n0.1.nbackup MASTER.n1.nbackup MASTER.n2.1.nbackup
Wrong order of backup files or invalid incremental backup file detected, file:
MASTER.n1.nbackup
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 1 c:\temp\MASTER.FDB
MASTER.n1.2.nbackup
time elapsed 0 sec
page reads 12
page writes 12
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 2 c:\temp\MASTER.FDB
MASTER.n2.2.nbackup
time elapsed 0 sec
page reads 10
page writes 10
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -R masterrestore0e22.fdb
MASTER.n0.1.nbackup MASTER.n1.2.nbackup MASTER.n2.2.nbackup
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 3 c:\temp\MASTER.FDB
MASTER.n3.2.nbackup
time elapsed 0 sec
page reads 10
page writes 10
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 1 c:\temp\MASTER.FDB
MASTER.n1.3.nbackup
time elapsed 0 sec
page reads 12
page writes 12
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 3 c:\temp\MASTER.FDB
MASTER.n3.3.nbackup
time elapsed 0 sec
page reads 10
page writes 10
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -R masterrestore0e23.fdb
MASTER.n0.1.nbackup MASTER.n1.3.nbackup MASTER.n3.3.nbackup
Invalid level 3 of incremental backup file: MASTER.n3.3.nbackup, expected 2
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 2 c:\temp\MASTER.FDB
MASTER.n2.4.nbackup
time elapsed 1 sec
page reads 10
page writes 10
C:\temp>d:\github\firebird\output_Win32\nbackup.exe -B 4 c:\temp\MASTER.FDB
MASTER.n4.4.nbackup
time elapsed 0 sec
page reads 10
page writes 10
Expected behavior:
nbackup would give an error if I try to run a valid level but in an invalid
order, I think that the previous level order could be 3 possibilities : n-1,n
or bigger than I'm doing right now, example of valid sequences:
0,1,2,3,4,5,3,4,5,3,3,3,4...
0,1,2,3,1,2,3,1,2,3,0,1,2,2,2,3...
Invalid sequences:
0,1,2,3,1,3
0,1,2,3,4,5,3,5
0,1,2,0,3
Thanks!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel