Re: logical decoding and replication of sequences
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Petr Jelinek <petr.jelinek@enterprisedb.com>
Date: 2022-01-26T02:16:57Z
Lists: pgsql-hackers
Attachments
- 0001-Logical-decoding-of-sequences-20220126.patch (text/x-patch) patch 0001
- 0002-Add-support-for-decoding-sequences-to-test_-20220126.patch (text/x-patch) patch 0002
- 0003-Add-support-for-decoding-sequences-to-built-20220126.patch (text/x-patch) patch 0003
Hi, Here's a rebased version of the patch series. I decided to go back to the version from 2021/12/14, which does not include the changes to WAL logging. So this has the same issue with nextval() now waiting for WAL flush (and/or sync replica), as demonstrated by occasional failures of the TAP test in 0003, but my reasoning is this: 1) This is a preexisting issue, affecting sequences in general. It's not related to this patch, really. The fix will be independent of this, and there's little reason to block the decoding until that happens. 2) We've discussed a couple ways to fix this in [1] - logging individual sequence increments, flushing everything right away, waiting for page LSN, etc. My opinion is we'll use some form of waiting for page LSN, but no matter what fix we use it'll have almost no impact on this patch. There might be minor changes to the test, but that's about it. 3) There are ways to stabilize the tests even without that - it's enough to generate a little bit of WAL / get XID, not just nextval(). But that's only for 0003 which I don't intend to commit yet, and 0001/0002 have no problems at all. regards [1] https://www.postgresql.org/message-id/712cad46-a9c8-1389-aef8-faf0203c9be9@enterprisedb.com -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Fix cache invalidation bug in recovery_prefetch.
- d0d934490020 15.0 landed
- 932b01630095 16.0 landed
-
Revert "Logical decoding of sequences"
- 2c7ea57e56ca 15.0 landed
-
Minor improvements in sequence decoding code and docs
- 05843b1aa49d 15.0 landed
-
Handle sequences in preprocess_pubobj_list
- 002c9dd97a0c 15.0 landed
-
Update tab-completion for CREATE PUBLICATION with sequences
- 2d2232933b02 15.0 landed
-
Add decoding of sequences to built-in replication
- 75b1521dae1f 15.0 landed
-
Stabilize test_decoding touching with sequences
- a180c2b34de0 15.0 landed
-
Call ReorderBufferProcessXid from sequence_decode
- d5ed9da41d96 15.0 landed
-
Add decoding of sequences to test_decoding
- 80901b32913f 15.0 landed
-
Replace Test::More plans with done_testing
- 549ec201d613 15.0 cited
-
Logical decoding of sequences
- 0da92dc530c9 15.0 landed
-
Respect permissions within logical replication.
- a2ab9c06ea15 15.0 cited