Further plans to refactor xlog.c

Lists: pgsql-hackers
From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Further plans to refactor xlog.c
Date: 2011-11-03 18:14:39
Message-ID: CA+U5nM+BEH4J3=SWZnaCxeX1ToN5MWAG49z7Z9Yfzie=GgDkaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Next steps in refactoring are bigger steps, but not huge ones.

I propose this

* everything to do with XLOG rmgr into a file called xlogrmgr.c
Thats xlog_redo() and most everything to do with checkpoints

* everything to do with reading WAL files into a file called xlogread.c
That will allow us to put pg_xlogdump into core

* possibly some more stuff into xlogboot.c

The above actions will reduce xlog.c to about 7000 lines, about 4000
lines smaller than when I started. That sounds like it could go
further, but it moves out most of the areas of recent growth by
focusing on the purpose of that code.

An obvious split would seem to be move all recovery-side code into its
own file. That seems quite likely to take a lot of time, break
something, as well as requiring us to share XLogCtl, all of which
personally I would rather avoid.

Fujii's work is likely to remove another few hundred lines as well.

That seems enough to me.... OK?

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Further plans to refactor xlog.c
Date: 2011-11-04 05:16:29
Message-ID: CAHGQGwGN4W-0Mw=JPuzXn2VpLkymNL0fsM+3BwzzqqkVvkQB5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Nov 4, 2011 at 3:14 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> Next steps in refactoring are bigger steps, but not huge ones.
>
> I propose this
>
> * everything to do with XLOG rmgr into a file called xlogrmgr.c
> Thats xlog_redo() and most everything to do with checkpoints
>
> * everything to do with reading WAL files into a file called xlogread.c
> That will allow us to put pg_xlogdump into core
>
> * possibly some more stuff into xlogboot.c
>
> The above actions will reduce xlog.c to about 7000 lines, about 4000
> lines smaller than when I started. That sounds like it could go
> further, but it moves out most of the areas of recent growth by
> focusing on the purpose of that code.
>
> An obvious split would seem to be move all recovery-side code into its
> own file. That seems quite likely to take a lot of time, break
> something, as well as requiring us to share XLogCtl, all of which
> personally I would rather avoid.
>
> Fujii's work is likely to remove another few hundred lines as well.
>
> That seems enough to me.... OK?

Additionally what about moving all built-in functions defined in xlog.c
to xlogfuncs.c?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Further plans to refactor xlog.c
Date: 2011-11-04 05:26:48
Message-ID: CAHGQGwGbQ06j-2btcEgWUeHSMzXJA-GX6+M940VJ3_kQMY4njw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Nov 4, 2011 at 2:16 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Fri, Nov 4, 2011 at 3:14 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>> Next steps in refactoring are bigger steps, but not huge ones.
>>
>> I propose this
>>
>> * everything to do with XLOG rmgr into a file called xlogrmgr.c
>> Thats xlog_redo() and most everything to do with checkpoints
>>
>> * everything to do with reading WAL files into a file called xlogread.c
>> That will allow us to put pg_xlogdump into core
>>
>> * possibly some more stuff into xlogboot.c
>>
>> The above actions will reduce xlog.c to about 7000 lines, about 4000
>> lines smaller than when I started. That sounds like it could go
>> further, but it moves out most of the areas of recent growth by
>> focusing on the purpose of that code.
>>
>> An obvious split would seem to be move all recovery-side code into its
>> own file. That seems quite likely to take a lot of time, break
>> something, as well as requiring us to share XLogCtl, all of which
>> personally I would rather avoid.
>>
>> Fujii's work is likely to remove another few hundred lines as well.
>>
>> That seems enough to me.... OK?
>
> Additionally what about moving all built-in functions defined in xlog.c
> to xlogfuncs.c?

Oh, you've already posted the patch which does that.
http://archives.postgresql.org/message-id/CA+U5nMK=yBzczKdvj8kOjfSz+d9LFmXvw+928nhU4x1hByhp7g@mail.gmail.com

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Further plans to refactor xlog.c
Date: 2011-11-04 09:54:33
Message-ID: CA+U5nMLh55a1A02raFaDgnVDuJNHPMQyVD+ECiA91AT--CVTXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Nov 4, 2011 at 5:26 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

>> Additionally what about moving all built-in functions defined in xlog.c
>> to xlogfuncs.c?
>
> Oh, you've already posted the patch which does that.
> http://archives.postgresql.org/message-id/CA+U5nMK=yBzczKdvj8kOjfSz+d9LFmXvw+928nhU4x1hByhp7g@mail.gmail.com

Committed

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services