View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000189 | Pgpool-II | Bug | public | 2016-04-07 14:31 | 2016-04-15 13:31 |
| Reporter | harukat | Assigned To | t-ishii | ||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | resolved | Resolution | open | ||
| Product Version | 3.4.0 | ||||
| Target Version | 3.4.0 | ||||
| Summary | 0000189: kind mismatch error on master_slave_mode=on / load_lalance_mode=off | ||||
| Description | In the following settings: load_balance_mode = off master_slave_mode = on master_slave_sub_mode = 'stream' and the following status: db1=# SHOW pool_nodes; node_id | hostname | port | status | lb_weight | role ---------+-----------+------+--------+-----------+--------- 0 | localhost | 5433 | 2 | 0.500000 | standby 1 | localhost | 5432 | 2 | 0.500000 | primary (2 rows) "BEGIN" (and other transaction statements) will be thrown incorrectly to both nodes. It can cause a "kind mismatch" error. It isn't happen when backend0 is primary. The attached patch makes pgpool to handle "load_balance_mode=off" as same as the case NO LOAD BALANCE comment is given. I think it can privent this bug simply, but it may have a problem about feature stability. | ||||
| Tags | No tags attached. | ||||
|
|
|
|
|
I noticed additionally . The variable "session_context->load_balance_node_id" does not initialize when load_balance_mode is off, But this variable is refered in the function pool_setall_node_to_be_sent() at that case. We can also fix the bug with the following code. *** ./context/pool_session_context.c 2016-04-11 19:54:13.136531528 +0900 --- ./context/pool_session_context.c.FIX 2016-04-11 19:54:06.705823626 +0900 *************** *** 86,91 **** --- 86,93 ---- (errmsg("initializing session context"), errdetail("selected load balancing node: %d", backend->info->load_balancing_node))); } + else + session_context->load_balance_node_id = -1; /* Unset query is in progress */ pool_unset_query_in_progress(); |
|
|
The attached proposed patch is not quite correct because PRIMARY_NODE_ID only exists in the streaming replication mode. In the mean time I'm going accept the proposal (if load balance mode is off, SET or other commands, which are sent to all the DB nodes if load balance is on, are not necessarily sent to all the DB nodes. I'm going to commit changes for this (different implementation from yours) to the master branch, which will also address the issue above. |
|
|
Fix committed. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2016-04-07 14:31 | harukat | New Issue | |
| 2016-04-07 14:31 | harukat | File Added: pool_query_context.c.20160407.patch | |
| 2016-04-07 14:49 | harukat | Summary | master slave => kind mismatch error on master_slave_mode |
| 2016-04-07 14:49 | harukat | Description Updated | |
| 2016-04-07 14:49 | harukat | File Deleted: pool_query_context.c.20160407.patch | |
| 2016-04-07 14:49 | harukat | File Added: pool_query_context.c.20160407.patch | |
| 2016-04-07 14:50 | harukat | Summary | kind mismatch error on master_slave_mode => kind mismatch error on master_slave_mode=on / load_lalance_mode=off |
| 2016-04-07 14:53 | harukat | File Deleted: pool_query_context.c.20160407.patch | |
| 2016-04-07 14:53 | harukat | File Added: pool_query_context.c.20160407.patch | |
| 2016-04-08 11:40 | t-ishii | Assigned To | => t-ishii |
| 2016-04-08 11:40 | t-ishii | Status | new => assigned |
| 2016-04-11 19:55 | harukat | Note Added: 0000775 | |
| 2016-04-15 08:31 | t-ishii | Note Added: 0000784 | |
| 2016-04-15 08:33 | t-ishii | Note Edited: 0000784 | |
| 2016-04-15 13:31 | t-ishii | Note Added: 0000785 | |
| 2016-04-15 13:31 | t-ishii | Status | assigned => resolved |