[pgpool-committers: 3190] pgpool: Streamlining the pgpool configuration system (Work in progress)

Muhammad Usama m.usama at gmail.com
Tue May 3 06:26:12 JST 2016


Streamlining the pgpool configuration system (Work in progress).

This commit builds the framework for managing the pgpool-II configuration
parameters. It is the first step towards implementing the session level
SET command functionality in pgpool to allow the users to alter the pgpool
config parameters for a particular session only and reset it back to the
original value after the user session disconnects.
The overall design of the configuration framework is inspired by the
PostgreSQL's GUC and some of the more visible changes introduced by the
framework are.

-- There is no more a long list of if-else statements in pool_get_config function
and now a simple loop can be used to alter/initialize/print all the pgpool-II
config variables.
-- The framework keeps track of values assigned to parameters in BOOT or INIT
contexts and later value of the config parameters can be reset to that value.

In addition to the framework, the commit also revisits the internal data types
of the configuration parameters and made the following changes
-- Changes the type of all on/off type config parameters from integer to boolean type
-- All the string (char*) type parameters that can only be assigned from the
particular set of values (e.g. master_slave_sub_mode can assign with either
"stream" or "Slony") are changed to Enum type parameters.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=414ffa4d4061f5eba82e36e4e455d2a0fa2b80d9

Modified Files
--------------
src/Makefile.am                               |    1 +
src/Makefile.in                               |   21 +-
src/config/pool_config.c                      | 3666 ++-----------------------
src/config/pool_config.l                      | 3623 ++----------------------
src/config/pool_config_variables.c            | 3233 ++++++++++++++++++++++
src/context/pool_query_context.c              |    4 +-
src/include/pcp/libpcp_ext.h                  |    2 +-
src/include/pool.h                            |    6 +-
src/include/pool_config.h                     |  407 +--
src/include/pool_config_variables.h           |  274 ++
src/include/pool_type.h                       |   11 +
src/include/utils/fe_ports.h                  |   11 +-
src/include/utils/json.h                      |   14 +-
src/include/utils/json_writer.h               |    2 +
src/libs/pcp/Makefile.in                      |   16 +-
src/main/main.c                               |    5 +-
src/main/pgpool_main.c                        |   12 +-
src/pcp_con/pcp_child.c                       |    2 +-
src/pcp_con/pcp_worker.c                      |    8 +-
src/protocol/child.c                          |    2 +-
src/protocol/pool_process_query.c             |    2 +-
src/query_cache/pool_memqcache.c              |   10 +-
src/streaming_replication/pool_worker_child.c |    8 +-
src/tools/pgmd5/Makefile.am                   |    3 +
src/tools/pgmd5/Makefile.in                   |   26 +-
src/tools/pgmd5/pg_md5.c                      |    2 +-
src/tools/pgmd5/pool_config.c                 | 3499 ++---------------------
src/utils/json.c                              |   20 +
src/utils/json_writer.c                       |   11 +
src/utils/pool_process_reporting.c            |    8 +-
src/utils/regex_array.c                       |    2 +-
src/watchdog/watchdog.c                       |    4 +-
src/watchdog/wd_json_data.c                   |   59 +-
src/watchdog/wd_lifecheck.c                   |   16 +-
34 files changed, 4611 insertions(+), 10379 deletions(-)



More information about the pgpool-committers mailing list