Re: pg_xlog - files are guaranteed to be sequentialy named? - Mailing list pgsql-general

From Frank Wittig
Subject Re: pg_xlog - files are guaranteed to be sequentialy named?
Date
Msg-id 467047F4.6020907@weisshuhn.de
Whole thread Raw
In response to Re: pg_xlog - files are guaranteed to be sequentialy named?  (Frank Wittig <fw@weisshuhn.de>)
Responses Re: pg_xlog - files are guaranteed to be sequentialy named?  (Johannes Konert <jkonert@t3go.de>)
Re: pg_xlog - files are guaranteed to be sequentialynamed?  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-general
Frank Wittig schrieb:

> 24 Hex digits means 24^16 unique file names. Assuming your server saves
> a WAL file each second (you should review your config it it does) it
> takes (24^16)/(60*60*24*365)=3.84214066×10^14 years to reach the upper
> bound.

How embarrassing - I messed up the calculation. It has to be 16^24.
But pg does forge filenames other that that. It uses 2 hex digits to
count segments. After 256 segments counting starts over and the serial
is increased by one. The first 8 positions are the time line which I
will ignore for my new calculation.

So there is an eight hex digits serial for each time line which takes
256 segments. So there are 16^8*256 unique file names. If I assume one
WAL file a second this would reach upper bound (for a single time line)
after slightly more than 136 years.

Please correct me if my assumptions are wrong. But I would say one can
rely on serial file names to increase steadily.
The attached restore.pl uses this assumption to delete all files which
are older than the last redo checkpoint.

Greetings,
Frank Wittig

Attachment

pgsql-general by date:

Previous
From: Greg Smith
Date:
Subject: Re: changing the /tmp/ lock file?
Next
From: Kevin Hunter
Date:
Subject: Re: pointer to feature comparisons, please