Skip to content

Commit bb3f4fb

Browse files
committed
MDEV-13310 Preparing an incremental backup twice can corrupt data
Remove .delta file after it was successfully applied
1 parent 8d1fb47 commit bb3f4fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4974,8 +4974,11 @@ xtrabackup_apply_delta(
49744974

49754975
if (incremental_buffer_base)
49764976
ut_free(incremental_buffer_base);
4977-
if (src_file != XB_FILE_UNDEFINED)
4977+
if (src_file != XB_FILE_UNDEFINED) {
49784978
os_file_close(src_file);
4979+
/* Remove .delta file after it was successfully applied.*/
4980+
os_file_delete(0,src_path);
4981+
}
49794982
if (dst_file != XB_FILE_UNDEFINED)
49804983
os_file_close(dst_file);
49814984
return TRUE;

0 commit comments

Comments
 (0)