postgresql/src
Amit Kapila 062a844424 Avoid syncing data twice for the 'publish_via_partition_root' option.
When there are multiple publications for a subscription and one of those
publishes via the parent table by using publish_via_partition_root and the
other one directly publishes the child table, we end up copying the same
data twice during initial synchronization. The reason for this was that we
get both the parent and child tables from the publisher and try to copy
the data for both of them.

This patch extends the function pg_get_publication_tables() to take a
publication list as its input parameter. This allows us to exclude a
partition table whose ancestor is published by the same publication list.

This problem does exist in back-branches but we decide to fix it there in
a separate commit if required. The fix for back-branches requires quite
complicated changes to fetch the required table information from the
publisher as we can't update the function pg_get_publication_tables() in
back-branches. We are not sure whether we want to deviate and complicate
the code in back-branches for this problem as there are no field reports
yet.

Author: Wang wei
Reviewed-by: Peter Smith, Jacob Champion, Kuroda Hayato, Vignesh C, Osumi Takamichi, Amit Kapila
Discussion: https://postgr.es/m/OS0PR01MB57167F45D481F78CDC5986F794B99@OS0PR01MB5716.jpnprd01.prod.outlook.com
2023-03-29 10:46:58 +05:30
..
backend Avoid syncing data twice for the 'publish_via_partition_root' option. 2023-03-29 10:46:58 +05:30
bin pg_dump: Fix gzip compression of empty data 2023-03-29 02:34:48 +02:00
common Make SCRAM iteration count configurable 2023-03-27 09:46:29 +02:00
fe_utils Revert refactoring of restore command code to shell_restore.c 2023-02-06 08:28:42 +09:00
include Avoid syncing data twice for the 'publish_via_partition_root' option. 2023-03-29 10:46:58 +05:30
interfaces Make SCRAM iteration count configurable 2023-03-27 09:46:29 +02:00
makefiles meson: Make auto the default of the ssl option 2023-03-13 07:04:11 +01:00
pl Add SysCacheGetAttrNotNull for guaranteed not-null attrs 2023-03-25 22:49:33 +01:00
port Use nanosleep() to implement pg_usleep(). 2023-03-15 17:57:12 +13:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Avoid syncing data twice for the 'publish_via_partition_root' option. 2023-03-29 10:46:58 +05:30
timezone Fix outdated references to guc.c 2023-03-02 13:49:39 +01:00
tools Avoid syncing data twice for the 'publish_via_partition_root' option. 2023-03-29 10:46:58 +05:30
tutorial Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00