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

Amit Kapila
Add a new slot sync worker to synchronize logical slots.
By enabling slot synchronization, all the failover logical replicationslots on the primary (assuming configurations are appropriate) areautomatically created on the physical standbys and are syncedperiodically. The slot sync worker on the standby server pings the primaryserver at regular intervals to get the necessary failover logical slotsinformation and create/update the slots locally. The slots that no longerrequire synchronization are automatically dropped by the worker.The nap time of the worker is tuned according to the activity on theprimary. The slot sync worker waits for some time before the nextsynchronization, with the duration varying based on whether any slots wereupdated during the last cycle.A new parameter sync_replication_slots enables or disables this newprocess.On promotion, the slot sync worker is shut down by the startup process todrop any temporary slots acquired by the slot sync worker and to preventthe worker from trying to fetch the failover slots.A functionality to allow logical walsenders to wait for the physical willbe done in a subsequent commit.Author: Shveta Malik, Hou Zhijie based on design inputs by Masahiko Sawada and Amit KapilaReviewed-by: Masahiko Sawada, Bertrand Drouvot, Peter Smith, Dilip Kumar, Ajin Cherian, Nisha Moond, Kuroda Hayato, Amit KapilaDiscussion:https://postgr.es/m/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com1 parent3d47b75 commit93db6cb
File tree
19 files changed
+966
-76
lines changed- doc/src/sgml
- src
- backend
- access/transam
- postmaster
- replication
- libpqwalreceiver
- logical
- storage/lmgr
- utils
- activity
- init
- misc
- include
- replication
- test/recovery/t
19 files changed
+966
-76
lines changedLines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4943 | 4943 |
| |
4944 | 4944 |
| |
4945 | 4945 |
| |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
4946 | 4964 |
| |
4947 | 4965 |
| |
4948 | 4966 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
373 | 373 |
| |
374 | 374 |
| |
375 | 375 |
| |
376 |
| - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
377 | 380 |
| |
378 | 381 |
| |
379 | 382 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| 52 | + | |
52 | 53 |
| |
53 | 54 |
| |
54 | 55 |
| |
| |||
1467 | 1468 |
| |
1468 | 1469 |
| |
1469 | 1470 |
| |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1470 | 1485 |
| |
1471 | 1486 |
| |
1472 | 1487 |
| |
|
Lines changed: 78 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
| 118 | + | |
118 | 119 |
| |
119 | 120 |
| |
120 | 121 |
| |
| |||
167 | 168 |
| |
168 | 169 |
| |
169 | 170 |
| |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
175 | 176 |
| |
176 | 177 |
| |
177 | 178 |
| |
| |||
254 | 255 |
| |
255 | 256 |
| |
256 | 257 |
| |
257 |
| - | |
| 258 | + | |
| 259 | + | |
258 | 260 |
| |
259 | 261 |
| |
260 | 262 |
| |
| |||
445 | 447 |
| |
446 | 448 |
| |
447 | 449 |
| |
| 450 | + | |
448 | 451 |
| |
449 | 452 |
| |
450 | 453 |
| |
| |||
1822 | 1825 |
| |
1823 | 1826 |
| |
1824 | 1827 |
| |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
1825 | 1831 |
| |
1826 | 1832 |
| |
1827 | 1833 |
| |
| |||
2661 | 2667 |
| |
2662 | 2668 |
| |
2663 | 2669 |
| |
| 2670 | + | |
| 2671 | + | |
2664 | 2672 |
| |
2665 | 2673 |
| |
2666 | 2674 |
| |
| |||
3010 | 3018 |
| |
3011 | 3019 |
| |
3012 | 3020 |
| |
| 3021 | + | |
3013 | 3022 |
| |
3014 | 3023 |
| |
3015 | 3024 |
| |
| |||
3180 | 3189 |
| |
3181 | 3190 |
| |
3182 | 3191 |
| |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
3183 | 3208 |
| |
3184 | 3209 |
| |
3185 | 3210 |
| |
| |||
3384 | 3409 |
| |
3385 | 3410 |
| |
3386 | 3411 |
| |
3387 |
| - | |
| 3412 | + | |
3388 | 3413 |
| |
3389 | 3414 |
| |
3390 | 3415 |
| |
| |||
3546 | 3571 |
| |
3547 | 3572 |
| |
3548 | 3573 |
| |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
3549 | 3580 |
| |
3550 | 3581 |
| |
3551 | 3582 |
| |
| |||
3686 | 3717 |
| |
3687 | 3718 |
| |
3688 | 3719 |
| |
| 3720 | + | |
| 3721 | + | |
3689 | 3722 |
| |
3690 | 3723 |
| |
3691 | 3724 |
| |
| |||
3701 | 3734 |
| |
3702 | 3735 |
| |
3703 | 3736 |
| |
3704 |
| - | |
3705 |
| - | |
3706 |
| - | |
3707 |
| - | |
3708 |
| - | |
3709 |
| - | |
3710 |
| - | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
3711 | 3744 |
| |
3712 | 3745 |
| |
3713 | 3746 |
| |
| |||
3717 | 3750 |
| |
3718 | 3751 |
| |
3719 | 3752 |
| |
3720 |
| - | |
| 3753 | + | |
| 3754 | + | |
3721 | 3755 |
| |
3722 | 3756 |
| |
3723 | 3757 |
| |
| |||
3815 | 3849 |
| |
3816 | 3850 |
| |
3817 | 3851 |
| |
| 3852 | + | |
3818 | 3853 |
| |
3819 | 3854 |
| |
3820 | 3855 |
| |
| |||
4038 | 4073 |
| |
4039 | 4074 |
| |
4040 | 4075 |
| |
| 4076 | + | |
| 4077 | + | |
4041 | 4078 |
| |
4042 | 4079 |
| |
4043 | 4080 |
| |
| |||
4850 | 4887 |
| |
4851 | 4888 |
| |
4852 | 4889 |
| |
| 4890 | + | |
4853 | 4891 |
| |
4854 | 4892 |
| |
4855 | 4893 |
| |
| |||
4953 | 4991 |
| |
4954 | 4992 |
| |
4955 | 4993 |
| |
| 4994 | + | |
| 4995 | + | |
| 4996 | + | |
| 4997 | + | |
| 4998 | + | |
| 4999 | + | |
| 5000 | + | |
4956 | 5001 |
| |
4957 | 5002 |
| |
4958 | 5003 |
| |
| |||
5498 | 5543 |
| |
5499 | 5544 |
| |
5500 | 5545 |
| |
| 5546 | + | |
| 5547 | + | |
| 5548 | + | |
| 5549 | + | |
| 5550 | + | |
| 5551 | + | |
| 5552 | + | |
| 5553 | + | |
| 5554 | + | |
| 5555 | + | |
| 5556 | + | |
| 5557 | + | |
| 5558 | + | |
| 5559 | + | |
| 5560 | + | |
| 5561 | + | |
| 5562 | + | |
| 5563 | + | |
5501 | 5564 |
| |
5502 | 5565 |
| |
5503 | 5566 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 |
| |
10 | 13 |
| |
11 | 14 |
| |
|
0 commit comments
Comments
(0)