Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 42369f4

Browse files
committed
It's ok if file grows during backup
1 parent a39511b commit 42369f4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

data.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,14 @@ backup_data_file(const char *from_root, const char *to_root,
185185
}
186186
stat(file->path, &st);
187187

188-
if (st.st_size != file->size
189-
|| file->size % BLCKSZ != 0)
190-
elog(ERROR, "File: %s, file size %lu is incorrect", file->path, file->size);
188+
if (st.st_size < file->size)
189+
elog(ERROR, "File: %s, file was truncated after backup start. Expected size %lu",
190+
file->path, file->size);
191+
192+
if (file->size % BLCKSZ != 0)
193+
elog(ERROR, "File: %s, file size %lu is incorrect",
194+
file->path, file->size);
195+
191196
nblocks = file->size/BLCKSZ;
192197

193198
/* open backup file for write */

0 commit comments

Comments
 (0)