log wal file transfer in error logs

Started by Atul Kumarover 2 years ago5 messagesgeneral
Jump to latest
#1Atul Kumar
akumar14871@gmail.com

Hi,

I need to log all wal files that are getting transferred to all standby
servers in the postgresql error logs.

I also need to log those wal files that are being applied in standbys.

My postgres version is 12 and running on centos 7.

I am unable to understand the proper parameters in the postgresql.conf
file, please help me in achieving this.

Regards,
Atul

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Atul Kumar (#1)
Re: log wal file transfer in error logs

On Wed, 2023-10-11 at 22:15 +0530, Atul Kumar wrote:

I need to log all wal files that are getting transferred to all standby servers in the postgresql error logs.

WAL files are not transferred to standby servers...

WAL is streamed, so what would you want to log?

Yours,
Laurenz Albe

#3Atul Kumar
akumar14871@gmail.com
In reply to: Atul Kumar (#1)
Re: log wal file transfer in error logs

Yes, I meant streamed, I need to log those wal files that are getting
streamed and replayed on standby servers in error logs of primary as well
as standby servers.

So that I can cross check that whichever file is streamed has been replayed
on standby.

I need to keep a track of these wal files in db error logs.

Regard

On Wed, Oct 11, 2023 at 10:29 PM Atul Kumar <akumar14871@gmail.com> wrote:

Show quoted text

Yss, I meant streamed, I need to log those wal files that are getting
streamed and replayed on standby servers in error logs of primary as well
as standby servers.

So that I can cross check that whichever file is streamed has been
replayed on standby.

I need to keep a track of these wal files in db error logs.

Regards,
Atul

On Wed, Oct 11, 2023 at 10:21 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:

On Wed, 2023-10-11 at 22:15 +0530, Atul Kumar wrote:

I need to log all wal files that are getting transferred to all standby

servers in the postgresql error logs.

WAL files are not transferred to standby servers...

WAL is streamed, so what would you want to log?

Yours,
Laurenz Albe

#4Ron
ronljohnsonjr@gmail.com
In reply to: Atul Kumar (#3)
Re: log wal file transfer in error logs

Tables (on the primary) pg_stat_replication and (on the secondary)
pg_stat_wal_receiver do that for you.

On 10/11/23 12:50, Atul Kumar wrote:

Yes, I meant streamed, I need to log those wal files that are getting
streamed and replayed on standby servers in error logs of primary as well
as standby servers.

So that I can cross check that whichever file is streamed has been
replayed on standby.

I need to keep a track of these wal files in db error logs.

Regard

On Wed, Oct 11, 2023 at 10:29 PM Atul Kumar <akumar14871@gmail.com> wrote:

Yss, I meant streamed, I need to log those wal files that are getting
streamed and replayed on standby servers in error logs of primary as
well as standby servers.

So that I can cross check that whichever file is streamed has been
replayed on standby.

I need to keep a track of these wal files in db error logs.

Regards,
Atul

On Wed, Oct 11, 2023 at 10:21 PM Laurenz Albe
<laurenz.albe@cybertec.at> wrote:

On Wed, 2023-10-11 at 22:15 +0530, Atul Kumar wrote:

I need to log all wal files that are getting transferred to all

standby servers in the postgresql error logs.

WAL files are not transferred to standby servers...

WAL is streamed, so what would you want to log?

Yours,
Laurenz Albe

--
Born in Arizona, moved to Babylonia.

#5Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Atul Kumar (#3)
Re: log wal file transfer in error logs

On Wed, 2023-10-11 at 23:20 +0530, Atul Kumar wrote:

Yes, I meant streamed, I need to log those wal files that are getting streamed
and replayed on standby servers in error logs of primary as well as standby servers.

So that I can cross check that whichever file is streamed has been replayed on standby.

I need to keep a track of these wal files in db error logs.

I don't think you can do that, and it seems like a strange requirement to me.

Instead, you should monitor pg_stat_replication.

Yours,
Laurenz Albe