Commit 5a1007a
committed
Have the server properly terminate tar archives.
Earlier versions of PostgreSQL featured a version of pg_basebackup
that wanted to edit tar archives but was too dumb to parse them
properly. The server made things easier for the client by failing
to add the two blocks of zero bytes that ought to end a tar file,
leaving it up to the client to do that.
But since commit 23a1c65, we
don't need this hack any more, because pg_basebackup is now smarter
and can parse tar files even if they are properly terminated! So
change the server to always properly terminate the tar files. Older
versions of pg_basebackup can't talk to new servers anyway, so
there's no compatibility break.
On the pg_basebackup side, we see still need to add the terminating
zero bytes if we're talking to an older server, but not when the
server is v15+. Hopefully at some point we'll be able to remove
some of this compatibility cruft, but it seems best to hang on to
it for now.
In passing, add a file header comment to bbstreamer_tar.c, to make
it clearer what's going on here.
Discussion: http://postgr.es/m/CA+TgmoZbNzsWwM4BE5Jb_qHncY817DYZwGf+2-7hkMQ27ZwsMQ@mail.gmail.com1 parent ee3a1a5 commit 5a1007a
File tree
3 files changed
+45
-6
lines changed- src
- backend/replication
- bin/pg_basebackup
3 files changed
+45
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
377 | 385 | | |
| 386 | + | |
378 | 387 | | |
379 | 388 | | |
380 | 389 | | |
| |||
611 | 620 | | |
612 | 621 | | |
613 | 622 | | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
614 | 630 | | |
615 | 631 | | |
616 | 632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
5 | 15 | | |
6 | 16 | | |
7 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| |||
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
169 | | - | |
| 175 | + | |
| 176 | + | |
170 | 177 | | |
171 | 178 | | |
172 | 179 | | |
| |||
965 | 972 | | |
966 | 973 | | |
967 | 974 | | |
968 | | - | |
| 975 | + | |
| 976 | + | |
969 | 977 | | |
970 | 978 | | |
971 | 979 | | |
| |||
1074 | 1082 | | |
1075 | 1083 | | |
1076 | 1084 | | |
1077 | | - | |
1078 | | - | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1079 | 1088 | | |
1080 | 1089 | | |
1081 | 1090 | | |
1082 | | - | |
| 1091 | + | |
1083 | 1092 | | |
1084 | 1093 | | |
1085 | 1094 | | |
| |||
1099 | 1108 | | |
1100 | 1109 | | |
1101 | 1110 | | |
| 1111 | + | |
1102 | 1112 | | |
1103 | 1113 | | |
1104 | 1114 | | |
1105 | 1115 | | |
1106 | 1116 | | |
| 1117 | + | |
| 1118 | + | |
1107 | 1119 | | |
1108 | 1120 | | |
1109 | | - | |
| 1121 | + | |
| 1122 | + | |
1110 | 1123 | | |
1111 | 1124 | | |
1112 | 1125 | | |
| |||
0 commit comments