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