Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwJFe-0001M8-48 for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 21:13:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TwJFd-0005F9-8j for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2013 21:13:25 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwJFb-0005EP-Ol for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 21:13:23 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TwJFa-00030Z-8R for pgsql-hackers@postgresql.org; Fri, 18 Jan 2013 21:13:23 +0000 Received: from anarazel.de (p5DDC5936.dip.t-dialin.net [93.220.89.54]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0LeM29-1T8LR40xv3-00q9N5; Fri, 18 Jan 2013 22:13:19 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 5872E1C0173; Fri, 18 Jan 2013 22:13:18 +0100 (CET) Date: Fri, 18 Jan 2013 22:13:18 +0100 From: Andres Freund To: Tom Lane Cc: Alvaro Herrera , Erik Rijkers , Kevin Grittner , pgsql-hackers@postgresql.org Subject: Re: foreign key locks Message-ID: <20130118211317.GB4359@awork2.anarazel.de> References: <20121129152326.69330@gmx.com> <20121129160220.GA4942@alvh.no-ip.org> <20121129161654.GB4942@alvh.no-ip.org> <20121228204847.GD4150@alvh.no-ip.org> <20130110210040.GB4110@alvh.no-ip.org> <20130118200204.GH4063@alvh.no-ip.org> <28623.1358541467@sss.pgh.pa.us> <20130118204643.GA4359@awork2.anarazel.de> <693.1358542878@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <693.1358542878@sss.pgh.pa.us> X-Provags-ID: V02:K0:dS5S8S0MdOEBWb2kN/aEg0nipVpFYKT8V7eQ/vBhlni 9JJYxIlJBbUlbTQ3+56PpgieYl5U6DsjvKvIxXUQQk2J8rOOBu +msii9J0QNkxTO3sRFr5vXBvPc85Yjc8bgDsNDbYUgBDg3c3Tu Wu19zMr/eF5d96FWv6w/ct58GqKoIO9s5kqW4HQu0XFEx3QcqJ 5pTz1PbTb/1eHi19pVkoas9pL40QuNj2JmtEvamSnstc9wuHLh MhpJlHkDhG8WqfvB6OX9hKdm8XA53tgFQ2rf9WpBgjzwjl7Tyz /CngEDg+1lTV18H7rFK7ir+IWuF+WOG6L7El34SokLE0WicZ4c TOolnNZhTtj4jPJwVHIXk2f5Nw4slMN/y+Mmicppl 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 2013-01-18 16:01:18 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2013-01-18 15:37:47 -0500, Tom Lane wrote: > >> I doubt it ever came up before. What use is logging only the content of > >> a buffer page? Surely you'd need to know, for example, which relation > >> and page number it is from. > > > It only got to be a length of 0 because the the data got removed due to > > a logged full page write. And the backup block contains the data about > > which blocks it is logging in itself. > > And if the full-page-image case *hadn't* been invoked, what then? I > still don't see a very good argument for xlog records with no fixed > data. In that case data would have been logged? The code in question was: xl_heap_lock_updated xlrec; xlrec.target.node = rel->rd_node; ... xlrec.xmax = new_xmax; - rdata.data = (char *) &xlrec; - rdata.len = SizeOfHeapLockUpdated; - rdata.buffer = buf; - rdata.buffer_std = true; - rdata.next = NULL; - recptr = XLogInsert(RM_HEAP2_ID, XLOG_HEAP2_LOCK_UPDATED, &rdata); Other wal logging code (and fklocks now as well) just put those into two XLogRecData blocks to avoid the issue. > > I wonder if the check shouldn't just check write_len instead, directly > > below the loop that ads backup blocks. > > We're not changing this unless you can convince me that the read-side > error check mentioned in the comment is useless. Youre right, the read side check is worth quite a bit. I think I am retracting my suggestion. I guess the amount of extra data thats uselessly logged although never used in in the redo functions doesn't really amass to anything significant in comparison to the backup block data. 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