backup_label revisited

From: Greg Stark <stark(at)mit(dot)edu>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: backup_label revisited
Date: 2014-05-29 12:12:14
Message-ID: CAM-w4HPAmArty712RtOvWAZbxOH9=zUGafEoDmPnYc9rS_XL3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

So I ran into the case again where a system crashed while a hot backup
was being taken. Postgres couldn't start up automatically because the
backup_label was present. This has come up before e.g.
http://www.postgresql.org/message-id/CAAZKuFaP1GxcOJtyzCh13rvevJeVwro1VVfbYsQTWGUD9iS1_g@mail.gmail.com
but I believe no progress was made.

I was trying to think if we could somehow identify if the backup_label
was from a backup in progress or a restore in progress. Obvious
choices like putting the server ip address in it are obviously not
going to work for several reasons.

However, at least on Linux wouldn't it be sufficient to put the inode
number of the backup_label file in the backup_label? If it's still the
same inode then it's just restarting, not a restore since afaik
there's no way for tar or the like to recreate the file with the same
inode on any filesystem. That would even protect against another
restore on the same host.

--
greg

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2014-05-29 12:12:16 Re: json/jsonb inconsistence
Previous Message Rahila Syed 2014-05-29 12:11:07 Re: Compression of full-page-writes