Re: logical replication empty transactions - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: logical replication empty transactions
Date
Msg-id CAMsr+YF-Fx-X8uEsS3+G8WD5+iPx4cTX_HcJZ1L7hf7=kiOaWA@mail.gmail.com
Whole thread Raw
In response to Re: logical replication empty transactions  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: logical replication empty transactions
List pgsql-hackers
On Mon, 2 Mar 2020 at 19:26, Amit Kapila <amit.kapila16@gmail.com> wrote:

> One thing that is not clear to me is how will we advance restart_lsn
> if we don't send any empty xact in a system where there are many such
> xacts?

Same way we already do it for writes that are not replicated over
logical replication, like vacuum work etc. The upstream sends feedback
with reply-requested. The downstream replies. The upstream advances
confirmed_flush_lsn, and that lazily updates restart_lsn.

The bigger issue here is that if you don't send empty txns on logical
replication you don't get an eager, timely response from the
replica(s), which delays synchronous replication. You need to send
empty txns when synchronous replication is enabled, or instead poke
the walsender to force immediate feedback with reply requested.


-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 2ndQuadrant - PostgreSQL Solutions for the Enterprise



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Proposal: PqSendBuffer removal
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed