Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXUrS-0005wD-Lt for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Aug 2016 14:52:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bXUrS-0001Kz-8v for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Aug 2016 14:52: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 1bXUrR-0001Iy-Ds for pgsql-hackers@postgresql.org; Wed, 10 Aug 2016 14:52:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bXUrO-0004U8-IN for pgsql-hackers@postgresql.org; Wed, 10 Aug 2016 14:52:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u7AEpOKj006907; Wed, 10 Aug 2016 10:51:26 -0400 From: Tom Lane To: Heikki Linnakangas cc: Alexander Korotkov , Simon Riggs , Robert Haas , Dilip Kumar , Jeff Davis , PostgreSQL-development , Alvaro Herrera , Greg Stark , Andres Freund , Rajeev rastogi , Markus Wanner , Ants Aasma , Bruce Momjian , obartunov , Teodor Sigaev Subject: Re: Proposal for CSN based snapshots In-reply-to: <79213506-4c9c-7e7a-44c6-ae94484c1159@iki.fi> References: <51B6C97B.1070000@bluegap.ch> <20140530152721.GC30516@awork2.anarazel.de> <5388D02D.6040305@vmware.com> <539AD153.9000004@vmware.com> <1409043789.2335.330.camel@jeff-desktop> <53FC6545.7000501@vmware.com> <1409116988.2335.463.camel@jeff-desktop> <53FD7D65.9040602@vmware.com> <53FD7DCC.5020005@vmware.com> <69041c5a-ec60-3c54-49d0-5df071b27f52@iki.fi> <5596.1470838147@sss.pgh.! pa.us> <79213506-4c9c-7e7a-44c6-ae94484c1159@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Wed, 10 Aug 2016 17:30:57 +0300" Date: Wed, 10 Aug 2016 10:51:24 -0400 Message-ID: <6906.1470840684@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) 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 Heikki Linnakangas writes: > On 08/10/2016 05:09 PM, Tom Lane wrote: >> Uh, what? That's not the semantics we have today, and I don't see why >> it's necessary or a good idea. Once the commit is in the WAL stream, >> any action taken on the basis of seeing the commit must be later in >> the WAL stream. So what's the problem? > I was talking about synchronous commits in the above. A synchronous > commit is not made visible to other transactions, until the commit WAL > record is flushed to disk. [ thinks for a bit... ] Oh, OK, that's because we don't treat a transaction as committed until its clog bit is set *and* it's not marked as running in the PGPROC array. And sync transactions will flush WAL in between. Still, having to invent CSNs seems like a huge loss for this design. Personally I'd give up async commit first. If we had only sync commit, the rule could be "xact LSN less than snapshot threshold and less than WAL flush position", and we'd not need CSNs. I know some people like async commit, but it's there because it was easy and cheap in our old design, not because it's the world's greatest feature and worth giving up performance for. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers