[GENERAL] Re: Is there possibility btree_redo with XLOG_BTREE_DELETE done between standby_redo and the end of backup

2017-05-25 Thread y39chen
Yeah, I figured out the point(logic). The precondition is should not have any connections accept while recovering. It is clear to me now. Thank you very much. static TransactionId btree_xlog_delete_get_latestRemovedXid(xl_btree_delete *xlrec) { .. if (*CountDBBackends(InvalidOid)* ==

Re: [GENERAL] Re: Is there possibility btree_redo with XLOG_BTREE_DELETE done between standby_redo and the end of backup

2017-05-25 Thread Tom Lane
y39chen writes: > We found the panic happened when adding one of our patch. > switch (port->canAcceptConnections) > { > case CAC_STARTUP: > ereport(*LOG*, >

Re: [GENERAL] Re: Is there possibility btree_redo with XLOG_BTREE_DELETE done between standby_redo and the end of backup

2017-05-25 Thread Michael Paquier
On Thu, May 25, 2017 at 5:23 AM, y39chen wrote: > 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. You should look at the

[GENERAL] Re: Is there possibility btree_redo with XLOG_BTREE_DELETE done between standby_redo and the end of backup

2017-05-25 Thread y39chen
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