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

Commit0278d3f

Browse files
committed
Fix bogus tar-file padding logic for standby.signal.
When pg_basebackup -R is used, we inject standby.signal into thetar file for the main tablespace. The proper thing to do is to padeach file injected into the tar file out to a 512-byte boundaryby appending nulls, but here the file is of length 0 and we add511 zero bytes. Since 0 is already a multiple of 512, we shouldnot add any zero bytes. Do that instead.Patch by me, reviewed by Tom Lane.Discussion:http://postgr.es/m/CA+TgmobWbfReO9-XFk8urR1K4wTNwqoHx_v56t7=T8KaiEoKNw@mail.gmail.com
1 parente81e574 commit0278d3f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,12 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
12071207
time(NULL));
12081208

12091209
writeTarData(&state,header,sizeof(header));
1210-
writeTarData(&state,zerobuf,511);
1210+
1211+
/*
1212+
* we don't need to pad out to a multiple of the tar block size
1213+
* here, because the file is zero length, which is a multiple of
1214+
* any block size.
1215+
*/
12111216
}
12121217
}
12131218

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp