GetStandbyFlushRecPtr() : OUT param is not optional like elsewhere.

From: Amul Sul <sulamul(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: GetStandbyFlushRecPtr() : OUT param is not optional like elsewhere.
Date: 2022-07-20 11:08:17
Message-ID: CAAJ_b945_0L4rMsQeE4h0ArHJMc+ASJJs_h3jXdas5eTtNqowg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

If you look at GetFlushRecPtr() function the OUT parameter for
TimeLineID is optional and this is not only one, see
GetWalRcvFlushRecPtr(), GetXLogReplayRecPtr(), etc.

I think we have missed that for GetStandbyFlushRecPtr(), to be
inlined, we should change this as follow:

--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -3156,7 +3156,8 @@ GetStandbyFlushRecPtr(TimeLineID *tli)
receivePtr = GetWalRcvFlushRecPtr(NULL, &receiveTLI);
replayPtr = GetXLogReplayRecPtr(&replayTLI);

- *tli = replayTLI;
+ if (tli)
+ *tli = replayTLI;

Thoughts?
--
Regards,
Amul Sul
EDB: http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2022-07-20 11:26:47 Re: making relfilenodes 56 bits
Previous Message Amit Kapila 2022-07-20 11:06:13 Re: Collect ObjectAddress for ATTACH DETACH PARTITION to use in event trigger