[GENERAL] Re: Is there possibility btree_redo with XLOG_BTREE_DELETE donebetween standby_redo and the end of backup - Mailing list pgsql-general

From y39chen
Subject [GENERAL] Re: Is there possibility btree_redo with XLOG_BTREE_DELETE donebetween standby_redo and the end of backup
Date
Msg-id 1495704189413-5963181.post@n3.nabble.com
Whole thread Raw
In response to Re: [GENERAL] Is there possibility btree_redo with XLOG_BTREE_DELETEdone between standby_redo and the end of backup  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [GENERAL] Re: Is there possibility btree_redo withXLOG_BTREE_DELETE done between standby_redo and the end of backup  (Michael Paquier <michael.paquier@gmail.com>)
Re: [GENERAL] Re: Is there possibility btree_redo with XLOG_BTREE_DELETE done between standby_redo and the end of backup  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Thank you the comments.
We found the panic happened when adding one of our patch.

static int
ProcessStartupPacket(Port *port, bool SSLdone)
{
......
    /*
     * If we're going to reject the connection due to database state, say so
     * now instead of wasting cycles on an authentication exchange. (This also
     * allows a pg_ping utility to be written.)
     */
    switch (port->canAcceptConnections)
    {
        case CAC_STARTUP:
            ereport(*LOG*,
                    (errcode(ERRCODE_CANNOT_CONNECT_NOW),
                     errmsg("the database system is starting up")));
            break;
......
}

I understand the patch would accept connection while Postgres master is
still recovering. and it is dangerous in general.  When I remove the
patch(be PANIC still). no panic happened. It seems have relationship.
I also noticed there is one post for similar problem discussion.

http://www.postgresql-archive.org/Re-Crash-observed-during-the-start-of-the-Postgres-process-td5958225.html
<http://www.postgresql-archive.org/Re-Crash-observed-during-the-start-of-the-Postgres-process-td5958225.html>

My doubt is Standby is redoing the records in WAL from master. how accept
connection in standby side while recovering would trigger
btree_xlog_delete_get_latestRemovedXid() and panic happen.

I tried to read the postgres code the get the clear map. But still confused.

Are you aware and would you kindly explain the relationship behind? Or give
me some hint how to investigate it?




--
View this message in context:
http://www.postgresql-archive.org/Is-there-possibility-btree-redo-with-XLOG-BTREE-DELETE-done-between-standby-redo-and-the-end-of-backp-tp5963066p5963181.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: [GENERAL] pg_dump 8.3.3 ERROR: invalid page header in block2264419 of relation "pg_largeobject"
Next
From: anthonymarc
Date:
Subject: [GENERAL] Buy counterfeit money ( morganmoore401@gmail.com)euros,dollars,pounds, SAR,ZAR,AED