public inbox for [email protected]  
help / color / mirror / Atom feed
From: Subramanian,Ramachandran <[email protected]>
To: Laurenz Albe <[email protected]>
To: [email protected] <[email protected]>
Subject: AW: AW: Replication Testing- How to introduce a Lag
Date: Sat, 21 Mar 2026 07:49:32 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

> how can the last replayed be more than the last received?

It shouldn't be - but I don't understand your script, in particular which query is issused on which server.

[Subramanian,Ramachandran IT-md-db] 
100% sure that I have screwed up some variables in my script

Look at "pg_stat_replication" on the primary server.

[Subramanian,Ramachandran IT-md-db] 

Thank you so much!!  So I do not have to go across multiple tables to collect the information. 

It is all there in one table pg_stat_replication at the Primary server and we can look at it from A) Primary and also from B) Stand-by !! 

If I just look at the write_lag columns, it would give me a good idea of the situation --  Is my understanding correct ?

LG

Ram


Details from the Source (Remote Primary)
----------------------------------------------------------

pid   | usesysid |  usename   | application_name | client_addr | client_hostname | client_port |         backend_start
  | backend_xmin |   state   |  sent_lsn  | write_lsn  | flush_lsn  | replay_lsn |    write_lag    |    flush_lag    |   replay
_lag    | sync_priority | sync_state |          reply_time
--------+----------+------------+------------------+-------------+-----------------+-------------+-----------------------------
--+--------------+-----------+------------+------------+------------+------------+-----------------+-----------------+---------
--------+---------------+------------+-------------------------------
 188833 |    25200 | replicator | walreceiver      | 10.10.10.10  |                 |       43330 | 2026-03-21 08:11:37.010895+0
1 |              | streaming | 0/49072590 | 0/49072590 | 0/49072590 | 0/49042F98 | 00:00:00.000463 | 00:00:00.001693 | 00:00:27
.042262 |             0 | async      | 2026-03-21 08:12:19.239535+01
(1 row)

The same details from the Local Stand-by Server -- They match !!!!
----------------------------------------------------------------------------------

pg_last_wal_receive_lsn
-------------------------
 0/49072590
(1 row)

 pg_last_wal_replay_lsn
------------------------
 0/49042F98
(1 row)


Freundliche Grüße

i. A. Ramachandran Subramanian
Zentralbereich Informationstechnologie

Alte Leipziger Lebensversicherung a.G.


Hallesche Krankenversicherung a.G.





Alte Leipziger Lebensversicherung a.G., Alte Leipziger-Platz 1, 61440 Oberursel
Vors. des Aufsichtsrats: Dr. Walter Botermann · Vorstand: Christoph Bohn (Vors.), Dr. Jürgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexander Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcsek
Sitz Oberursel (Taunus) · Rechtsform VVaG · Amtsgericht Bad Homburg v. d. H. HRB 1583 · USt.-IdNr. DE 114106814





 
Hallesche Krankenversicherung a.G.,  Löffelstraße 34-38, 70597 Stuttgart
Vors. des Aufsichtsrats: Dr. Walter Botermann · Vorstand: Christoph Bohn (Vors.), Dr. Jürgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexander Mayer, Christian Pape,
Wiltrud Pekarek, Udo Wilcsek
Sitz Stuttgart · Rechtsform VVaG · Amtsgericht Stuttgart HRB 2686 · USt.-IdNr. DE 147802285
Beiträge zu privaten Kranken- und Pflegekrankenversicherungen unterliegen nicht der Versicherungsteuer (§ 4 Nr. 5 VersStG) · Versicherungsleistungen sowie Umsätze aus Versicherungsvertreter-/Maklertätigkeiten sind umsatzsteuerfrei
 



 
Die Pflichtangaben der ALH Gruppe gemäß § 35a GmbHG bzw. § 80 AktG finden Sie hier: https://www.alte-leipziger.de/impressum 





______________________

ALH Gruppe
Alte Leipziger-Platz 1, 61440 Oberursel
Tel.: +49 (6171) 66-4882
Fax: +49 (6171) 66-800-4882
E-Mail: [email protected]
www.alte-leipziger.de
www.hallesche.de



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: AW: AW: Replication Testing- How to introduce a Lag
  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