View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000109||Pgpool-II||Bug||public||2014-07-31 19:52||2014-08-24 10:18|
|Target Version||Fixed in Version|
|Summary||0000109: Query prefixed with any comment (/* ... */) triggers NO LOAD BALANCE mode|
|Description||While trying to make use of the /*NO LOAD BALANCE*/ sql hint I realized that query prefixed by any sql hint is always sent to the master node.|
I'm working with pgpool in master/slave mode with postgresql 9.3 nodes.
|Steps To Reproduce||In pgpool, set weight for standby to 1, and 0 to master.|
psql -tA -U postgres -c 'select inet_server_addr()' -> shows standby ip
psql -tA -U postgres -c '/*NO LOAD BALANCE*/ select inet_server_addr()' -> shows master ip
psql -tA -U postgres -c '/*DUMMY COMMENT*/ select inet_server_addr()' -> shows master ip
the latter one should show the standby IP, as the hint is not a proper NO LOAD BALANCE hint
|Tags||No tags attached.|
||BTW it would be totally great if white spaces between "/*", "*/" and the hint name could also be permitted. Unfortunately the hibernate query setComment method always inserts space after "/*" and then the hint body.|
Because the query does not start with "SELECT", it's not load balanced.
It's explicitly stated in the doc. See "condition for load balancing" section for more details.
Yes, I can see know. I was misleaded by the statement "SELECT can be forced to be executed on the master as well, but for this you need to put a /*NO LOAD BALANCE*/ comment before the SELECT statement." in Master/Slave Mode section of the documentation.
Any plans on changing the behavior?
Sorry for delay. What do you exactly want?
Do you want to put a SQL comment without disturbing load balancing? (i.e. pure SQL comment)
||Yes exactly, I'd like the C style comments not to disturb load balancing. For my local purposes I modified the function is_select_query(Node *node, char *sql) in pool_process_query.c by allowing the select to start with "/*" chars and it seems to work as expected.|
||I have implemented new parameter called "allow_sql_comments" for upcoming 3.4, which allows to use SQL comments without disturbing load balancing.|
|2014-07-31 19:52||tkazmierczak||New Issue|
|2014-07-31 20:07||tkazmierczak||Note Added: 0000458|
|2014-08-01 07:56||t-ishii||Note Added: 0000459|
|2014-08-01 07:56||t-ishii||Assigned To||=> t-ishii|
|2014-08-01 07:56||t-ishii||Status||new => assigned|
|2014-08-01 16:49||tkazmierczak||Note Added: 0000460|
|2014-08-21 10:58||t-ishii||Note Added: 0000466|
|2014-08-21 10:58||t-ishii||Status||assigned => feedback|
|2014-08-21 15:50||tkazmierczak||Note Added: 0000467|
|2014-08-21 15:50||tkazmierczak||Status||feedback => assigned|
|2014-08-24 08:42||t-ishii||Note Added: 0000470|
|2014-08-24 10:18||t-ishii||Status||assigned => resolved|