Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRmAA-0007Qf-6R for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Jul 2017 21:12:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dRmA9-000302-3O for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Jul 2017 21:12:13 +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 1dRm8b-0000II-66 for pgsql-hackers@postgresql.org; Sun, 02 Jul 2017 21:10:37 +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 1dRm8X-00062w-DC for pgsql-hackers@postgresql.org; Sun, 02 Jul 2017 21:10:36 +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 v62LAVJi014838 for ; Sun, 2 Jul 2017 17:10:31 -0400 From: Tom Lane To: pgsql-hackers@postgresql.org Subject: Re: Race-like failure in recovery/t/009_twophase.pl In-reply-to: <2588.1499028049@sss.pgh.pa.us> References: <908.1498965681@sss.pgh.pa.us> <2588.1499028049@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 02 Jul 2017 16:40:49 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14836.1499029831.1@sss.pgh.pa.us> Date: Sun, 02 Jul 2017 17:10:31 -0400 Message-ID: <14837.1499029831@sss.pgh.pa.us> 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 I wrote: > Any ideas what's wrong there? Hah: the answer is that query_hash's split() call is broken. "man perlfunc" quoth split Splits the string EXPR into a list of strings and returns that list. By default, empty leading fields are preserved, and empty trailing ones are deleted. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In the case at hand, the SQL query returns something like "|physical|||t|10338|||0/302B7E8" with normal timing, but with enough delay in there, you get "|physical|||t|11542|||" which triggers split's default behavior of ignoring the trailing empty fields. It looks like the way to get split to not do that is to pass it a "limit" of -1. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers