forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7fbe0c8
committed
Fix some issues with WAL segment opening for pg_receivewal --compress
The logic handling the opening of new WAL segments was fuzzy when using--compress if a partial, non-compressed, segment with the same base nameexisted in the repository storing those files. In this case, using--compress would cause the code to first check for the existence and thesize of a non-compressed segment, followed by the opening of a newcompressed, partial, segment. The code was accidentally workingcorrectly on most platforms as the buildfarm has proved, exceptbowerbird where gzflush() could fail in this code path. It is wronganyway to take the code path used pre-padding when creating a newpartial, non-compressed, segment, so let's fix it.Note that this issue exists when users mix successive runs ofpg_receivewal with or without compression, as discovered with the testsintroduced byffc9dda.While on it, this refactors the code so as code paths that need to knowabout the ".gz" suffix are down from four to one in walmethods.c, easinga bit the introduction of new compression methods. This addresses asecond issue where log messages generated for an unexpected failurewould not show the compressed segment name involved, which wasconfusing, printing instead the name of the non-compressed equivalent.Reported-by: Georgios KokolatosDiscussion:https://postgr.es/m/YPDLz2x3o1aX2wRh@paquier.xyzBackpatch-through: 101 parent01c3adc commit7fbe0c8
File tree
3 files changed
+78
-23
lines changed- src/bin/pg_basebackup
3 files changed
+78
-23
lines changedLines changed: 8 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
91 |
| - | |
| 91 | + | |
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
98 |
| - | |
99 |
| - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
100 | 101 |
| |
101 | 102 |
| |
102 | 103 |
| |
103 | 104 |
| |
104 | 105 |
| |
105 |
| - | |
| 106 | + | |
| 107 | + | |
106 | 108 |
| |
107 | 109 |
| |
108 | 110 |
| |
109 | 111 |
| |
110 |
| - | |
| 112 | + | |
| 113 | + | |
111 | 114 |
| |
112 | 115 |
| |
113 | 116 |
| |
|
Lines changed: 61 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
71 | 83 |
| |
72 | 84 |
| |
73 | 85 |
| |
74 | 86 |
| |
| 87 | + | |
75 | 88 |
| |
76 | 89 |
| |
77 | 90 |
| |
78 | 91 |
| |
79 | 92 |
| |
80 | 93 |
| |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
85 | 97 |
| |
86 | 98 |
| |
87 | 99 |
| |
| |||
232 | 244 |
| |
233 | 245 |
| |
234 | 246 |
| |
| 247 | + | |
| 248 | + | |
| 249 | + | |
235 | 250 |
| |
236 | 251 |
| |
237 | 252 |
| |
238 | 253 |
| |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 |
| - | |
243 |
| - | |
244 |
| - | |
245 |
| - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
246 | 262 |
| |
247 | 263 |
| |
248 | 264 |
| |
249 | 265 |
| |
| 266 | + | |
| 267 | + | |
250 | 268 |
| |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 |
| - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
255 | 272 |
| |
256 | 273 |
| |
257 | 274 |
| |
| |||
313 | 330 |
| |
314 | 331 |
| |
315 | 332 |
| |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
316 | 339 |
| |
317 | 340 |
| |
318 | 341 |
| |
| |||
355 | 378 |
| |
356 | 379 |
| |
357 | 380 |
| |
| 381 | + | |
| 382 | + | |
358 | 383 |
| |
359 | 384 |
| |
360 | 385 |
| |
| |||
527 | 552 |
| |
528 | 553 |
| |
529 | 554 |
| |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
530 | 566 |
| |
531 | 567 |
| |
532 | 568 |
| |
533 | 569 |
| |
534 |
| - | |
| 570 | + | |
535 | 571 |
| |
536 | 572 |
| |
537 | 573 |
| |
| |||
583 | 619 |
| |
584 | 620 |
| |
585 | 621 |
| |
586 |
| - | |
587 |
| - | |
| 622 | + | |
588 | 623 |
| |
589 | 624 |
| |
590 | 625 |
| |
| |||
689 | 724 |
| |
690 | 725 |
| |
691 | 726 |
| |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
692 | 733 |
| |
693 | 734 |
| |
694 | 735 |
| |
| |||
994 | 1035 |
| |
995 | 1036 |
| |
996 | 1037 |
| |
| 1038 | + | |
| 1039 | + | |
997 | 1040 |
| |
998 | 1041 |
| |
999 | 1042 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
55 | 64 |
| |
56 | 65 |
| |
57 | 66 |
| |
|
0 commit comments
Comments
(0)