<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>
<div>Hi all,</div>
<div><br>
</div>
<div>I’ve got a setup where I have a PostgreSQL 9.2.9 master on the US East Coast and a streaming replication slave on the US West Coast. &nbsp;I’m trying out a setup where we run pgPool in the same data center as the slave, directing all reads to the slave and
 all writes to the master. &nbsp;</div>
<div><br>
</div>
<div>I have pgPool set up for Master/Slave mode, with configuration as below. &nbsp;Everything seems to work except I’m not seeing any SELECT queries sent to the slave. &nbsp;I don’t see any messages about replication being behind (and load is pretty low at the moment).
 &nbsp;I’ve also pasted the debug output from when I execute the query. &nbsp;</div>
<div><br>
</div>
<div>Any suggestions would be appreciated!&nbsp;</div>
<div><br>
</div>
<div>Config Snippet:</div>
<div><br>
</div>
<div>
<div># - Backend Connection Settings -</div>
<div>backend_hostname0 = ‘xxx.xxx.xxx.xxx'</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Host name or IP address to connect to for backend 0</div>
<div>backend_port0 = 5432</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Port number for backend 0</div>
<div>backend_weight0 = 1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Weight for backend 0 (only in load balancing mode)</div>
<div>backend_data_directory0 = '/data'</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Data directory for backend 0</div>
<div>backend_flag0 = 'DISALLOW_TO_FAILOVER'</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Controls various backend behavior</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER</div>
<div><br>
</div>
<div>backend_hostname1 = ‘xxx.xxx.xx.xxx'</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Host name or IP address to connect to for backend 0</div>
<div>backend_port1 = 5432</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Port number for backend 0</div>
<div>backend_weight0 = 0</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Weight for backend 0 (only in load balancing mode)</div>
<div>backend_data_directory1 = '/data'</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Data directory for backend 0</div>
<div>backend_flag1 = 'DISALLOW_TO_FAILOVER'</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Controls various backend behavior</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER</div>
</div>
<div><br>
</div>
<div>
<div>master_slave_mode = on</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Activate master/slave mode</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# (change requires restart)</div>
<div>master_slave_sub_mode = 'stream'</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Master/slave sub mode</div>
</div>
<div><br>
</div>
<div>Log Snippet:</div>
<div><br>
</div>
<div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: ProcessFrontendResponse: kind from frontend Q(51)</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pool_unset_doing_extended_query_message: done</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: statement2: select count(*) from users;</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pool_set_query_in_progress: done</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pool_has_insertinto_or_locking_clause: returns 0</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: send_to_where: 2 query: select count(*) from users;</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: function_call_walker: function name: count</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^currval$) not matched: count</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^lastval$) not matched: count</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^nextval$) not matched: count</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^setval$) not matched: count</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^update_miles_log_aml$) not matched: count</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^update_miles_log$) not matched: count</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^update_db_info$) not matched: count</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: system_catalog_walker: relname: users</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: temp_table_walker: relname: users</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: make_table_name_from_rangevar: tablename:users</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: unlogged_table_walker: relname: users</div>
<div>2015-01-03 23:09:38 DEBUG: pid 177: wait_for_query_response: waiting for backend 1 completing the query</div>
</div>
</div>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
<p><font size="-2">This email message contains information that Motus, LLC considers confidential and/or proprietary, or may later designate as confidential and proprietary. It is intended only for use of the individual or entity named above and should not
 be forwarded to any other persons or entities without the express consent of Motus, LLC, nor should it be used for any purpose other than in the course of any potential or actual business relationship with Motus, LLC. If the reader of this message is not the
 intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication
 in error, please notify sender immediately and destroy the original message.</font></p>
<p><font size="-2">Internal Revenue Service regulations require that certain types of written advice include a disclaimer. To the extent the preceding message contains advice relating to a Federal tax issue, unless expressly stated otherwise the advice is not
 intended or written to be used, and it cannot be used by the recipient or any other taxpayer, for the purpose of avoiding Federal tax penalties, and was not written to support the promotion or marketing of any transaction or matter discussed herein.</font></p>
</body>
</html>