Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXUDe-0002t5-5l for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Aug 2016 14:10:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bXUDd-0005Ni-On for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Aug 2016 14:10:53 +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 1bXUDd-0005NS-2A for pgsql-hackers@postgresql.org; Wed, 10 Aug 2016 14:10:53 +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 1bXUDW-0003nw-9A for pgsql-hackers@postgresql.org; Wed, 10 Aug 2016 14:10:51 +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 u7AE97Jc005597; Wed, 10 Aug 2016 10:09:07 -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: References: <51B6C97B.1070000@bluegap.ch> <20140515213714.GB7857@eldon.alvh.no-ip.org> <53889CCB.7030005@vmware.com> <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> Comments: In-reply-to Heikki Linnakangas message dated "Wed, 10 Aug 2016 16:57:35 +0300" Date: Wed, 10 Aug 2016 10:09:07 -0400 Message-ID: <5596.1470838147@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: > Imagine that you have a stream of normal, synchronous, commits. They get > assigned LSNs: 1, 2, 3, 4. They become visible to other transactions in > that order. > The way I described this scheme in the first emails on this thread, was > to use the current WAL insertion position as the snapshot. That's not > correct, though: you have to use the current WAL *flush* position as the > snapshot. Otherwise you would see the results of a transaction that > hasn't been flushed to disk yet, i.e. which might still get lost, if you > pull the power plug before the flush happens. So you have to use the > last flush position as the snapshot. 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? > Now, if you do an asynchronous commit, the effects of that should become > visible immediately, without waiting for the next flush. You can't do > that, if its CSN == LSN. This distinction is completely arbitrary, and unlike the way it works now. 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