Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDaOT-0007tG-02 for pgsql-committers@arkaria.postgresql.org; Thu, 16 Jun 2016 16:43:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bDaOS-0000Wo-Ia for pgsql-committers@arkaria.postgresql.org; Thu, 16 Jun 2016 16:43:48 +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 1bDaOS-0000Wa-5a; Thu, 16 Jun 2016 16:43:48 +0000 Received: from mail-qk0-x233.google.com ([2607:f8b0:400d:c09::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bDaOK-0004Gc-26; Thu, 16 Jun 2016 16:43:47 +0000 Received: by mail-qk0-x233.google.com with SMTP id p10so58978201qke.3; Thu, 16 Jun 2016 09:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7vDckTjE5xtED+LLEBHo0FSeFKD2EisDX/hVry+xdRE=; b=S0QnVGlRrf3ITPlnF9XePQGodXwOSRAvJV+wMo2Nijh+iMKorORn7Xv7bl4YW6z6dZ Vgmfy20d8NFk0Y2sz0iVtA2O/GbD2mbXkdccelmCYyg/PgK0lWML+NWKKkz1E4usgS3U hcjksA/S0f86NR2I3dNzUZZrTCzamq/jltzQ3n55NeHD7klzUv9n5JoUhy3hMxAgs/k5 p/4dyOSRf/kl2V+Jap9jR15Ofc2mRSOTlQ9GTsgXI9RQqBNS6HcoHcVV54XpmSZV3nOv 1rYA9wy9w1qMnsejcHfVjIwAcS+IzTQAZyaJQ3z2UMvJJ/LF0Yj63t4KowG3nYA/mIN6 73Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7vDckTjE5xtED+LLEBHo0FSeFKD2EisDX/hVry+xdRE=; b=LQazaXf70i+zsPgdr3dv+QzBYP6NklFQgZLszRjM2yETfeHPiHfBTv3TOOiwBFWK40 Wd8TWfQULmYlFYVfn75+lvAOMdM8JBL7l1d6wCgvte09acCAzBu5BkfNI3000tL7VD2j 26vsePnFQ+BQ7q9kzg6oM9nRPv/UggAH7Di49ZqVHTcW5bJ4cvrkORPTkYIX2V4bvTyd FBHj5torwsZZ0SZLcYd2hPFgxMw7y501nSRJ5M2QSH+u0TOECEBqOH9Zt+G0iOMm+VDZ 6WJ/rNG2Pq2MowUYxx0bkFNAKYp12tLFiH/CDsClSitCKUHlFWxVp3JVZE3FkopRCLUT XujQ== X-Gm-Message-State: ALyK8tLCFa1rvnhSLgiVL90MrzlrJ0z/mkWzcGN2dDqVcNK3fS3YijwftLau6Pbz9piexRr1Ve1uGRcUEerzzw== X-Received: by 10.200.54.244 with SMTP id b49mr6262408qtc.36.1466095417758; Thu, 16 Jun 2016 09:43:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.58.194 with HTTP; Thu, 16 Jun 2016 09:43:34 -0700 (PDT) In-Reply-To: <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> <20160616161426.bapgkbh762ktzyhk@alap3.anarazel.de> From: Robert Haas Date: Thu, 16 Jun 2016 12:43:34 -0400 Message-ID: Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold < To: Andres Freund Cc: Kevin Grittner , Alvaro Herrera , Ants Aasma , Amit Kapila , Noah Misch , Kevin Grittner , "pgsql-hackers@postgresql.org" , "pgsql-committers@postgresql.org" Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.7 (--) 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 Thu, Jun 16, 2016 at 12:14 PM, Andres Freund wrote: >> > 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. I don't understand how STO changes that. I'm not saying it doesn't change it, but I don't understand why it would. The root of my confusion is: if we prune a tuple, we'll bump the page LSN, so any session that is still referencing that tuple will error out as soon as it touches the page on which that tuple used to exist. It won't even survive long enough to care that the tuple isn't there any more. Maybe it would help if you lay out the whole sequence of events, like: S1: Does this. S2: Does that. S1: Now does something else. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers