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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy