Обсуждение: Time travel?

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

Time travel?

От
Melvin Davidson
Дата:
So here is a strange question.
 
I am using PostgreSQL 9.4.0 (Yes, I know 9.4.9 is most recent but it's out of my control)
 O/S is AWS Debian 3.16.7-2 (2014-11-06) x86_64 GNU/Linux.
 
I list the creation time for a WAL file and it shows:

 /home/mdavidson/dba$ ls -l --time=ctime /d-log/pg_xlog/000000010000000D000000C9
-rw------- 1 postgres postgres 16777216 Sep 29 07:14 /d-log/pg_xlog/000000010000000D000000C9

but then I list the access time for a WAL file and it shows:
 /home/mdavidson/dba$ ls -l --time=atime /d-log/pg_xlog/000000010000000D000000C9
-rw------- 1 postgres postgres 16777216 Sep  7 14:33 /d-log/pg_xlog/000000010000000D000000C9

How is it possible for the WAL file to be accessed BEFORE it was created?
Am I overlooking something simple?
 
Melvin Davidson


Re: Time travel?

От
Kevin Grittner
Дата:
On Thu, Sep 29, 2016 at 2:06 PM, Melvin Davidson <melvin6925@gmail.com> wrote:

> I am using PostgreSQL 9.4.0 (Yes, I know 9.4.9 is most recent but
> it's out of my control)

As long as the decision-maker is aware that 9.4.0 has known bugs
(fixed in later minor releases) that can render the database
unusable without warning...

> How is it possible for the WAL file to be accessed BEFORE it was
> created?

Perhaps renaming it counts as "creation" without affecting access
time.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: Time travel?

От
Paul Jungwirth
Дата:
Hi Melvin:

On 09/29/2016 12:06 PM, Melvin Davidson wrote:
> I list the creation time for a WAL file and it shows:
>
>  /home/mdavidson/dba$ ls -l --time=ctime
> /d-log/pg_xlog/000000010000000D000000C9
> -rw------- 1 postgres postgres 16777216 Sep 29 07:14
> /d-log/pg_xlog/000000010000000D000000C9

ctime stands for "changed" not "created". It is not quite the same as
mtime ("modified") because mtime is updated only when the file contents
change, but ctime is updated if either the file contents or file
attributes change:

http://www.linux-faqs.info/general/difference-between-mtime-ctime-and-atime

I hope that explains it!

Paul


Re: Time travel?

От
Thomas Munro
Дата:
On Fri, Sep 30, 2016 at 8:17 AM, Kevin Grittner <kgrittn@gmail.com> wrote:
> On Thu, Sep 29, 2016 at 2:06 PM, Melvin Davidson <melvin6925@gmail.com> wrote:
>
>> I am using PostgreSQL 9.4.0 (Yes, I know 9.4.9 is most recent but
>> it's out of my control)
>
> As long as the decision-maker is aware that 9.4.0 has known bugs
> (fixed in later minor releases) that can render the database
> unusable without warning...
>
>> How is it possible for the WAL file to be accessed BEFORE it was
>> created?
>
> Perhaps renaming it counts as "creation" without affecting access
> time.

Apparently some filesystems change the ctime for rename and others
don't, and POSIX tolerates both.

--
Thomas Munro
http://www.enterprisedb.com


Re: Time travel?

От
Melvin Davidson
Дата:


On Thu, Sep 29, 2016 at 3:20 PM, Thomas Munro <thomas.munro@enterprisedb.com> wrote:
On Fri, Sep 30, 2016 at 8:17 AM, Kevin Grittner <kgrittn@gmail.com> wrote:
> On Thu, Sep 29, 2016 at 2:06 PM, Melvin Davidson <melvin6925@gmail.com> wrote:
>
>> I am using PostgreSQL 9.4.0 (Yes, I know 9.4.9 is most recent but
>> it's out of my control)
>
> As long as the decision-maker is aware that 9.4.0 has known bugs
> (fixed in later minor releases) that can render the database
> unusable without warning...
>
>> How is it possible for the WAL file to be accessed BEFORE it was
>> created?
>
> Perhaps renaming it counts as "creation" without affecting access
> time.

Apparently some filesystems change the ctime for rename and others
don't, and POSIX tolerates both.

--
Thomas Munro
http://www.enterprisedb.com

>Apparently some filesystems change the ctime for rename and others
>don't, and POSIX tolerates both.

OK, thanks. Back to the future! :D

--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.