Re: Archive recovery won't be completed on some situation. - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Re: Archive recovery won't be completed on some situation.
Date
Msg-id 20140415.155237.75546818.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: Archive recovery won't be completed on some situation.  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Archive recovery won't be completed on some situation.
List pgsql-hackers
Hello, thank you for the discussion.

At Tue, 1 Apr 2014 11:41:20 -0400, Robert Haas wrote
>> I don't find that very radical at all.  The backup_label file is
>> *supposed* to be removed on the master if it crashes during the
>> backup; and it should never be removed from the backup itself.  At
>> least that's how I understand it.  Unfortunately, people too often

The code indeed seems to assume that, and I couldn't think of any
measure to avoid that dead-end once recovery sequence reads
backup label accidentially left behind. I thought up to remove
backup label during immediate shutdown on prvious versions, like
9.4 does.

CancelBackup does only stat-unlink-rename sequence so I think
this doesn't obstruct immediate shutdown sequence. And this
doesn't change any seeming behavior or interfaces just except for
this case. What do you think about this? Isn't this also
applicable for older versions?

postmaster.c@9.3.3:2339
pmdie(SIGNAL_ARGS)
{
...   switch (postgres_signal_arg)   {
...       case SIGQUIT:
...           SignalUnconnectedWorkers(SIGQUIT);
+
+            /*
+             * Terminate exclusive backup mode. This is done in
+             * PostmasterStateMachine() for other shutdown modes.
+             */
+            if (ReachedNormalRunning)
+                CancelBackup();           ExitPostmaster(0);           break;


Aside from this, I'll post the new option for pg_resetxlog for
the next CF.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Rajeev rastogi
Date:
Subject: Re: Autonomous Transaction (WIP)
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: UNION ALL on partitioned tables won't use indices.