Patch removes stuff related to "startup process" and creates files
under src/$DIR/postmaster for this code.

This makes startup process look more like bgwriter, walwriter etc..

Other refactoring patches to follow, chipping away at xlog.c.

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

Search Discussions

  • Robert Haas at Nov 2, 2011 at 1:14 pm

    On Wed, Nov 2, 2011 at 4:44 AM, Simon Riggs wrote:
    Patch removes stuff related to "startup process" and creates files
    under src/$DIR/postmaster for this code.

    This makes startup process look more like bgwriter, walwriter etc..
    In general, +1.

    But I don't think we want duplicate function prototypes for the same
    functions, so -1 for this hunk:

    + /* in xlog.c */
    + extern void WakeupRecovery(void);
    + extern void StartupXLOG(void);

    The existing prototypes in xlog.h seem like they should be just fine.

    IsPromoteTriggered could be simplified to just "return
    promote_triggered;"; you don't need to branch.

    I think one thing that would be worth considering in terms of future
    refactoring is to split up the gigantic StartupXLOG() function in some
    fashion.

    --
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
  • Simon Riggs at Nov 2, 2011 at 1:41 pm

    On Wed, Nov 2, 2011 at 1:14 PM, Robert Haas wrote:
    On Wed, Nov 2, 2011 at 4:44 AM, Simon Riggs wrote:
    Patch removes stuff related to "startup process" and creates files
    under src/$DIR/postmaster for this code.

    This makes startup process look more like bgwriter, walwriter etc..
    In general, +1.
    Thanks for the review.
    But I don't think we want duplicate function prototypes for the same
    functions, so -1 for this hunk:

    + /* in xlog.c */
    + extern void WakeupRecovery(void);
    + extern void StartupXLOG(void);

    The existing prototypes in xlog.h seem like they should be just fine.
    That was to avoid having startup.c include xlog.h, which it doesn't
    really need to see.

    Not worried either way, so I'll do as you suggest.
    IsPromoteTriggered could be simplified to just "return
    promote_triggered;"; you don't need to branch.
    Happy to do that.
    I think one thing that would be worth considering in terms of future
    refactoring is to split up the gigantic StartupXLOG() function in some
    fashion.
    There are a great many other long functions in Postgres, and few of
    them as critical as that one.

    I don't see a reason to touch it, and would do so last of all of any
    code in xlog.c

    --
     Simon Riggs                   http://www.2ndQuadrant.com/
     PostgreSQL Development, 24x7 Support, Training & Services
  • Magnus Hagander at Nov 2, 2011 at 1:44 pm

    On Wed, Nov 2, 2011 at 14:33, Simon Riggs wrote:
    On Wed, Nov 2, 2011 at 1:14 PM, Robert Haas wrote:
    On Wed, Nov 2, 2011 at 4:44 AM, Simon Riggs wrote:
    Patch removes stuff related to "startup process" and creates files
    under src/$DIR/postmaster for this code.

    This makes startup process look more like bgwriter, walwriter etc..
    In general, +1.
    Thanks for the review.
    But I don't think we want duplicate function prototypes for the same
    functions, so -1 for this hunk:

    + /* in xlog.c */
    + extern void WakeupRecovery(void);
    + extern void StartupXLOG(void);

    The existing prototypes in xlog.h seem like they should be just fine.
    That was to avoid having startup.c include xlog.h, which it doesn't
    really need to see.
    Double prototypes seems to me like it's a cure worse than the disease to me...
    Not worried either way, so I'll do as you suggest.
    +1.

    --
     Magnus Hagander
     Me: http://www.hagander.net/
     Work: http://www.redpill-linpro.com/
  • Simon Riggs at Nov 2, 2011 at 2:18 pm

    On Wed, Nov 2, 2011 at 1:44 PM, Magnus Hagander wrote:

    Double prototypes seems to me like it's a cure worse than the disease to me...
    Doubling them was just a mistake. Anyway, thats gone now.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedNov 2, '11 at 8:45a
activeNov 2, '11 at 2:18p
posts5
users3
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase