mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-15 05:03:23 +02:00
When implementing a replication solution ontop of logical decoding, two
related problems exist:
* How to safely keep track of replication progress
* How to change replication behavior, based on the origin of a row;
e.g. to avoid loops in bi-directional replication setups
The solution to these problems, as implemented here, consist out of
three parts:
1) 'replication origins', which identify nodes in a replication setup.
2) 'replication progress tracking', which remembers, for each
replication origin, how far replay has progressed in a efficient and
crash safe manner.
3) The ability to filter out changes performed on the behest of a
replication origin during logical decoding; this allows complex
replication topologies. E.g. by filtering all replayed changes out.
Most of this could also be implemented in "userspace", e.g. by inserting
additional rows contain origin information, but that ends up being much
less efficient and more complicated. We don't want to require various
replication solutions to reimplement logic for this independently. The
infrastructure is intended to be generic enough to be reusable.
This infrastructure also replaces the 'nodeid' infrastructure of commit
timestamps. It is intended to provide all the former capabilities,
except that there's only 2^16 different origins; but now they integrate
with logical decoding. Additionally more functionality is accessible via
SQL. Since the commit timestamp infrastructure has also been introduced
in 9.5 (commit
|
||
---|---|---|
.. | ||
binary.out | ||
concurrent_ddl_dml.out | ||
ddl.out | ||
decoding_in_xact.out | ||
decoding_into_rel.out | ||
delayed_startup.out | ||
mxact.out | ||
ondisk_startup.out | ||
permissions.out | ||
prepared.out | ||
replorigin.out | ||
rewrite.out | ||
toast.out |