forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc4f99d2
committed
Add --synchronous option to pg_receivexlog, for more reliable WAL writing.
Previously pg_receivexlog flushed WAL data only when WAL file was switched.Then3dad73e added -F option to pg_receivexlog so that users could controlhow frequently sync commands were issued to WAL files. It also allowed usersto make pg_receivexlog flush WAL data immediately after writing byspecifying 0 in -F option. However feedback messages were not sent backimmediately even after a flush location was updated. So even if WAL datawas flushed in real time, the server could not see that for a while.This commit removes -F option from and adds --synchronous to pg_receivexlog.If --synchronous is specified, like the standby's wal receiver, pg_receivexlogflushes WAL data as soon as there is WAL data which has not been flushed yet.Then it sends back the feedback message identifying the latest flush locationto the server. This option is useful to make pg_receivexlog behave as syncstandby by using replication slot, for example.Original patch by Furuya Osamu, heavily rewritten by me.Reviewed by Heikki Linnakangas, Alvaro Herrera and Sawada Masahiko.1 parentbc24148 commitc4f99d2
File tree
5 files changed
+54
-72
lines changed- doc/src/sgml/ref
- src/bin/pg_basebackup
5 files changed
+54
-72
lines changedLines changed: 22 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 |
| |
52 | 59 |
| |
53 | 60 |
| |
| |||
85 | 92 |
| |
86 | 93 |
| |
87 | 94 |
| |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - | |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 | 95 |
| |
104 | 96 |
| |
105 | 97 |
| |
| |||
135 | 127 |
| |
136 | 128 |
| |
137 | 129 |
| |
138 |
| - | |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
143 | 134 |
| |
144 | 135 |
| |
145 | 136 |
| |
146 | 137 |
| |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
147 | 149 |
| |
148 | 150 |
| |
149 | 151 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
370 | 370 |
| |
371 | 371 |
| |
372 | 372 |
| |
373 |
| - | |
| 373 | + | |
374 | 374 |
| |
375 | 375 |
| |
376 | 376 |
| |
|
Lines changed: 8 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 |
| - | |
40 | 39 |
| |
41 | 40 |
| |
42 | 41 |
| |
| 42 | + | |
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
69 |
| - | |
70 |
| - | |
71 | 69 |
| |
72 | 70 |
| |
73 | 71 |
| |
74 | 72 |
| |
| 73 | + | |
75 | 74 |
| |
76 | 75 |
| |
77 | 76 |
| |
| |||
343 | 342 |
| |
344 | 343 |
| |
345 | 344 |
| |
346 |
| - | |
| 345 | + | |
347 | 346 |
| |
348 | 347 |
| |
349 | 348 |
| |
| |||
374 | 373 |
| |
375 | 374 |
| |
376 | 375 |
| |
377 |
| - | |
378 | 376 |
| |
379 | 377 |
| |
380 | 378 |
| |
| |||
383 | 381 |
| |
384 | 382 |
| |
385 | 383 |
| |
| 384 | + | |
386 | 385 |
| |
387 | 386 |
| |
388 | 387 |
| |
| |||
408 | 407 |
| |
409 | 408 |
| |
410 | 409 |
| |
411 |
| - | |
| 410 | + | |
412 | 411 |
| |
413 | 412 |
| |
414 | 413 |
| |
| |||
455 | 454 |
| |
456 | 455 |
| |
457 | 456 |
| |
458 |
| - | |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 |
| - | |
463 |
| - | |
464 |
| - | |
465 |
| - | |
466 |
| - | |
467 | 457 |
| |
468 | 458 |
| |
469 | 459 |
| |
| |||
474 | 464 |
| |
475 | 465 |
| |
476 | 466 |
| |
| 467 | + | |
| 468 | + | |
| 469 | + | |
477 | 470 |
| |
478 | 471 |
| |
479 | 472 |
| |
|
Lines changed: 22 additions & 35 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 |
| - | |
35 | 34 |
| |
36 | 35 |
| |
37 | 36 |
| |
38 | 37 |
| |
39 | 38 |
| |
40 | 39 |
| |
41 |
| - | |
| 40 | + | |
42 | 41 |
| |
43 | 42 |
| |
44 | 43 |
| |
| |||
55 | 54 |
| |
56 | 55 |
| |
57 | 56 |
| |
58 |
| - | |
59 |
| - | |
| 57 | + | |
60 | 58 |
| |
61 | 59 |
| |
62 | 60 |
| |
| |||
209 | 207 |
| |
210 | 208 |
| |
211 | 209 |
| |
212 |
| - | |
213 | 210 |
| |
214 | 211 |
| |
215 | 212 |
| |
| |||
440 | 437 |
| |
441 | 438 |
| |
442 | 439 |
| |
443 |
| - | |
444 |
| - | |
| 440 | + | |
| 441 | + | |
445 | 442 |
| |
446 | 443 |
| |
447 | 444 |
| |
| |||
450 | 447 |
| |
451 | 448 |
| |
452 | 449 |
| |
453 |
| - | |
| 450 | + | |
454 | 451 |
| |
455 | 452 |
| |
456 | 453 |
| |
| |||
595 | 592 |
| |
596 | 593 |
| |
597 | 594 |
| |
598 |
| - | |
| 595 | + | |
599 | 596 |
| |
600 | 597 |
| |
601 | 598 |
| |
| |||
760 | 757 |
| |
761 | 758 |
| |
762 | 759 |
| |
763 |
| - | |
| 760 | + | |
764 | 761 |
| |
765 | 762 |
| |
766 | 763 |
| |
| |||
784 | 781 |
| |
785 | 782 |
| |
786 | 783 |
| |
787 |
| - | |
788 |
| - | |
| 784 | + | |
| 785 | + | |
789 | 786 |
| |
790 |
| - | |
791 |
| - | |
792 |
| - | |
793 |
| - | |
794 |
| - | |
| 787 | + | |
795 | 788 |
| |
796 | 789 |
| |
797 | 790 |
| |
798 | 791 |
| |
799 | 792 |
| |
800 | 793 |
| |
801 | 794 |
| |
802 |
| - | |
803 | 795 |
| |
804 |
| - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
805 | 804 |
| |
806 | 805 |
| |
807 | 806 |
| |
| |||
821 | 820 |
| |
822 | 821 |
| |
823 | 822 |
| |
824 |
| - | |
| 823 | + | |
825 | 824 |
| |
826 | 825 |
| |
827 | 826 |
| |
| |||
1244 | 1243 |
| |
1245 | 1244 |
| |
1246 | 1245 |
| |
1247 |
| - | |
| 1246 | + | |
1248 | 1247 |
| |
1249 |
| - | |
1250 | 1248 |
| |
1251 |
| - | |
1252 | 1249 |
| |
1253 | 1250 |
| |
1254 | 1251 |
| |
1255 | 1252 |
| |
1256 | 1253 |
| |
1257 | 1254 |
| |
1258 |
| - | |
1259 |
| - | |
1260 |
| - | |
1261 |
| - | |
1262 |
| - | |
1263 |
| - | |
1264 |
| - | |
1265 |
| - | |
1266 |
| - | |
1267 |
| - | |
1268 |
| - | |
| 1255 | + | |
1269 | 1256 |
| |
1270 | 1257 |
| |
1271 | 1258 |
| |
1272 | 1259 |
| |
1273 | 1260 |
| |
1274 |
| - | |
| 1261 | + | |
1275 | 1262 |
| |
1276 | 1263 |
| |
1277 | 1264 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 |
| - | |
| 34 | + | |
35 | 35 |
| |
36 | 36 |
|
0 commit comments
Comments
(0)