Обсуждение: Determining current WAL

Поиск
Список
Период
Сортировка

Determining current WAL

От
thomas.revell@powerconv.alstom.com
Дата:
Hi,

I'm currently looking at using WAL / PITR backups for a database, and I
need to keep the backups as up to date as possible. As such, keeping a
copy of the current WAL file, as suggested in the manual, would seem to be
a very good idea. I'm slightly confused, though, about which file is the
current. I had assumed that it would always be the highest numbered, but
it seems that in some cases this is not always dated as the most recently
modified (this seems to occur after taking a full backup during some of my
test cases). My question, then is whether I was correct in my original
assumption, or whether the current WAL is in fact the most recently
modified.

Apologies if I'm missing something really obvious, but I've searched the
mail archives and the web and haven't been able to find anything relevant.

Regards

Thomas Revell


:.________________
CONFIDENTIALITY : This  e-mail  and  any attachments are confidential and
may be privileged. If  you are not a named recipient, please notify the
sender immediately and do not disclose the contents to another person, use
it for any purpose or store or copy the information in any medium.

Re: Determining current WAL

От
Tom Lane
Дата:
thomas.revell@powerconv.alstom.com writes:
> I'm currently looking at using WAL / PITR backups for a database, and I
> need to keep the backups as up to date as possible. As such, keeping a
> copy of the current WAL file, as suggested in the manual, would seem to be
> a very good idea. I'm slightly confused, though, about which file is the
> current. I had assumed that it would always be the highest numbered,

No.  Go with the most-recently-modified.  Segment files are normally
created (or renamed into place) in advance of being needed.

There should probably be a cleaner/more reliable way of identifying
the active file ...

            regards, tom lane

Re: Determining current WAL

От
thomas.revell@powerconv.alstom.com
Дата:
OK, thanks.









thomas.revell@powerconv.alstom.com writes:
> I'm currently looking at using WAL / PITR backups for a database, and I
> need to keep the backups as up to date as possible. As such, keeping a
> copy of the current WAL file, as suggested in the manual, would seem to
be
> a very good idea. I'm slightly confused, though, about which file is the

> current. I had assumed that it would always be the highest numbered,

No.  Go with the most-recently-modified.  Segment files are normally
created (or renamed into place) in advance of being needed.

There should probably be a cleaner/more reliable way of identifying
the active file ...

                                                 regards, tom lane




:._______________
CONFIDENTIALITY : This  e-mail  and  any attachments are confidential and
may be privileged. If  you are not a named recipient, please notify the
sender immediately and do not disclose the contents to another person, use
it for any purpose or store or copy the information in any medium.


Re: Determining current WAL

От
Gaetano Mendola
Дата:
Tom Lane wrote:
> thomas.revell@powerconv.alstom.com writes:
>
>>I'm currently looking at using WAL / PITR backups for a database, and I
>>need to keep the backups as up to date as possible. As such, keeping a
>>copy of the current WAL file, as suggested in the manual, would seem to be
>>a very good idea. I'm slightly confused, though, about which file is the
>>current. I had assumed that it would always be the highest numbered,
>
>
> No.  Go with the most-recently-modified.  Segment files are normally
> created (or renamed into place) in advance of being needed.
>
> There should probably be a cleaner/more reliable way of identifying
> the active file ...

Yes it was discussed during the attempt to create the log delivery to
another server in "replay" state, if the master was not responding then
it was usefull have a way to identify the active wal segment, at the time
I was identifing the current wall the last created one


Regards
Gaetano Mendola