Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z7A9O-0001Mm-9l for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Jun 2015 22:25:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Z7A9N-0005Tl-Ho for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Jun 2015 22:25:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z7A9M-0005QT-2d for pgsql-bugs@postgresql.org; Mon, 22 Jun 2015 22:25:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z7A9J-0005yd-JA for pgsql-bugs@postgresql.org; Mon, 22 Jun 2015 22:25:06 +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 t5MMP3ZI006575; Mon, 22 Jun 2015 18:25:04 -0400 From: Tom Lane To: chris+postgresql@qwirx.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13459: Replaying WAL logs can hang on startup In-reply-to: <20150622084201.3874.74819@wrigleys.postgresql.org> References: <20150622084201.3874.74819@wrigleys.postgresql.org> Comments: In-reply-to chris+postgresql@qwirx.com message dated "Mon, 22 Jun 2015 08:42:01 -0000" Date: Mon, 22 Jun 2015 18:25:03 -0400 Message-ID: <6574.1435011903@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org chris+postgresql@qwirx.com writes: > I restored a standby from a pg_basebackup made from the master the previous > morning. As a result, it had a lot of WAL logs to catch up on. > At one point it hangs while restoring logs. It normally takes a few seconds > to process a 16 MB WAL segment, but on this one, it was "recovering > 0000000100000CEC00000025" for 7 minutes now with no log output at all. Hmm ... > My guess is that ForwardFsyncRequest() is continually returning false, and > this code is stuck forever. I noticed that it says that "I'm inclined to > assume that the checkpointer > will always empty the queue soon", but there is no checkpointer running > during recovery, is there? There is supposed to be one once we have reached a consistent state; see SetForwardFsyncRequests(). AFAICS it should be impossible to reach the wait you're seeing unless the startup process's local pendingOpsTable has been removed by SetForwardFsyncRequests(), and the caller of that should have pinged the postmaster to start up a checkpointer. If you can repro this easily, please look to see whether there's a checkpointer, and if not, what state the postmaster is in (pmState, CheckpointerPID, Shutdown, FatalError, RecoveryError might be interesting). If there is a checkpointer, then that's what to be looking at. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs