Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9DaA-000646-TA for pgsql-hackers@arkaria.postgresql.org; Fri, 12 May 2017 16:38:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d9DaA-00044k-AB for pgsql-hackers@arkaria.postgresql.org; Fri, 12 May 2017 16:38:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d9Da9-00044X-Pr; Fri, 12 May 2017 16:38:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d9Da5-0003G8-Qe; Fri, 12 May 2017 16:38:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v4CGcCrx023382; Fri, 12 May 2017 12:38:12 -0400 From: Tom Lane To: "K S, Sandhya (Nokia - IN/Bangalore)" cc: "'Merlin Moncure'" , "'pgsql-hackers@postgresql.org'" , "'pgsql-bugs@postgresql.org'" , "Itnal, Prakash (Nokia - IN/Bangalore)" , "T, Rasna (Nokia - IN/Bangalore)" Subject: Re: [BUGS] Crash observed during the start of the Postgres process In-reply-to: References: Comments: In-reply-to "K S, Sandhya (Nokia - IN/Bangalore)" message dated "Fri, 12 May 2017 13:42:25 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23380.1494607092.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 12 May 2017 12:38:12 -0400 Message-ID: <23381.1494607092@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org "K S, Sandhya (Nokia - IN/Bangalore)" writes: > I have filtered the logs based on PID (19825) to see if this helps to > debug the issue further. Is this really a stock Postgres build? The proximate cause of the PANIC is that the startup process is seeing other processes active even though it hasn't reachedConsistency. This is bad on any number of levels, quite aside from that particular PANIC, because those other processes are presumably seeing non-consistent database state. Looking elsewhere in the log, we see that indeed there seem to be several backend processes happily executing commands. For instance, here's the trace of one of them starting up: [19810-58f473ff.4d62-187] 2017-04-17 07:51:28.783 GMT < > DEBUG: 00000: fo= rked new backend, pid=3D19850 socket=3D10 [19810-58f473ff.4d62-188] 2017-04-17 07:51:28.783 GMT < > LOCATION: Backen= dStartup, postmaster.c:3884 [19850-58f47400.4d8a-1] 2017-04-17 07:51:28.783 GMT < > LOG: 57P03: the d= atabase system is starting up [19850-58f47400.4d8a-2] 2017-04-17 07:51:28.783 GMT < > LOCATION: Process= StartupPacket, postmaster.c:2143 [19850-58f47400.4d8a-3] 2017-04-17 07:51:28.784 GMT < authentication> DEBU= G: 00000: postgres child[19850]: starting with ( Now, that LOG message proves that this backend has observed that the database is not ready to allow connections. So why did it only emit the message as LOG and keep going? The code for this in 9.3 looks like /* * 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(FATAL, (errcode(ERRCODE_CANNOT_CONNECT_NOW), errmsg("the database system is starting up"))); break; ... I can't draw any other conclusion but that you've hacked something to make FATAL act like LOG. Which is a fatal mistake. Errors that are marked FATAL are generally ones where allowing the process to keep going is not an acceptable outcome. regards, tom lane --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers