forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1462aad

Amit Kapila
Allow altering of two_phase option of a SUBSCRIPTION.
The two_phase option is controlled by both the publisher (as a slotoption) and the subscriber (as a subscription option), so the slot optionmust also be modified.Changing the 'two_phase' option for a subscription from 'true' to 'false'is permitted only when there are no pending prepared transactionscorresponding to that subscription. Otherwise, the changes of alreadyprepared transactions can be replicated again along with their correspondingcommit leading to duplicate data or errors.To avoid data loss, the 'two_phase' option for a subscription can only bechanged from 'false' to 'true' once the initial data synchronization iscompleted. Therefore this is performed later by the logical replication worker.Author: Hayato Kuroda, Ajin Cherian, Amit KapilaReviewed-by: Peter Smith, Hou Zhijie, Amit Kapila, Vitaly Davydov, Vignesh CDiscussion:https://postgr.es/m/8fab8-65d74c80-1-2f28e880@390881661 parent774d47b commit1462aad
File tree
17 files changed
+452
-114
lines changed- doc/src/sgml
- ref
- src
- backend
- access/transam
- commands
- replication
- libpqwalreceiver
- logical
- bin/psql
- include
- access
- replication
- test
- regress
- expected
- sql
- subscription/t
17 files changed
+452
-114
lines changedLines changed: 17 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2192 | 2192 |
| |
2193 | 2193 |
| |
2194 | 2194 |
| |
2195 |
| - | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
2196 | 2212 |
| |
2197 | 2213 |
| |
2198 | 2214 |
| |
|
Lines changed: 32 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
72 |
| - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
73 | 74 |
| |
74 | 75 |
| |
75 | 76 |
| |
| |||
228 | 229 |
| |
229 | 230 |
| |
230 | 231 |
| |
231 |
| - | |
232 |
| - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
233 | 235 |
| |
234 | 236 |
| |
235 | 237 |
| |
| |||
252 | 254 |
| |
253 | 255 |
| |
254 | 256 |
| |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
255 | 283 |
| |
256 | 284 |
| |
257 | 285 |
| |
|
Lines changed: 79 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2681 | 2681 |
| |
2682 | 2682 |
| |
2683 | 2683 |
| |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + |
0 commit comments
Comments
(0)