Add new feature to enable specifying SQL patterns lists that should not be load-balanced.
authorBo Peng <pengbo@sraoss.co.jp>
Thu, 14 Jun 2018 05:27:53 +0000 (14:27 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Thu, 14 Jun 2018 05:27:53 +0000 (14:27 +0900)
commit83906d1d5024e5f68ef9dd9dff9fda7f5720be4e
treeda161023556a1f9cd851678325f32ab955e02495
parent0312dc5a142edf5e24df611ad31e41f89204d860
Add new feature to enable specifying SQL patterns lists that should not be load-balanced.

Even though currently we can do this by adding the
/*NO LOAD BALANCE*/ comment to queries, this requires
modifying application codes and this is not always
possible.

This feature enables specifying SQL patterns lists
that should not be load-balanced.

-------------
New parameter
-------------
black_query_pattern_list = ''

You can specify a semicolon separated list of SQL patterns
that should be sent to primary node only.

SQL that matched patterns specified in this list are not load balanced.
Only Maste Slave mode is supported.

You can use regular expression to match SQL patterns,
to which ^ and $ are automatically added.
When using characters such as "'", ";" or "*" in SQL patterns,
you need to escape them using "\".
14 files changed:
doc.ja/src/sgml/loadbalance.sgml
doc/src/sgml/loadbalance.sgml
src/config/pool_config.l
src/config/pool_config_variables.c
src/context/pool_query_context.c
src/include/pool_config.h
src/sample/pgpool.conf.sample
src/sample/pgpool.conf.sample-logical
src/sample/pgpool.conf.sample-master-slave
src/sample/pgpool.conf.sample-replication
src/sample/pgpool.conf.sample-stream
src/test/regression/tests/001.load_balance/test.sh
src/utils/pool_process_reporting.c
src/utils/pool_select_walker.c