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

Amit Kapila
Add support for streaming to built-in logical replication.
To add support for streaming of in-progress transactions into thebuilt-in logical replication, we need to do three things:* Extend the logical replication protocol, so identify in-progresstransactions, and allow adding additional bits of information (e.g.XID of subtransactions).* Modify the output plugin (pgoutput) to implement the new streamAPI callbacks, by leveraging the extended replication protocol.* Modify the replication apply worker, to properly handle streamedin-progress transaction by spilling the data to disk and thenreplaying them on commit.We however must explicitly disable streaming replication duringreplication slot creation, even if the plugin supports it. Wedon't need to replicate the changes accumulated during this phase,and moreover we don't have a replication connection open so wedon't have where to send the data anyway.Author: Tomas Vondra, Dilip Kumar and Amit KapilaReviewed-by: Amit Kapila, Kuntal Ghosh and Ajin CherianTested-by: Neha Sharma, Mahendra Singh Thalor and Ajin CherianDiscussion:https://postgr.es/m/688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com1 parent66f1630 commit4648243
File tree
23 files changed
+1766
-74
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- postmaster
- replication
- libpqwalreceiver
- logical
- pgoutput
- bin
- pg_dump
- psql
- include
- catalog
- replication
- test
- regress
- expected
- sql
- subscription/t
- tools/pgindent
23 files changed
+1766
-74
lines changedLines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1509 | 1509 |
| |
1510 | 1510 |
| |
1511 | 1511 |
| |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
1512 | 1528 |
| |
1513 | 1529 |
| |
1514 | 1530 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
165 | 165 |
| |
166 | 166 |
| |
167 | 167 |
| |
168 |
| - | |
169 |
| - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
170 | 171 |
| |
171 | 172 |
| |
172 | 173 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
231 | 242 |
| |
232 | 243 |
| |
233 | 244 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
| 69 | + | |
69 | 70 |
| |
70 | 71 |
| |
71 | 72 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1128 | 1128 |
| |
1129 | 1129 |
| |
1130 | 1130 |
| |
1131 |
| - | |
| 1131 | + | |
1132 | 1132 |
| |
1133 | 1133 |
| |
1134 | 1134 |
| |
|
Lines changed: 39 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
66 |
| - | |
| 66 | + | |
| 67 | + | |
67 | 68 |
| |
68 | 69 |
| |
69 | 70 |
| |
| |||
99 | 100 |
| |
100 | 101 |
| |
101 | 102 |
| |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
102 | 108 |
| |
103 | 109 |
| |
104 | 110 |
| |
| |||
194 | 200 |
| |
195 | 201 |
| |
196 | 202 |
| |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
197 | 213 |
| |
198 | 214 |
| |
199 | 215 |
| |
| |||
337 | 353 |
| |
338 | 354 |
| |
339 | 355 |
| |
| 356 | + | |
| 357 | + | |
340 | 358 |
| |
341 | 359 |
| |
342 | 360 |
| |
| |||
360 | 378 |
| |
361 | 379 |
| |
362 | 380 |
| |
363 |
| - | |
| 381 | + | |
| 382 | + | |
364 | 383 |
| |
365 | 384 |
| |
366 | 385 |
| |
| |||
427 | 446 |
| |
428 | 447 |
| |
429 | 448 |
| |
| 449 | + | |
430 | 450 |
| |
431 | 451 |
| |
432 | 452 |
| |
| |||
698 | 718 |
| |
699 | 719 |
| |
700 | 720 |
| |
| 721 | + | |
| 722 | + | |
701 | 723 |
| |
702 | 724 |
| |
703 | 725 |
| |
| |||
707 | 729 |
| |
708 | 730 |
| |
709 | 731 |
| |
710 |
| - | |
| 732 | + | |
| 733 | + | |
711 | 734 |
| |
712 | 735 |
| |
713 | 736 |
| |
| |||
739 | 762 |
| |
740 | 763 |
| |
741 | 764 |
| |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
742 | 772 |
| |
743 | 773 |
| |
744 | 774 |
| |
| |||
756 | 786 |
| |
757 | 787 |
| |
758 | 788 |
| |
759 |
| - | |
| 789 | + | |
| 790 | + | |
760 | 791 |
| |
761 | 792 |
| |
762 | 793 |
| |
| |||
800 | 831 |
| |
801 | 832 |
| |
802 | 833 |
| |
803 |
| - | |
804 |
| - | |
| 834 | + | |
| 835 | + | |
805 | 836 |
| |
806 | 837 |
| |
807 | 838 |
| |
| |||
843 | 874 |
| |
844 | 875 |
| |
845 | 876 |
| |
846 |
| - | |
| 877 | + | |
| 878 | + | |
847 | 879 |
| |
848 | 880 |
| |
849 | 881 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4141 | 4141 |
| |
4142 | 4142 |
| |
4143 | 4143 |
| |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
4144 | 4156 |
| |
4145 | 4157 |
| |
4146 | 4158 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
425 | 425 |
| |
426 | 426 |
| |
427 | 427 |
| |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
428 | 432 |
| |
429 | 433 |
| |
430 | 434 |
| |
|
0 commit comments
Comments
(0)