Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDZw9-0006VU-Oa for pgsql-committers@arkaria.postgresql.org; Thu, 16 Jun 2016 16:14:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bDZw9-0001Hr-BU for pgsql-committers@arkaria.postgresql.org; Thu, 16 Jun 2016 16:14:33 +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 1bDZw8-0001HF-Gx; Thu, 16 Jun 2016 16:14:32 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bDZw5-0003bu-9y; Thu, 16 Jun 2016 16:14:31 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3C16C20877; Thu, 16 Jun 2016 12:14:27 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Thu, 16 Jun 2016 12:14:27 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=k8gDLgIi6XnaLZCZuNv0wVcsBjQ=; b=bRi01 /RsDzcTBAE2nMNeroFvFXkbvs9ZUYwkzQNFKycrI7h0sAy+Q2DVq/n7A0vi/YUVb iNucJ+It3VqECtW44e7n3RU51lyrSl5gs2QHLC0+iFOMB+Kqs9FBMq8QDzLgPysD MVvtsS3Q2weYiT0S3Er+bXs60X30QmPQTrpTB8= X-Sasl-enc: /hvCX3fPBiGFjpc/iHUu+CQLkkdbhI+JrDt+VhmjQCjz 1466093666 Received: from intern.anarazel.de (unknown [192.77.237.104]) by mail.messagingengine.com (Postfix) with ESMTPA id E1B47F2A1A; Thu, 16 Jun 2016 12:14:26 -0400 (EDT) Date: Thu, 16 Jun 2016 09:14:26 -0700 From: Andres Freund To: Robert Haas Cc: Kevin Grittner , Alvaro Herrera , Ants Aasma , Amit Kapila , Noah Misch , Kevin Grittner , "pgsql-hackers@postgresql.org" , "pgsql-committers@postgresql.org" Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < Message-ID: <20160616161426.bapgkbh762ktzyhk@alap3.anarazel.de> References: <20160615192011.eicg7hwkndyx2cmo@alap3.anarazel.de> <20160615202552.32oc3y3zzd5pukbp@alap3.anarazel.de> <20160615223440.omhksf4senwtfc6q@alap3.anarazel.de> <20160616015730.rtozaq5mmlhci6xy@alap3.anarazel.de> <20160616153745.upxilwj3spbi43dj@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 2016-06-16 12:02:39 -0400, Robert Haas wrote: > On Thu, Jun 16, 2016 at 11:37 AM, Andres Freund wrote: > >> If that were really true, why would we not have the problem in > >> current production versions that the toast table could be vacuumed > >> before the heap, leading to exactly the issue you are talking > >> about? > > > > The issue isn't there without the feature, because we (should) never > > access a tuple/detoast a column when it's invisible enough for the > > corresponding toast tuple to be vacuumed away. But with > > old_snapshot_timeout that's obviously (intentionally) not the case > > anymore. Due to old_snapshot_threshold we'll prune tuples which, > > without it, would still be considered HEAPTUPLE_RECENTLY_DEAD. > > Is there really an assumption that the heap and the TOAST heap are > only ever vacuumed with the same OldestXmin value? Because that seems > like it would be massively flaky. There's not. They can be vacuumed days apart. But if we vacuum the toast table with an OldestXmin, and encounter a dead toast tuple, by the definition of OldestXmin (excluding STO), there cannot be a session reading the referencing tuple anymore - so that shouldn't matter. IIRC we actually reverted a patch that caused significant problems around this. I think there's a small race condition around ProcessStandbyHSFeedbackMessage(), and you can restart with a different vacuum_defer_cleanup_age (we should just remove that), but other than that we shouldn't run into any issues without STO. -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers