- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit7c99dc5

Amit Kapila
Fix ALTER SUBSCRIPTION ... SET PUBLICATION ... command.
The problem is that ALTER SUBSCRIPTION ... SET PUBLICATION ... will leadto restarting of apply worker and after the restart, the apply worker willuse the existing slot and replication origin corresponding to thesubscription. Now, it is possible that before the restart, the origin hasnot been updated, and the WAL start location points to a location beforewhere PUBLICATION pointed to by SET PUBLICATION doesn't exist, and thatcan lead to an error like: "ERROR: publication "pub1" does not exist".Once this error occurs, apply worker will never be able to proceed andwill always return the same error.We decided to skip loading the publication if the publication does notexist. The publication is loaded later and updates the relation entry whenthe publication gets created.We decided not to backpatch this as this is a behaviour change, and we don'tsee field reports. This problem has been found by intermittent buildfarmfailures.Author: vignesh C <vignesh21@gmail.com>Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>Discussion:https://postgr.es/m/flat/CALDaNm0-n8FGAorM%2BbTxkzn%2BAOUyx5%3DL_XmnvOP6T24%2B-NcBKg%40mail.gmail.comDiscussion:https://postgr.es/m/CAA4eK1+T-ETXeRM4DHWzGxBpKafLCp__5bPA_QZfFQp7-0wj4Q@mail.gmail.com1 parent4618045 commit7c99dc5
File tree
2 files changed
+57
-3
lines changed- src
- backend/replication/pgoutput
- test/subscription/t
2 files changed
+57
-3
lines changedLines changed: 14 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1764 | 1764 |
| |
1765 | 1765 |
| |
1766 | 1766 |
| |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
1767 | 1772 |
| |
1768 | 1773 |
| |
1769 | 1774 |
| |
| |||
1774 | 1779 |
| |
1775 | 1780 |
| |
1776 | 1781 |
| |
1777 |
| - | |
| 1782 | + | |
1778 | 1783 |
| |
1779 |
| - | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1780 | 1792 |
| |
1781 | 1793 |
| |
1782 | 1794 |
| |
|
Lines changed: 43 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 |
| |
6 | 8 |
| |
7 | 9 |
| |
| |||
80 | 82 |
| |
81 | 83 |
| |
82 | 84 |
| |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
83 | 125 |
| |
84 | 126 |
| |
85 | 127 |
| |
|
0 commit comments
Comments
(0)