pgpool2.git / summary / log / commit / refs

commit    ee1f46da06e27f1b6259edd547f9c99d9c8fc1ea
Author:   Toshihiro Kitagawa <kitagawa at sraoss.co.jp>
Date:     Fri Feb 18 13:48:36 2011 +0000

    Fix bug with load_balance that JDBC driver sends BEGIN to master node
    many times.


pool_proto_modules.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pool_proto_modules.c b/pool_proto_modules.c index 70fa3e114..a00b547b4 100644 --- a/pool_proto_modules.c +++ b/pool_proto_modules.c @@ -1227,7 +1227,8 @@ POOL_STATUS ReadyForQuery(POOL_CONNECTION *frontend, /* * Set transaction state for each node */ - state = TSTATE(backend, MASTER_NODE_ID); + state = TSTATE(backend, + MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID); for (i=0;i<NUM_BACKENDS;i++) { @@ -1243,7 +1244,7 @@ POOL_STATUS ReadyForQuery(POOL_CONNECTION *frontend, * The transaction state to be returned to frontend is * master's. */ - if (i == MASTER_NODE_ID) + if (i == (MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID)) { state = kind; } [parent: 0c0f5bfc64be]