[Pgpool-committers] pgpool - pgpool-II: Fix bug when primary node is not the youngest.

User T-ishii t-ishii at pgfoundry.org
Wed Oct 20 01:08:55 UTC 2010


Log Message:
-----------
Fix bug when primary node is not the youngest. Before pgpool-II
unconditionally assumed the master node(the youngest live node) is a
primary server, which is apprently wrong assumption. To fix the
problem, now pgpool-II have info on shmem(Req_info) to know which is
the primary. The info is set when 1)pgpool-II started 2)failover
occurs. The work is done by new function find_primary_node(main.c). It
does SELECT pg_is_in_recovery() AND pgpool_walrecrunning() to know the
node in question is actually standby. pgpool_walrecrunning() is new
PostgreSQL C function, to check if walreceiver is in running
status. This is neccessary when failover occurs. Unfortunately
pg_is_in_recovery() returns true even if standby is promoting because
it found a trigger file. Installing pgpool_walrecrunning() is annoying
but no way.  Also where_to_send() is modified to use PRIMARY_NODE_ID,
rather than MASTER_NODE_ID.  CVS:
----------------------------------------------------------------------
main.c pool.h pool_query_context.c pool_worker_child.c CVS: Added
Files: CVS: sql/pgpool-walrecvrunning/Makefile CVS:
sql/pgpool-walrecvrunning/pgpool-walrecrunning.c CVS:
sql/pgpool-walrecvrunning/pgpool-walrecrunning.sql.in CVS:
----------------------------------------------------------------------

Modified Files:
--------------
    pgpool-II:
        child.c (r1.64 -> r1.65)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/child.c?r1=1.64&r2=1.65)
        main.c (r1.83 -> r1.84)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/main.c?r1=1.83&r2=1.84)
        pool.h (r1.83 -> r1.84)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/pool.h?r1=1.83&r2=1.84)
        pool_query_context.c (r1.31 -> r1.32)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/pool_query_context.c?r1=1.31&r2=1.32)
        pool_worker_child.c (r1.5 -> r1.6)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/pool_worker_child.c?r1=1.5&r2=1.6)

Added Files:
-----------
    pgpool-II/sql/pgpool-walrecvrunning:
        Makefile (r1.1)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/sql/pgpool-walrecvrunning/Makefile?rev=1.1&content-type=text/x-cvsweb-markup)
        pgpool-walrecrunning.c (r1.1)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/sql/pgpool-walrecvrunning/pgpool-walrecrunning.c?rev=1.1&content-type=text/x-cvsweb-markup)
        pgpool-walrecrunning.sql.in (r1.1)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pgpool/pgpool-II/sql/pgpool-walrecvrunning/pgpool-walrecrunning.sql.in?rev=1.1&content-type=text/x-cvsweb-markup)


More information about the Pgpool-committers mailing list