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

2022-07-20 Thread Amul Sul
Thanks Aleksander and Álvaro for your inputs. I understand this change is not making any improvement to the current code. I was a bit concerned regarding the design and consistency of the function that exists for the server in recovery and for the server that is not in recovery. I was trying to

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

2022-07-20 Thread Alvaro Herrera
Hello On 2022-Jul-20, Amul Sul wrote: > 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

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

2022-07-20 Thread Aleksander Alekseev
Hi Amul, > - *tli = replayTLI; > + if (tli) > + *tli = replayTLI; I would guess the difference here is that GetStandbyFlushRecPtr is static. It is used 3 times in walsender.c and in all cases the argument can't be NULL. So I'm not certain what we will gain from the proposed check. --

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

2022-07-20 Thread Amul Sul
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: ---