Re: Local visibility with logical decoding

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Local visibility with logical decoding
Date: 2020-07-20 17:10:55
Message-ID: CAL9smLDKG+mxkxUyAvD5qMZMkb_EbGQyDryJyZUCrKo-QSxO8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 20, 2020 at 7:36 PM Antonin Houska <ah(at)cybertec(dot)at> wrote:

> Marko Tiikkaja <marko(at)joh(dot)to> wrote:
>
> > It appears that when logical decoding sends out the data from the output
> > plugin, it is not guaranteed that the decoded transaction's effects are
> > visible on the source server. Is this the way it's supposed to work?
>
> Can you please share the test that indicates this behavior? As far as I
> understand, the transaction must have been committed before the output
> plugin
> starts to receive the changes.
>

I don't have a reliable test program, but you can reproduce quite easily
with test_decoding if you put a breakpoint before the SyncRepWaitForLSN()
call in src/backend/access/transam/xact.c. pg_logicalrecv will see the
changes while the session is sitting on the breakpoint, and not finishing
its commit.

-marko

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2020-07-20 17:25:39 Re: Default setting for enable_hashagg_disk
Previous Message Alvaro Herrera 2020-07-20 16:44:39 Re: Allow ERROR from heap_prepare_freeze_tuple to be downgraded to WARNING