forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5a07966
committed
Fix row filters with multiple publications
When publishing changes through a artition root, we should use the rowfilter for the top-most ancestor. The relation may be added to multiplepublications, using different ancestors, and52e4f0c handled thisincorrectly. Withc91f71b we find the correct top-most ancestor, butthe code tried to fetch the row filter from all publications, includingthose using a different ancestor etc. No row filter can be found forsuch publications, which was treated as replicating all rows.Similarly toc91f71b, this seems to be a rare issue in practice. Itrequires multiple publications including the same partitioned relation,through different ancestors.Fixed by only passing publications containing the top-most ancestor topgoutput_row_filter_init(), so that treating a missing row filter asreplicating all rows is correct.Report and fix by me, test case by Hou zj. Reviews and improvements byAmit Kapila.Author: Tomas Vondra, Hou zj, Amit KapilaReviewed-by: Amit Kapila, Hou zjDiscussion:https://postgr.es/m/d26d24dd-2fab-3c48-0162-2b7f84a9c893%40enterprisedb.com1 parenta9b7e92 commit5a07966
File tree
2 files changed
+67
-6
lines changed- src
- backend/replication/pgoutput
- test/subscription/t
2 files changed
+67
-6
lines changedLines changed: 21 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1890 | 1890 |
| |
1891 | 1891 |
| |
1892 | 1892 |
| |
1893 |
| - | |
1894 |
| - | |
1895 | 1893 |
| |
1896 | 1894 |
| |
1897 | 1895 |
| |
| |||
1902 | 1900 |
| |
1903 | 1901 |
| |
1904 | 1902 |
| |
1905 |
| - | |
1906 |
| - | |
1907 |
| - | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
1908 | 1924 |
| |
1909 | 1925 |
| |
1910 | 1926 |
| |
|
Lines changed: 46 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
237 | 237 |
| |
238 | 238 |
| |
239 | 239 |
| |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
240 | 245 |
| |
241 | 246 |
| |
242 | 247 |
| |
| |||
283 | 288 |
| |
284 | 289 |
| |
285 | 290 |
| |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
286 | 296 |
| |
287 | 297 |
| |
288 | 298 |
| |
| |||
330 | 340 |
| |
331 | 341 |
| |
332 | 342 |
| |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
333 | 352 |
| |
334 | 353 |
| |
335 | 354 |
| |
| |||
376 | 395 |
| |
377 | 396 |
| |
378 | 397 |
| |
379 |
| - | |
| 398 | + | |
380 | 399 |
| |
381 | 400 |
| |
382 | 401 |
| |
| |||
534 | 553 |
| |
535 | 554 |
| |
536 | 555 |
| |
| 556 | + | |
| 557 | + | |
537 | 558 |
| |
538 | 559 |
| |
539 | 560 |
| |
| |||
688 | 709 |
| |
689 | 710 |
| |
690 | 711 |
| |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
691 | 736 |
| |
692 | 737 |
| |
693 | 738 |
| |
|
0 commit comments
Comments
(0)