public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Koen De Groote <[email protected]>
To: PostgreSQL General <[email protected]>
Subject: Re: On a subscriber, why is last_msg_send_time in pg_stat_subscription sometimes null?
Date: Fri, 23 Aug 2024 08:02:56 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAGbX52H8dDW8nVC8Zxg0-HFY58fAXd93XuxC83_DPHARZkpepw@mail.gmail.com>
References: <CAGbX52H8dDW8nVC8Zxg0-HFY58fAXd93XuxC83_DPHARZkpepw@mail.gmail.com>

On 8/23/24 07:33, Koen De Groote wrote:
> I'm running this query:
> 
> SELECT subname, received_lsn, latest_end_lsn,
> last_msg_send_time, last_msg_receipt_time
> FROM pg_catalog.pg_stat_subscription;
> 
> And "last_msg_send_time" will sometimes be null. All I can find in the 
> documentation is that this value represents: "Send time of last message 
> received from origin WAL sender; NULL for parallel apply workers"
> 
> But I have no context for what parallel apply workers are or why they 
> are NULL sometimes and other times not. >
> Can anyone explain?

The source has that information:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/replication/logical/applypa...

The top part explains the process.

As to the time:

/*
  * There are three fields in each message received by the parallel apply
  * worker: start_lsn, end_lsn and send_time. Because we have updated these
  * statistics in the leader apply worker, we can ignore these fields in the
  * parallel apply worker (see function LogicalRepApplyLoop).
  */

> 
> Regards,
> Koen De Groote

-- 
Adrian Klaver
[email protected]







view thread (4+ messages)  latest in thread

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: On a subscriber, why is last_msg_send_time in pg_stat_subscription sometimes null?
  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