Re: Command to prune archive at restartpoints - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Command to prune archive at restartpoints
Date
Msg-id 4C1105C5.20907@dunslane.net
Whole thread Raw
In response to Re: Command to prune archive at restartpoints  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers

Heikki Linnakangas wrote:
> On 10/06/10 17:38, Andrew Dunstan wrote:
>> I think my logic needs a tiny piece of adjustment, to ignore the
>> timeline segment of the file name.
>
> I'm not sure you should ignore it. Presumably anything in an older 
> timeline is indeed not required anymore and can be removed, and 
> anything in a newer timeline... how did it get there? Seems safer not 
> remove it.
>

Well, I was just following the logic in pg-standby.c:
               /*                * We ignore the timeline part of the XLOG segment 
identifiers                * in deciding whether a segment is still needed.  This                * ensures that we
won'tprematurely remove a segment from a                * parent timeline. We could probably be a little more
    * proactive about removing segments of non-parent 
 
timelines,                * but that would be a whole lot more complicated.                *                * We use
thealphanumeric sorting property of the filenames                * to decide which ones are earlier than the
   * exclusiveCleanupFileName file. Note that this means files                * are not removed in the order they were
originally
 
written,                * in case this worries you.                */               if (strlen(xlde->d_name) ==
XLOG_DATA_FNAME_LEN&&                   strspn(xlde->d_name, "0123456789ABCDEF")                       ==
XLOG_DATA_FNAME_LEN&&                 strcmp(xlde->d_name + 8, exclusiveCleanupFileName + 8) 
 
< 0)


cheers

andrew



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Error with GIT Repository
Next
From: Heikki Linnakangas
Date:
Subject: Re: fix use of posix_fadvise in xlog.c