Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1exgJu-0007NT-7I for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Mar 2018 21:58:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1exgJt-0000C9-2o for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Mar 2018 21:58:25 +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.89) (envelope-from ) id 1exgGA-00009J-L7 for pgsql-hackers@lists.postgresql.org; Sun, 18 Mar 2018 21:54:34 +0000 Received: from bay.acenet.us ([173.230.252.50]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1exgG3-0001iE-2Z for pgsql-hackers@postgresql.org; Sun, 18 Mar 2018 21:54:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=atsKHjpxYx/blfODoMDnvE3vMIVgagOnCwo9vU0FMZo=; b=T44POGhu0ObMw43BWGv913JaNs s2DVONRJjhKMslP0+D/ift8tpwCz/JzCUL0Ud9eoOj9vQQIxvCQOBUAR3WR5puBJA6rkmS1GKkOKH 2lsM+tj7UJ0A0ug0gkSDUUVo7ySOU/ikndW203tuU1u8aN40DmXShq9itPrDwRCjmFzX74kEEik4E i+YHfK6vYM3nKRe+RvAH797OwW7Sc5FvSKErDoYqtrn8oq2DFGGgqOUxWNxXFC8Wg3VLFxPBBlBT+ VB+OcFDxX7i/e5M9LxeKeHOgq8cCv8XUjPQ84RYhIzruzuIT2+qxbdmUjWlDm6Wdr3gwq2rs0hS+j 1j0WHIHw==; Received: from [192.182.57.106] (port=52173) by bay.acenet.us with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1exgFy-003YT0-Qa; Sun, 18 Mar 2018 17:54:24 -0400 Subject: Re: [HACKERS] AdvanceXLInsertBuffer vs. WAL segment compressibility To: Daniel Gustafsson , Tom Lane References: <579297F8.7020107@anastigmatix.net> <5797D953.6040806@anastigmatix.net> <20160802183347.GD32575@momjian.us> <20943eba-bbb9-390c-01b1-e6704ce33c7b@iki.fi> <594C9457.6000708@anastigmatix.net> <59506148.1010708@anastigmatix.net> <2b9ed9a4-56a6-a4db-0abf-3527d993e2d4@iki.fi> <5A92F0C0.7070706@anastigmatix.net> <5AADB130.2020206@anastigmatix.net> <4597.1521338981@sss.pgh.pa.us> <46FFB930-B0F3-400A-85ED-D9948C97FADF@yesql.se> Cc: Michael Paquier , Heikki Linnakangas , Robert Haas , Bruce Momjian , PostgreSQL Hackers From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5AAEE00E.9050503@anastigmatix.net> Date: Sun, 18 Mar 2018 17:54:22 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <46FFB930-B0F3-400A-85ED-D9948C97FADF@yesql.se> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-96.8 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap+anastigmatix.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 03/18/18 16:56, Daniel Gustafsson wrote: > sorry about that. Now we know that the proposed test fails without the patch > applied and clears with it, that was at least an interesting side effect =) It was, and it got me looking at the test, and even though it does detect the difference between patch-applied and patch-not-applied, I sort of wonder if it does what it claims to. It seems to me that unpack('N8192', ...) would want to return 8192 32-bit ints (in array context), but really only be able to return 2048 of them (because it's only got 8192 bytes to unpack), and then being used in scalar context, it only returns the first one anyway, so the test only hinges on whether the first four bytes of the block are zero or not. Which turns out to be enough to catch a non-zeroed header. :) What would you think about replacing the last two lines with just ok($bytes =~ /\A\x00*+\z/, 'make sure wal segment is zeroed'); -Chap