Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4023B13CCE5F for ; Thu, 2 Feb 2012 03:26:27 -0400 (AST) Received: from exprod7og116.obsmtp.com ([64.18.2.219]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rsr3q-0004yL-Tc for pgsql-hackers@postgresql.org; Thu, 02 Feb 2012 07:26:27 +0000 Received: from mail-lpp01m010-f49.google.com ([209.85.215.49]) (using TLSv1) by exprod7ob116.postini.com ([64.18.6.12]) with SMTP ID DSNKTyo6lTOMF5pSZF6FOHJwoJtvfzbKVjhx@postini.com; Wed, 01 Feb 2012 23:26:26 PST Received: by laam7 with SMTP id m7so1530037laa.22 for ; Wed, 01 Feb 2012 23:26:12 -0800 (PST) Received: by 10.152.147.38 with SMTP id th6mr823356lab.47.1328167572097; Wed, 01 Feb 2012 23:26:12 -0800 (PST) Received: from [192.168.1.102] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id l11sm1318455lbu.13.2012.02.01.23.26.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Feb 2012 23:26:11 -0800 (PST) Message-ID: <4F2A3A91.4070001@enterprisedb.com> Date: Thu, 02 Feb 2012 09:26:09 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120104 Icedove/8.0 MIME-Version: 1.0 To: Simon Riggs CC: Jim Nasby , PostgreSQL-development Subject: Re: Refactoring log_newpage References: <4FF85E04-6418-4A84-8541-9A868ABA8D75@nasby.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201202/58 X-Sequence-Number: 202423 On 02.02.2012 08:19, Simon Riggs wrote: > On Wed, Feb 1, 2012 at 10:42 PM, Jim Nasby wrote: >> On Feb 1, 2012, at 4:25 AM, Simon Riggs wrote: >>> At present log_newpage() produces log records called XLOG_HEAP_NEWPAGE. >>> >>> That routine is used by HEAP, BTREE, GIN, SPGIST rmgrs, as well as >>> various forks. >>> >>> WAL contains no information as to which rmgr the data refers to, >>> making debugging much harder and skewing efforts to optimise WAL >>> traffic and is a pretty gross modularity violation of the whole rmgr >>> concept. >>> >>> This refactoring adds an RmgrId field onto each new page record and >>> makes clearer that certain "heap" routines are actually generic. The >>> WAL records are still marked as HEAP rmgr and have XLOG_NEWPAGE record >>> type, but at least we can tell them apart. (We already had forknum, >>> just not rmgrid). >> >> >> But we already had RelFileNode; wouldn't that be enough to tell what rmgr was responsible for the new page? Can 2 different rmgrs write to the same file node? > > No, but which one? No way to tell unless you have full list of > relfilenodes and check each one. Well, you can obviously check the catalogs for that, but you must be assuming that you don't have access to the catalogs or this would be a non-issue. You can also identify the kind of page by looking at the special area of the stored page. See: http://archives.postgresql.org/pgsql-hackers/2007-04/msg00392.php -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com