Re: BUG #15402: Hot standby server with archive_mode=on keeps initial WAL segments

TAKATSUKA Haruka <harukat@sraoss.co.jp>

From: TAKATSUKA Haruka <harukat@sraoss.co.jp>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2018-09-26T05:12:36Z
Lists: pgsql-bugs
Hello, Michael

> > > Though I understand renaming the .ready to .done manually can clean it,
> > > I would like to fix the server code like the following patch.
> > > I'd appreciate if you would consider that.
> > 
> > Your patch looks incorrect to me to begin with...  What if archive_mode
> > is switched from "on" to "always" back-and-forth and there some of the
> > past segments which should be archived are not?

I understand this scenario.
 (1) archive_mode=always and archvie_command failure 
 (2) .ready files are building up
 (3) switch to archive_mode=on
 (4) WAL segments with .ready status are swept
 (5) switch to archive_mode=always
     some WAL segments are lost.

I think is it natural that some segments are not archived when you 
switch archive_mode back-and-forth.

I also think a fix to prevent generating .ready file at hot standby
server in this case is better. I don't have a concrete idea to do so now.

Thanks,
Haruka Takatsuka 



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix WAL recycling on standbys depending on archive_mode