Re: logical decoding and replication of sequences

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Petr Jelinek <petr(dot)jelinek(at)enterprisedb(dot)com>
Subject: Re: logical decoding and replication of sequences
Date: 2021-12-22 15:40:17
Message-ID: de7e9856-b49f-67bd-2ade-447f2d2cbc4b@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-WAL-log-individual-sequence-fetches-20211222.patch text/x-patch 1.9 KB
0002-Logical-decoding-of-sequences-20211222.patch text/x-patch 45.1 KB
0003-Add-support-for-decoding-sequences-to-test_-20211222.patch text/x-patch 20.3 KB
0004-tweak-test_decoding-tests-20211222.patch text/x-patch 6.5 KB
0005-Add-support-for-decoding-sequences-to-built-20211222.patch text/x-patch 76.8 KB
0006-update-TAP-tests-20211222.patch text/x-patch 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-12-22 15:42:44 Re: Clarifying/rationalizing Vars' varno/varattno/varnoold/varoattno
Previous Message Fabrice Chapuis 2021-12-22 15:20:03 Re: Logical replication timeout problem