Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1xBN-0006VZ-7D for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Apr 2017 15:42:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d1xBM-0005l4-OF for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Apr 2017 15:42:44 +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 1d1x9s-00036W-Cu for pgsql-hackers@postgresql.org; Sat, 22 Apr 2017 15:41:12 +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 1d1x9o-0008RM-NR for pgsql-hackers@postgresql.org; Sat, 22 Apr 2017 15:41:11 +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 v3MFf1iO004220; Sat, 22 Apr 2017 11:41:01 -0400 From: Tom Lane To: Thomas Munro cc: Simon Riggs , Alvaro Herrera , Pg Hackers Subject: Re: [COMMITTERS] pgsql: Replication lag tracking for walsenders In-reply-to: References: <20170421190629.3srqyohjocgdvhhr@alvherre.pgsql> <27895.1492808648@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Sun, 23 Apr 2017 01:54:11 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4218.1492875661.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 22 Apr 2017 11:41:01 -0400 Message-ID: <4219.1492875661@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 Thomas Munro writes: > The assertion fails reliably for me, because standby2's reported write > LSN jumps backwards after the timeline changes: for example I see > 3020000 then 3028470 then 3020000 followed by a normal progression. > Surprisingly, 004_timeline_switch.pl reports success anyway. I'm not > sure why the test fails sometimes on tern, but you can see that even > when it passed on tern the assertion had failed. Whoa. This just turned into a much larger can of worms than I expected. How can it be that processes are getting assertion crashes and yet the test framework reports success anyway? That's impossibly broken/unacceptable. Looking closer at the tern report we started the thread with, there are actually TWO assertion trap reports, the one Alvaro noted and another one in 009_twophase_master.log: TRAP: FailedAssertion("!(*ptr =3D=3D ((TransactionId) 0) || (*ptr =3D=3D pa= rent && overwriteOK))", File: "subtrans.c", Line: 92) When I run the recovery test on my own machine, it reports success (quite reliably, I tried a bunch of times yesterday), but now that I know to look: $ grep TRAP tmp_check/log/* tmp_check/log/009_twophase_master.log:TRAP: FailedAssertion("!(*ptr =3D=3D = ((TransactionId) 0) || (*ptr =3D=3D parent && overwriteOK))", File: "subtra= ns.c", Line: 92) So we now have three problems not just one: * How is it that the TAP tests aren't noticing the failure? This one, to my mind, is a code-red situation, as it basically invalidates every TAP test we've ever run. * If Thomas's explanation for the timeline-switch assertion is correct, why isn't it reproducible everywhere? * What's with that second TRAP? > Here is a fix for the assertion failure. As for this patch itself, is it reasonable to try to assert that the timeline has in fact changed? 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