pgpool2.git / summary / log / commit / refs

commit    51d29aaf7849d6d595d74583d017d9f73611915a
Author:   Tatsuo Ishii <ishii@sraoss.co.jp>
Date:     Sun Aug 11 10:19:02 2019 +0000

    Fix extra test failure of extended-query-test/disable-load-balance-off.
    
    There were two reasons why the test fails.
    
    1) when disable_load_balance_on_write = off, parse_before_bind should
       have not be called at all. So fix this.
    
    2) the test data tests/disable-load-balance-off.data did not set
    disable_load_balance_on_write = off.


src/protocol/pool_proto_modules.c | 3 ++- src/test/extended-query-test/tests/disable-load-balance-off.data | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/protocol/pool_proto_modules.c b/src/protocol/pool_proto_modules.c index f69855842..18d2d1089 100644 --- a/src/protocol/pool_proto_modules.c +++ b/src/protocol/pool_proto_modules.c @@ -1449,7 +1449,8 @@ Bind(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, * primary node. */ if (pool_config->load_balance_mode && pool_is_writing_transaction() && - TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) == 'T') + TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) == 'T' && + pool_config->disable_load_balance_on_write != DLBOW_OFF) { if (!SL_MODE) { diff --git a/src/test/extended-query-test/tests/disable-load-balance-off.data b/src/test/extended-query-test/tests/disable-load-balance-off.data index fab4d6ad0..07c16bf95 100644 --- a/src/test/extended-query-test/tests/disable-load-balance-off.data +++ b/src/test/extended-query-test/tests/disable-load-balance-off.data @@ -4,9 +4,7 @@ # Force load balance node to 1. ##backend_weight0 = 0 ##backend_weight1 = 1 - -# Disable load balance in current transaction only. -# (default behavior) +##disable_load_balance_on_write = 'off' # Create test table 'Q' "DROP TABLE IF EXISTS pgproto_test1" [parent: 5daef2dd3f41]