Fix extra test failure of extended-query-test/disable-load-balance-off.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Sun, 11 Aug 2019 10:19:02 +0000 (19:19 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Sun, 11 Aug 2019 10:19:02 +0000 (19:19 +0900)
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
src/test/extended-query-test/tests/disable-load-balance-off.data

index f69855842ae30b5f48e7b92558932462ca0ee108..18d2d1089538f5688e6f501e9d72fe4bdd8e8628 100644 (file)
@@ -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)
                {
index fab4d6ad0fa0540c8ab144083c2fc8e5e562428b..07c16bf955d9379161031363669888a0222cb52a 100644 (file)
@@ -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"