Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0ZsB-0001sC-Ld for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Oct 2017 21:09:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e0ZsB-0007QI-0M for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Oct 2017 21:09:31 +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 1e0Zs9-0007I2-Jf for pgsql-hackers@postgresql.org; Fri, 06 Oct 2017 21:09:29 +0000 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e0Zs6-0007pc-3c for pgsql-hackers@postgresql.org; Fri, 06 Oct 2017 21:09:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1507324166; x=1538860166; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=9If3/De0c84B3IHGBlwxGkTUQ04Tl3lohbZU4nJH/TU=; b=kfVo7o/AP6fZgFjdGO58kc4QUSmFd2ahTJ4omog+GZepy9to9Ir8MoA0 9NiIuWxqbrq0Vd5NTXwLnJDw3gZPdQ6Q+mqweSc3NPWoaVNJ+yNE1+RdA CkvIcI+jF05w4DhqEBCh/nU6RcsmfAXWv07k+9ZmfX7qVYHxt1RAgOVlK g=; X-IronPort-AV: E=Sophos;i="5.42,484,1500940800"; d="scan'208";a="309780014" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2c-1968f9fa.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2017 21:09:15 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2c-1968f9fa.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id v96L9DHM125571 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 6 Oct 2017 21:09:14 GMT Received: from EX13D11UWB002.ant.amazon.com (10.43.161.20) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 6 Oct 2017 21:09:13 +0000 Received: from EX13D04UWA001.ant.amazon.com (10.43.160.47) by EX13D11UWB002.ant.amazon.com (10.43.161.20) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 6 Oct 2017 21:09:13 +0000 Received: from EX13D04UWA001.ant.amazon.com ([10.43.160.47]) by EX13D04UWA001.ant.amazon.com ([10.43.160.47]) with mapi id 15.00.1236.000; Fri, 6 Oct 2017 21:09:12 +0000 From: "Wong, Yi Wen" To: Peter Geoghegan , Alvaro Herrera CC: "Wood, Dan" , Michael Paquier , PostgreSQL Hackers , Robert Haas Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple Thread-Topic: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple Thread-Index: AQHTPGdrRGLhgwhTD0yOTJUfb3MqMKLSwMIAgAASRQCAAA8igIAAAs4AgAAjHd6AAK1cgIAAxSeAgAACRwCAAAprgIABBfcAgAFFJQCAAD72gIAADOAAgAAMaACAAA7WAIAAF8Am Date: Fri, 6 Oct 2017 21:09:12 +0000 Message-ID: <1507324152711.78083@amazon.com> References: <20171006174956.4kofump6jcmlnjci@alvherre.pgsql> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.162.215] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Precedence: Bulk 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 >On Fri, Oct 6, 2017 at 11:34 AM, Peter Geoghegan wrote: >>> I don't know if it's really the freeze map at fault or something else. >> >> Ideally, it would be possible to effectively disable the new freeze >> map stuff in a minimal way, for testing purposes. Perhaps the authors > of that patch, CC'd, can suggest a way to do that. >Actually, the simplest thing might be to just use pg_visibility's >pg_check_frozen() to check that the visibility/freeze map accurately >summarizes the all-frozen status of tuples in the heap. If that >doesn't indicate that there is corruption, we can be fairly confident >that the problem is elsewhere. The metadata in the visibility/freeze >map should be accurate when a bit is set to indicate that an entire >heap page is all-frozen (or, separately, all-visible). We can hardly >expect it to have better information that the authoritative source of >truth, the heap itself. >The more I think about it, the more I tend to doubt that the remaining >problems are with the freeze map. If the freeze map was wrong, and >incorrectly said that a page was all-frozen, then surely the outward >symptoms would take a long time to show up, as they always do when we >accidentally fail to freeze a tuple before a relfrozenxid cutoff. ISTM >that that's the only meaningful way that the freeze map can be wrong >-- it only promises to be accurate when it says that no further >freezing is needed for a page/bit. Yesterday, I've been spending time with pg_visibility on the pages when I r= eproduce the issue in 9.6. None of the all-frozen or all-visible bits are necessarily set in problemat= ic pages. ERROR: failed to find parent tuple for heap-only tuple at (0,182) in table= "accounts" blkno | all_visible | all_frozen | pd_all_visible=20 -------+-------------+------------+---------------- 0 | f | f | f (1 row) Even when the bits were set, I haven't found issues with the pg_check_xxx f= unctions in the dozens of times I've run them. postgres=3D# select * from pg_visibility('accounts'::regclass); blkno | all_visible | all_frozen | pd_all_visible=20 -------+-------------+------------+---------------- 0 | f | f | f 1 | t | t | t (2 rows) postgres=3D# select pg_check_visible('accounts'::regclass); pg_check_visible=20 ------------------ (0 rows) postgres=3D# select pg_check_frozen('accounts'::regclass); pg_check_frozen=20 ----------------- (0 rows) Yi Wen --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers