Re: During promotion, new master tries to archive same segment twice - Mailing list pgsql-general

From David Steele
Subject Re: During promotion, new master tries to archive same segment twice
Date
Msg-id 11b405a6-2176-9510-bf5b-ea9c0e860635@pgmasters.net
Whole thread Raw
In response to During promotion, new master tries to archive same segment twice  ("Phil Endecott" <spam_from_pgsql_lists@chezphil.org>)
Responses Re: During promotion, new master tries to archive same segmenttwice
List pgsql-general
Hi Phil,

On 8/15/18 4:25 PM, Phil Endecott wrote:
> 
> Questions:
> 
> - Can all of this be blamed on the failure of the first attempt 
> to promote due to the wrong permissions on recovery.conf?

Yes, it looks that way.

> - Should my archive_command detect the case where it is asked to 
> write the same file again with the same contents, and report 
> success in that case?

Yes.  pgBackRest has done this for years and it saves a *lot* of headaches.

> - Is this a bug?

I don't think so.  There are a number of cases where the same WAL
segment can be pushed more than once, especially after failures where
Postgres is not sure that the command completed.  The archive command
should handle this gracefully.

Regards,
-- 
-David
david@pgmasters.net


pgsql-general by date:

Previous
From: Don Seiler
Date:
Subject: Re: Odd Row Estimates in Query Plan (rows=75)
Next
From: Adrian Klaver
Date:
Subject: Re: During promotion, new master tries to archive same segment twice