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: 2021-12-22T15:40:17Z
Lists: pgsql-hackers

Attachments

Hi,

Here's an updated version of the patch series. The primary change is 
tweaking the WAL-logging of sequences modified per [1]. This changes 
test output in test_decoding and built-in replication patches, and to 
make it clearer I left the changes in separate patches.

Assuming the WAL logging changes are acceptable, that resolves the data 
loss issue.

I'm wondering what to do about changes with is_called=false, i.e. 
changes generated by ALTER SEQUENCE etc. The current patch does decode 
them and passes them to the output plugin, but I'm starting to think 
that may not be the right behavior - if we haven't generated any data 
from the sequence, there's no point in replicating that, I think.


regards


[1] 
https://www.postgresql.org/message-id/712cad46-a9c8-1389-aef8-faf0203c9be9%40enterprisedb.com

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Commits

  1. Fix cache invalidation bug in recovery_prefetch.

  2. Revert "Logical decoding of sequences"

  3. Minor improvements in sequence decoding code and docs

  4. Handle sequences in preprocess_pubobj_list

  5. Update tab-completion for CREATE PUBLICATION with sequences

  6. Add decoding of sequences to built-in replication

  7. Stabilize test_decoding touching with sequences

  8. Call ReorderBufferProcessXid from sequence_decode

  9. Add decoding of sequences to test_decoding

  10. Replace Test::More plans with done_testing

  11. Logical decoding of sequences

  12. Respect permissions within logical replication.