Re: Hot standby doesn't come up on some situation.

Поиск
Список
Период
Сортировка
От Kyotaro HORIGUCHI
Тема Re: Hot standby doesn't come up on some situation.
Дата
Msg-id 20140305.175104.190424074.horiguchi.kyotaro@lab.ntt.co.jp
обсуждение исходный текст
Ответ на Re: Hot standby doesn't come up on some situation.  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Ответы Re: Hot standby doesn't come up on some situation.  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
Hello, 

After all, I have confirmed that this fixes the problem on crash
recovery of hot-standby botfor 9.3 and HEAD and no problem was
found except unreadability :(

By the way, I moderately want to fix an assertion message to a
ordinary one. Details are below.

====
The server stops with following message during restarting after
crash requesting archive recovery when the WAL has been produced
with the wal_level below WAL_LEVEL_HOT_STANDBY.

| TRAP: FailedAssertion("!(((oldestActiveXID) != ((TransactionId) 0)))", File: "xlog.c", Line: 6799)
| LOG:  startup process (PID 7270) was terminated by signal 6: Aborted

Surely this is the consequence of illegal operation but I think
it is also not a issue of assertion - which fires on something
wrong in design or quite rare cases(this case ?). So it might be
better to show message as below on the case.

| FATAL:  Checkpoint doesn't have valid oldest active transaction id
| HINT:  Reading WAL might have been written under insufficient wal_level.

This could do in this way,

======
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index e3d5e10..bb6922a 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6789,7 +6789,13 @@ StartupXLOG(void)            if (wasShutdown)                oldestActiveXID =
PrescanPreparedTransactions(&xids,&nxids);            else
 
+            {                oldestActiveXID = checkPoint.oldestActiveXid;
+                if (!TransactionIdIsValid(oldestActiveXID))
+                    ereport(FATAL,
+                            (errmsg("Checkpoint doesn't have valid oldest active transaction id"),
+                             errhint("Reading WAL might have been written under insufficient wal_level.")));
+            }            Assert(TransactionIdIsValid(oldestActiveXID));            /* Tell procarray about the range
ofxids it has to deal with */
 
=====


What do you think about this? Feel free dumping this if you feel
negative on this.


regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kouhei Kaigai
Дата:
Сообщение: Re: Custom Scan APIs (Re: Custom Plan node)
Следующее
От: Yeb Havinga
Дата:
Сообщение: Re: Row-security on updatable s.b. views