Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drq5O-00024z-S8 for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Sep 2017 18:39:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1drq5O-0007Ay-0p for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Sep 2017 18:39:02 +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_2) (envelope-from ) id 1drq4g-0005xj-Mj for pgsql-bugs@postgresql.org; Tue, 12 Sep 2017 18:38:18 +0000 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1drq4d-0008Hz-Cq for pgsql-bugs@postgresql.org; Tue, 12 Sep 2017 18:38:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1505241495; x=1536777495; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=t+pbOnihEGQGVujKGQo0Ba5NbhbU5QbOte6pJ1tQPhg=; b=mhkVkuLhKKTEo+HXV9nc12thi83ixzHZBOf/5vhAR7UDvKTNYBnMBkic SCMJHb5D4urouP/GWMqKmXWkhh9EQkmoAkwAPT6T+HYn8ZtO6LYBv8E4y Cg6LPQdNG37k+req7xT34soYPvPGwCCd5lYSW8Hr/5znXTR4EqntTerWm Q=; X-IronPort-AV: E=Sophos;i="5.42,383,1500940800"; d="scan'208";a="682876205" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2c-2225282c.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Sep 2017 18:38:06 +0000 Received: from EX13MTAUWC001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2c-2225282c.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id v8CIc3jS079987 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 12 Sep 2017 18:38:03 GMT Received: from EX13D11UWC002.ant.amazon.com (10.43.162.174) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Tue, 12 Sep 2017 18:38:03 +0000 Received: from EX13D04UWA001.ant.amazon.com (10.43.160.47) by EX13D11UWC002.ant.amazon.com (10.43.162.174) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Tue, 12 Sep 2017 18:38:02 +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.1104.000; Tue, 12 Sep 2017 18:38:02 +0000 From: "Wong, Yi Wen" To: Alvaro Herrera , Michael Paquier CC: Peter Geoghegan , "Wood, Dan" , "pgsql-bugs@postgresql.org" , Andres Freund Subject: Re: Old row version in hot chain become visible after a freeze Thread-Topic: [BUGS] Old row version in hot chain become visible after a freeze Thread-Index: AQHTJ3fzEH9T5bMCDUufad1KxDA7S6Kvvd+AgAEpfwCAAAoegIAAp59A Date: Tue, 12 Sep 2017 18:38:02 +0000 Message-ID: <1505241452245.71279@amazon.com> References: ,<20170912082203.gq5hutuveqlxpvuc@alvherre.pgsql> In-Reply-To: <20170912082203.gq5hutuveqlxpvuc@alvherre.pgsql> 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.57] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 > > The > > resulting patch, which I like better than the previously proposed idea > > of skipping the freeze, takes the approach of handling freeze correctly > > for the cases where the tuple still exists after pruning. > > That's also something I was wondering when looking at the first patch. > I am unfortunately not as skilled as you are with this area of the > code (this thread has brought its quantity of study!), so I was not > able to draw a clear line with what needs to be done. But I am clearly > +1 with this approach. I have tried out the new patch and it works great as well! +1 from me. > > I also tweaked lazy_record_dead_tuple to fail with ERROR if the tuple > > cannot be recorded, as observed by Yi Wen. AFAICS that's not reachable > > because of the way the array is allocated, so an elog(ERROR) is > > sufficient. I agree the fail is rare (and probably doesn't happen in real cases, althou= gh the comment does imply with a sufficiently low working_memory it might?). However, I'd = dispute that ERROR is sufficient --PANIC is probably appropriate here because FREEZE is not WA= L-logged until the end of the page; so we'd end up with unfrozen Xids hanging around with = an appropriately timed crash. I wouldn't worry much about the PANIC tripping because like yo= u said, this seems unreachable normally. The errmsg should come with a errhint saying "Increase maintenance_work_mem= ". I've done some code inspection to try to figure out if crashing at any poin= t around before FREEZE and the later lazy_vacuum_page phase is safe (i.e. older Xids might be left beh= ind on restart/crash); it seems to me it shouldn't be a problem until new_min_xid and new_min_multi isn't updated un= til later for the truncate. Yi Wen --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs