Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1bb6924

Browse files
committed
Adjust total size in pg_basebackup progress report when reality changes
When streaming including WAL, the size estimate will always be incorrect,since we don't know how much WAL is included. To make sure the output doesn'tlook completely unreasonable, this patch increases the total size whenever wego past the estimate, to make sure we never go above 100%.
1 parent2877c67 commit1bb6924

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,17 @@ progress_report(int tablespacenum, const char *filename)
207207
chartotaldone_str[32];
208208
chartotalsize_str[32];
209209

210+
/*
211+
* Avoid overflowing past 100% or the full size. This may make the
212+
* total size number change as we approach the end of the backup
213+
* (the estimate will always be wrong if WAL is included), but
214+
* that's better than having the done column be bigger than the
215+
* total.
216+
*/
210217
if (percent>100)
211218
percent=100;
219+
if (totaldone /1024>totalsize)
220+
totalsize=totaldone /1024;
212221

213222
/*
214223
* Separate step to keep platform-dependent format code out of translatable

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp