Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wl25d-0005Np-Vb for pgsql-hackers@arkaria.postgresql.org; Thu, 15 May 2014 20:17:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wl25d-0000Sx-Bf for pgsql-hackers@arkaria.postgresql.org; Thu, 15 May 2014 20:17:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wl25b-0000RM-KK for pgsql-hackers@postgresql.org; Thu, 15 May 2014 20:17:15 +0000 Received: from mout.kundenserver.de ([212.227.126.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wl25Y-0006Mc-Gt for pgsql-hackers@postgresql.org; Thu, 15 May 2014 20:17:15 +0000 Received: from anarazel.de (p5DDC5E8D.dip0.t-ipconnect.de [93.220.94.141]) by mrelayeu.kundenserver.de (node=mreue004) with ESMTP (Nemesis) id 0M6AQg-1X1DQ61xf8-00y6YK; Thu, 15 May 2014 22:16:52 +0200 Received: by anarazel.de (Postfix, from userid 1000) id D160D10216D; Thu, 15 May 2014 22:16:51 +0200 (CEST) Date: Thu, 15 May 2014 22:16:51 +0200 From: Andres Freund To: Bruce Momjian Cc: Robert Haas , Heikki Linnakangas , Rajeev rastogi , Ants Aasma , PostgreSQL-development , Markus Wanner Subject: Re: Proposal for CSN based snapshots Message-ID: <20140515201651.GD16014@awork2.anarazel.de> References: <51B6C97B.1070000@bluegap.ch> <5370D323.1070606@vmware.com> <20140512144112.GB9619@awork2.anarazel.de> <5370E267.2020904@vmware.com> <20140515183436.GD25053@momjian.us> <20140515200632.GB16014@awork2.anarazel.de> <20140515201349.GK25053@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140515201349.GK25053@momjian.us> X-Provags-ID: V02:K0:oaqyoA/riEOdih6rJOyz/qATWEEZzm6FrVThKUNacga LKdzsH9bzK9QJZh98Gea0c4sjLLcg4EExNT0N2SiMj8aRgmR4r ERP38SBANEX2zP+ZHIrfQ9FV0XNfFxj44hsxPqFrG+PY4buLv7 IMRR/f5914vAlBrRpJvnjGLfBpYW3osmZjX1+QqkS5HB2bHKDt Bnwm1rBT1czQh3+brx1kCRPiqj4WokaP9mXA6w5otAN6mF1MfZ waacO+LHusfjgIDO06OvIOH99U7vuOMHFI2mvGSWP5hnpapnm9 XRX6p1wHI79vwlRJsysJNES+rUOApgZhj33AxWJjGcaEI8ziWr 28Pql1C6uKpmwGYxA/3rdrmvogjlMDX5YwxEzzbMP X-Pg-Spam-Score: -1.9 (-) 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 On 2014-05-15 16:13:49 -0400, Bruce Momjian wrote: > On Thu, May 15, 2014 at 10:06:32PM +0200, Andres Freund wrote: > > > If the larger clog size is a show-stopper (and I'm not sure I have an > > > intelligent opinion on that just yet), one way to get around the > > > problem would be to summarize CLOG entries after-the-fact. Once an > > > XID precedes the xmin of every snapshot, we don't need to know the > > > commit LSN any more. So we could read the old pg_clog files and write > > > new summary files. Since we don't need to care about subcommitted > > > transactions either, we could get by with just 1 bit per transaction, > > > 1 = committed, 0 = aborted. Once we've written and fsync'd the > > > summary files, we could throw away the original files. That might > > > leave us with a smaller pg_clog than what we have today. > > > > I think the easiest way for now would be to have pg_clog with the same > > format as today and a rangewise much smaller pg_csn storing the lsns > > that are needed. That'll leave us with pg_upgrade'ability without > > needing to rewrite pg_clog during the upgrade. > > Yes, I like the idea of storing the CSN separately. One reason the > 2-bit clog is so good is that we know we have atomic 1-byte writes on > all platforms. I don't think we rely on that anywhere. And in fact we don't have the ability to do so for arbitrary bytes - lots of platforms can do that only on specifically aligned bytes. We rely on being able to atomically (as in either before/after no torn value) write/read TransactionIds, but that's it I think? > Can we assume atomic 64-bit writes? Not on 32bit platforms. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers