forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit314cbfc
committed
Add new replication mode synchronous_commit = 'remote_apply'.
In this mode, the master waits for the transaction to be applied onthe remote side, not just written to disk. That means that you cancount on a transaction started on the standby to see all commitspreviously acknowledged by the master.To make this work, the standby sends a reply after replaying eachcommit record generated with synchronous_commit >= 'remote_apply'.This introduces a small inefficiency: the extra replies will be senteven by standbys that aren't the current synchronous standby. Butpreviously-existing synchronous_commit levels make no attempt at allto optimize which replies are sent based on what the primary caresabout, so this is no worse, and at least avoids any extra replies forpeople not using the feature at all.Thomas Munro, reviewed by Michael Paquier and by me. Some additionaltweaks by me.1 parenta898b40 commit314cbfc
File tree
16 files changed
+209
-67
lines changed- doc/src/sgml
- src
- backend
- access/transam
- replication
- libpqwalreceiver
- utils/misc
- include
- access
- replication
16 files changed
+209
-67
lines changedLines changed: 9 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2143 | 2143 |
| |
2144 | 2144 |
| |
2145 | 2145 |
| |
2146 |
| - | |
2147 |
| - | |
| 2146 | + | |
| 2147 | + | |
2148 | 2148 |
| |
2149 | 2149 |
| |
2150 | 2150 |
| |
| |||
2169 | 2169 |
| |
2170 | 2170 |
| |
2171 | 2171 |
| |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
2172 | 2176 |
| |
2173 | 2177 |
| |
2174 | 2178 |
| |
| |||
2186 | 2190 |
| |
2187 | 2191 |
| |
2188 | 2192 |
| |
2189 |
| - | |
2190 |
| - | |
2191 |
| - | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
2192 | 2196 |
| |
2193 | 2197 |
| |
2194 | 2198 |
| |
|
Lines changed: 15 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1081 | 1081 |
| |
1082 | 1082 |
| |
1083 | 1083 |
| |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
1084 | 1087 |
| |
1085 | 1088 |
| |
1086 | 1089 |
| |
| |||
1106 | 1109 |
| |
1107 | 1110 |
| |
1108 | 1111 |
| |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1109 | 1120 |
| |
1110 | 1121 |
| |
1111 | 1122 |
| |
| |||
1160 | 1171 |
| |
1161 | 1172 |
| |
1162 | 1173 |
| |
1163 |
| - | |
1164 |
| - | |
1165 |
| - | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
1166 | 1178 |
| |
1167 | 1179 |
| |
1168 | 1180 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1107 | 1107 |
| |
1108 | 1108 |
| |
1109 | 1109 |
| |
1110 |
| - | |
| 1110 | + | |
1111 | 1111 |
| |
1112 | 1112 |
| |
1113 | 1113 |
| |
| |||
2103 | 2103 |
| |
2104 | 2104 |
| |
2105 | 2105 |
| |
2106 |
| - | |
| 2106 | + | |
2107 | 2107 |
| |
2108 | 2108 |
| |
2109 | 2109 |
| |
| |||
2156 | 2156 |
| |
2157 | 2157 |
| |
2158 | 2158 |
| |
2159 |
| - | |
| 2159 | + | |
2160 | 2160 |
|
Lines changed: 15 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1324 | 1324 |
| |
1325 | 1325 |
| |
1326 | 1326 |
| |
1327 |
| - | |
| 1327 | + | |
1328 | 1328 |
| |
1329 | 1329 |
| |
1330 | 1330 |
| |
| |||
5122 | 5122 |
| |
5123 | 5123 |
| |
5124 | 5124 |
| |
| 5125 | + | |
| 5126 | + | |
| 5127 | + | |
| 5128 | + | |
| 5129 | + | |
| 5130 | + | |
| 5131 | + | |
5125 | 5132 |
| |
5126 | 5133 |
| |
5127 | 5134 |
| |
| |||
5459 | 5466 |
| |
5460 | 5467 |
| |
5461 | 5468 |
| |
| 5469 | + | |
| 5470 | + | |
| 5471 | + | |
| 5472 | + | |
| 5473 | + | |
| 5474 | + | |
| 5475 | + | |
5462 | 5476 |
| |
5463 | 5477 |
| |
5464 | 5478 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
345 | 345 |
| |
346 | 346 |
| |
347 | 347 |
| |
| 348 | + | |
| 349 | + | |
| 350 | + | |
348 | 351 |
| |
349 | 352 |
| |
350 | 353 |
| |
| |||
6879 | 6882 |
| |
6880 | 6883 |
| |
6881 | 6884 |
| |
| 6885 | + | |
| 6886 | + | |
| 6887 | + | |
| 6888 | + | |
| 6889 | + | |
| 6890 | + | |
| 6891 | + | |
| 6892 | + | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
6882 | 6896 |
| |
6883 | 6897 |
| |
6884 | 6898 |
| |
| |||
11594 | 11608 |
| |
11595 | 11609 |
| |
11596 | 11610 |
| |
| 11611 | + | |
| 11612 | + | |
| 11613 | + | |
| 11614 | + | |
| 11615 | + | |
| 11616 | + | |
| 11617 | + | |
| 11618 | + | |
| 11619 | + |
Lines changed: 10 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 |
| - | |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 |
| - | |
24 |
| - | |
25 |
| - | |
26 |
| - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 |
| |
28 | 30 |
| |
29 | 31 |
| |
|
Lines changed: 10 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
55 |
| - | |
| 55 | + | |
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| |||
463 | 463 |
| |
464 | 464 |
| |
465 | 465 |
| |
466 |
| - | |
467 |
| - | |
| 466 | + | |
468 | 467 |
| |
469 | 468 |
| |
470 | 469 |
| |
471 | 470 |
| |
472 | 471 |
| |
473 | 472 |
| |
474 | 473 |
| |
475 |
| - | |
476 |
| - | |
| 474 | + | |
| 475 | + | |
477 | 476 |
| |
478 | 477 |
| |
479 | 478 |
| |
480 | 479 |
| |
481 | 480 |
| |
482 | 481 |
| |
483 |
| - | |
| 482 | + | |
484 | 483 |
| |
485 | 484 |
| |
486 | 485 |
| |
| |||
492 | 491 |
| |
493 | 492 |
| |
494 | 493 |
| |
495 |
| - | |
496 |
| - | |
497 |
| - | |
498 |
| - | |
499 |
| - | |
500 |
| - | |
501 |
| - | |
502 |
| - | |
503 |
| - | |
504 |
| - | |
| 494 | + | |
505 | 495 |
| |
506 | 496 |
| |
507 | 497 |
| |
| |||
510 | 500 |
| |
511 | 501 |
| |
512 | 502 |
| |
| 503 | + | |
| 504 | + | |
| 505 | + | |
513 | 506 |
| |
| 507 | + | |
514 | 508 |
| |
515 | 509 |
| |
516 | 510 |
| |
|
Lines changed: 28 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
94 | 99 |
| |
95 | 100 |
| |
96 |
| - | |
| 101 | + | |
97 | 102 |
| |
98 | 103 |
| |
99 | 104 |
| |
100 |
| - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
101 | 112 |
| |
102 | 113 |
| |
103 | 114 |
| |
| |||
122 | 133 |
| |
123 | 134 |
| |
124 | 135 |
| |
125 |
| - | |
| 136 | + | |
126 | 137 |
| |
127 | 138 |
| |
128 | 139 |
| |
| |||
132 | 143 |
| |
133 | 144 |
| |
134 | 145 |
| |
135 |
| - | |
| 146 | + | |
136 | 147 |
| |
137 | 148 |
| |
138 | 149 |
| |
| |||
147 | 158 |
| |
148 | 159 |
| |
149 | 160 |
| |
150 |
| - | |
| 161 | + | |
151 | 162 |
| |
152 | 163 |
| |
153 | 164 |
| |
| |||
416 | 427 |
| |
417 | 428 |
| |
418 | 429 |
| |
| 430 | + | |
419 | 431 |
| |
420 | 432 |
| |
421 | 433 |
| |
| |||
462 | 474 |
| |
463 | 475 |
| |
464 | 476 |
| |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
465 | 482 |
| |
466 | 483 |
| |
467 | 484 |
| |
468 |
| - | |
| 485 | + | |
469 | 486 |
| |
470 |
| - | |
| 487 | + | |
| 488 | + | |
471 | 489 |
| |
472 | 490 |
| |
473 | 491 |
| |
| |||
728 | 746 |
| |
729 | 747 |
| |
730 | 748 |
| |
| 749 | + | |
| 750 | + | |
| 751 | + | |
731 | 752 |
| |
732 | 753 |
| |
733 | 754 |
| |
|
0 commit comments
Comments
(0)