Re: logical decoding and replication of sequences
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Petr Jelinek <petr.jelinek@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-03-07T02:13:50Z
Lists: pgsql-hackers
On Tue, Mar 1, 2022 at 10:54 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Mon, Feb 28, 2022 at 5:16 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> > On Sat, Feb 12, 2022 at 6:04 AM Tomas Vondra
> > <tomas.vondra@enterprisedb.com> wrote:
> > >
> > > On 2/10/22 19:17, Tomas Vondra wrote:
> > > > I've polished & pushed the first part adding sequence decoding
> > > > infrastructure etc. Attached are the two remaining parts.
> > > >
> > > > I plan to wait a day or two and then push the test_decoding part. The
> > > > last part (for built-in replication) will need more work and maybe
> > > > rethinking the grammar etc.
> > > >
> > >
> > > I've pushed the second part, adding sequences to test_decoding.
> > >
> >
> > The test_decoding is failing randomly in the last few days. I am not
> > completely sure but they might be related to this work. The two of
> > these appears to be due to the same reason:
> > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2022-02-25%2018%3A50%3A09
> > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=locust&dt=2022-02-17%2015%3A17%3A07
> >
> > TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File:
> > "reorderbuffer.c", Line: 1173, PID: 35013)
> > 0 postgres 0x00593de0 ExceptionalCondition + 160\\0
> >
FYI, it looks like the same assertion has failed again on the same
build-farm machine [1]
>
> While reviewing the code for this, I noticed that in
> sequence_decode(), we don't call ReorderBufferProcessXid to register
> the first known lsn in WAL for the current xid. The similar functions
> logicalmsg_decode() or heap_decode() do call ReorderBufferProcessXid
> even if they decide not to queue or send the change. Is there a reason
> for not doing the same here? However, I am not able to deduce any
> scenario where lack of this will lead to such an Assertion failure.
> Any thoughts?
>
------
[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2022-03-03%2023%3A14%3A26
Kind Regards,
Peter Smith.
Fujitsu Australia
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