Re: [ADMIN] Does Postgres ever write to tables without file systemtimestamps getting updated? - Mailing list pgsql-admin

From David Steele
Subject Re: [ADMIN] Does Postgres ever write to tables without file systemtimestamps getting updated?
Date
Msg-id c4ad6c4c-5b49-cc6d-0f61-f14058f8ac52@pgmasters.net
Whole thread Raw
In response to Re: [ADMIN] Does Postgres ever write to tables without file system timestamps getting updated?  (Thorsten Schöning <tschoening@am-soft.de>)
Responses Re: [ADMIN] Does Postgres ever write to tables without file systemtimestamps getting updated?  (scott ribe <scott_ribe@elevated-dev.com>)
List pgsql-admin
On 6/6/17 10:39 AM, Thorsten Schöning wrote:
> Guten Tag scott ribe,
> am Dienstag, 6. Juni 2017 um 16:28 schrieben Sie:
>
>> You seem to be assuming that the files were changed close to the
>> time you found the problem;[...]
>
> No, I assume that the files were last changed at the time of the last
> written timestamp in the production system. Which would make my
> backup corrupt if it has the same size/timestamp but different data.
> And that change in my backup could have been introduced anytime
> between the last backup and now, I simply don't know, because I don't
> calculate hash sums for my backups or use some checksumming file
> system like BTRFS or ZFS. So it might be that my backups are simply
> broken for various reasons and I need to have a closer look at this.

If you used rsync to do the backup originally then it is very possible
to have timestamp/size be the same and the checksums be different.

This is because PostgreSQL may modify a file while rsync is copying it.
If this happens in the same second that rsync built the manifest then
the timestamp will not be updated but the data may change.

This is why it is not safe to do incremental backups of PostgreSQL with
rsync without using checksums.

--
-David
david@pgmasters.net


pgsql-admin by date:

Previous
From: Thorsten Schöning
Date:
Subject: Re: [ADMIN] Does Postgres ever write to tables without file system timestamps getting updated?
Next
From: scott ribe
Date:
Subject: Re: [ADMIN] Does Postgres ever write to tables without file systemtimestamps getting updated?