Re: Possible missing segments in archiving on standby - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Possible missing segments in archiving on standby
Date
Msg-id 19d4a303-6ee3-444f-7c99-e78dde1c5a94@oss.nttdata.com
Whole thread Raw
In response to Re: Possible missing segments in archiving on standby  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Possible missing segments in archiving on standby
List pgsql-hackers

On 2021/09/01 12:12, Kyotaro Horiguchi wrote:
> Putting aside the issue C, it would work as far as recovery is not
> paused or delayed.  Although simply doing that means we run additional
> and a bit) wasteful XLogArchiveCheckDone() in most cases, It's hard to
> imagine moving the responsibility to notify a finished segment from
> walsender (writer side) to startup (reader side).

You mean walreceiver, not walsender?

I was thinking to apply my latest patch, to address the issue A and C.
So walreceiver is still basically responsible to create .ready file.
Also regarding the issue B, I was thinking to make the startup process
call XLogArchiveCheckDone() or something only when it finds
XLOG_SWITCH record. Thought?


> In the first place A and B happens only at termination or crash of
> walsender so there's no fragility in checking only the previous
> segment at start of walsender.  After a bit thought I noticed that we
> don't need to do that in the wal-writing loop. And I noticed that we
> need to consider timeline transitions while calculating the previous
> segment.  Even though missing-notification at a timeline-switch
> doesn't happen unless walsender is killed hard for example by a
> sigkill or a power cut, though.

What happens if the server is promoted before that walreceiver is invoked?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Multi-Column List Partitioning
Next
From: "tanghy.fnst@fujitsu.com"
Date:
Subject: RE: Added schema level support for publication.