Re: Minimal logical decoding on standbys
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Reduce the log level in 035_standby_logical_decoding.pl.
- 3034dc56ef4b 16.0 landed
-
035_standby_logical_decoding: Add missing waits for replication
- 57411c82ce86 16.0 landed
-
For cascading replication, wake physical and logical walsenders separately
- e101dfac3a53 16.0 landed
-
Handle logical slot conflicts on standby
- 26669757b6a7 16.0 landed
-
Support invalidating replication slots due to horizon and wal_level
- be87200efd93 16.0 landed
-
Prevent use of invalidated logical slot in CreateDecodingContext()
- 4397abd0a2af 16.0 landed
-
Replace replication slot's invalidated_at LSN with an enum
- 15f8203a5975 16.0 landed
-
Pass down table relation into more index relation functions
- 61b313e47eb9 16.0 landed
-
Assert only valid flag bits are passed to visibilitymap_set()
- a88a18b1250b 16.0 landed
-
Remove unused _bt_delitems_delete() argument.
- dc43492e46c7 14.0 cited
-
Add xl_btree_delete optimization.
- d2e5e20e5711 13.0 cited
Attachments
- v28-0006-Fixing-Walsender-corner-case-with-logical-decodi.patch (text/plain) patch v28-0006
- v28-0005-Doc-changes-describing-details-about-logical-dec.patch (text/plain) patch v28-0005
- v28-0004-New-TAP-test-for-logical-decoding-on-standby.patch (text/plain) patch v28-0004
- v28-0003-Allow-logical-decoding-on-standby.patch (text/plain) patch v28-0003
- v28-0002-Handle-logical-slot-conflicts-on-standby.patch (text/plain) patch v28-0002
- v28-0001-Add-info-in-WAL-records-in-preparation-for-logic.patch (text/plain) patch v28-0001
Hi, > Hi, > Please find attached a new patch series: > > v27-0001-Add-info-in-WAL-records-in-preparation-for-logic.patch > v27-0002-Handle-logical-slot-conflicts-on-standby.patch > v27-0003-Allow-logical-decoding-on-standby.patch > v27-0004-New-TAP-test-for-logical-decoding-on-standby.patch > v27-0005-Doc-changes-describing-details-about-logical-dec.patch > v27-0006-Fixing-Walsender-corner-case-with-logical-decodi.patch > > with the previous comments addressed, means mainly: > > 1/ don't call table_open() in low-level functions in 0001: this is done with a new field "isusercatalog" in pg_index to indicate whether or not the index is linked to a table that has the storage parameter user_catalog_table set to true (we may want to make this field "invisible" though). This new field is then used in the new IndexIsAccessibleInLogicalDecoding Macro (through IndexIsUserCatalog). > > 2/ Renaming the new field generated in the xlog record (to arrange conflict handling) from "onCatalogTable" to "onCatalogAccessibleInLogicalDecoding" to avoid any confusion (see 0001). > > 3/ Making sure that "currTLI" is the current one in logical_read_xlog_page() (see 0003). > > 4/ Fixing Walsender/startup process corner case: It's done in 0006 (I thought it is better to keep the other patches purely "feature" related and to address this corner case separately to ease the review). The fix is making use of a new > > condition variable "replayedCV" so that the startup process can broadcast the walsender(s) once a replay is done. > > Remarks: > > - The new confl_active_logicalslot field added in pg_stat_database_conflicts (see 0002) is incremented only if the slot being invalidated is active (I think it makes more sense in regard to the other fields too). In all the cases (active/not active) the slot invalidation is reported in the logfile. The documentation update mentions this behavior (see 0002). > > - LogStandbySnapshot() being moved outside of the loop in ReplicationSlotReserveWal() (see 0003), is a proposal made by Andres in [1] and I think it makes sense. > > - Tap tests (see 0004) are covering: tests that the logical decoding on standby behaves correctly, conflicts, slots invalidations, standby promotion. > > > Looking forward to your feedback, > > > [1]: https://www.postgresql.org/message-id/20210406180231.qsnkyrgrm7gtxb73%40alap3.anarazel.de > Please find attached v28 (mandatory rebase due to 8018ffbf58). Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com