Re: WAL segment management on a standby - Mailing list pgsql-admin

From John Scalia
Subject Re: WAL segment management on a standby
Date
Msg-id 53C3E1AC.60704@gmail.com
Whole thread Raw
In response to Re: WAL segment management on a standby  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: WAL segment management on a standby
List pgsql-admin
Thanks Craig, I didn't know about pg_archivecleanup. (it's hard to figure out every utility when you're not given the
timeto thoroughly study the system.) 

I altered the recovery.conf per the suggestion on the documentation page for it. It does seem a little aggresive, but
I'mguessing that because all the transactions have been  
recorded from the streaming walreceiver.  If I might, I'd like to ask one final question on this matter. In looking
throughthe standby after configuring this and restarting the  
system, the log file shows a few warnings.

First, it whined about no history.0000004 file, which as the last WAL segment is 0000000030000000E00000004E, I'm
guessingthe standby thought the timeline might have been changed,  
but it was not. Then, it complained about no history.00000003 file in the archive area. This file had already been
copiedup into pg_xlog and deleted from the archive. Finally, the  
last complaint was that it couldn't find 0000000030000000E00000004F in the archive. It appears that under streaming a
standbyserver will write concurrently with the primary any  
WAL segment the primary is still generating. I say this as that missing WAL segment ("...4F") was already in the
pg_xlogdirectory, but it hadn't yet made it into the archive area.  
Eventually, 10 minutes later, 4F did appear in the archive. Is my interpretation here correct, that a standby will
concurrentlywrite a WAL segment in streaming replication mode? 

I just want to be able to explain this thoroughly to my QA folks.
--
Jay

On 7/13/2014 10:18 PM, Craig Ringer wrote:
> On 07/12/2014 12:49 AM, John Scalia wrote:
>> Again, thanks to all to have assisted me with getting the WAL segments
>> to both my standby servers. Everything with that is now working quite
>> well. I do have a related followup question, however. On these standby's
>> nothing is built in to manage those WAL segments in the archive
>> directory. Thus, that directory can grow to the point where it fills up
>> the disk rather quickly. Any good strategies for dealing with the WAL
>> segments that get put in there. Do I really need them after postgresql
>> has copied them up into the pg_xlog directory? If so, how far back
>> should I keep them? Yes, I know about keeping everything between
>> backups. So, if my directory looks like:
>>
>> 00000000300000000C000000A1
>> 00000000300000000C000000A2
>> 00000000300000000C000000A3
>> 00000000300000000C000000A3.backup
>> 00000000300000000C000000A4
>>
>> Could I safely delete the *A1, *A2, and maybe even the *A3 files?
> Take a look at the pg_archivecleanup tool.
>
> You might also want to look at PgBarman to automate this.
>
>



pgsql-admin by date:

Previous
From: "liuyuanyuan"
Date:
Subject: 答复: [ADMIN] sql to grant privilege on sequence
Next
From: Guillaume Lelarge
Date:
Subject: Re: 答复: [ADMIN] sql to grant privilege on sequence