public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andres Freund <[email protected]>
To: Tejasvi Kashi <[email protected]>
Cc: [email protected]
Subject: Re: SyncRepWaitForLSN waits for XLogFlush?
Date: Wed, 24 May 2023 14:33:10 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJWWkarvpZct_oPnO8RxhW6=gJVtVP3phP6J-d2Yh0sD9vdXWw@mail.gmail.com>
References: <CAJWWkarvpZct_oPnO8RxhW6=gJVtVP3phP6J-d2Yh0sD9vdXWw@mail.gmail.com>
Hi,
On 2023-05-24 10:53:51 -0400, Tejasvi Kashi wrote:
> I was wondering if waiting for an LSN in SyncRepWaitForLSN ensures that the
> XLOG has been flushed locally up to that location before the record is
> shipped off to standbys?
No, SyncRepWaitForLSN() doesn't directly ensure that. The callers have to (and
do) call XLogFlush() separately. See e.g. the XLogFlush() call in
RecordTransactionCommit().
Note that calling SyncRepWaitForLSN() for an LSN that is not yet flushed would
not lead for data to be prematurely sent out - walsender won't send data that
hasn't yet been flushed. So a backend with such a spurious SyncRepWaitForLSN()
would just wait until the LSN is actually flushed and *then* replicated.
Any specific reason for that question?
Greetings,
Andres Freund
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: SyncRepWaitForLSN waits for XLogFlush?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox