[pgpool-committers: 1890] pgpool: This is the penultimate patch for integration of memory and exc

Muhammad Usama m.usama at gmail.com
Wed May 7 20:27:25 JST 2014


This is the penultimate patch for integration of memory and exception manager APIs into pgpool.
The commit is very large mainly because of replacing of pool_error(), pool_debug() and pool_log() function calls to ereport(ERROR,..) ereport(DEBUG,..) and ereport(LOG,..)
Below is the description of few areas changed by the commit

Some Important Memory Contexts
============================

    ProcessLoopContext:
    This context resets at every main loop iteration of a process

    TopMemoryContext:
    This context is same as PostgreSQL's TopMemoryContext and lives for a life time of process.

    ErrorContext:
    Same as PostgreSQL's ErrorContext and used for error processing.

    QueryContext:
    Used by pgpool child process and it lives for single query cycle.

Lifecycle of Important Objects
==============================

    SessionContext:
    The session context consists of a backend and frontend connection and it lives for a single iteration of main child process loop.
    So the session context object is created in ProcessLoopContext.

    ProcessContext:
    ConnectionPool:
    BackendConnection:
    The above objects are required for the life of process hence are created in TopMemoryContext which lives throughout the process life time.

    Child Frontend connection:
    Frontend connection object is placed in the ProcessLoopContext since new frontend connection is created at every main loop iteration of pgpool child process.

    PCP Frontend connection:
    This object can live till the pcp process so the object for pcp frontend is created in TopMemoryContext.

new configuration parameters
===========================

    The patch also adds three new configuration parameters to control the error reporting style and details.
    Parameters names and their behaviours are borrowed from PostgreSQL.
    int log_error_verbosity;    /* controls how much detail about error should be emitted */
    int client_min_messages;    /*controls which message should be sent to client */
    int log_min_messages;       /*controls which message should be emitted to server log */

Some other notable changes introduced by the patch.
================================================

    The patch changes the error reporting behaviour and now pgpool-II tries to send all the error and log messages to the connected frontend clients (controllable by "client_min_messages" configuration pa
    The patch added an extra call back "on_system_exit" to the elog API, which is not present in the PostgreSQL.

Branches
--------
EXCEPTION_MGR
master

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

Modified Files
--------------
Makefile.in                                   |  376 ++--
aclocal.m4                                    |  617 ++---
configure                                     | 1303 ++++++-----
doc/Makefile.in                               |  156 +-
doc/pgpool-en.html                            |   38 +
src/Makefile.am                               |    6 +-
src/Makefile.in                               |  462 ++--
src/auth/md5.c                                |    7 +-
src/auth/pool_auth.c                          |  513 ++---
src/auth/pool_hba.c                           |  387 ++--
src/config/pool_config.c                      |  271 ++-
src/config/pool_config.l                      |  197 +-
src/context/pool_query_context.c              |  116 +-
src/context/pool_session_context.c            |   41 +-
src/include/Makefile.in                       |  161 +-
src/include/context/pool_session_context.h    |    2 +-
src/include/pcp/pcp_stream.h                  |    1 +
src/include/pool.h                            |    7 +-
src/include/pool_config.h                     |    3 +
src/include/protocol/pool_proto_modules.h     |    4 +-
src/include/protocol/protocol_defs.h          |   19 +
src/include/utils/elog.h                      |   15 +-
src/include/utils/memutils.h                  |    4 +-
src/include/utils/pool_stream.h               |    3 +-
src/libs/Makefile.in                          |  275 ++-
src/libs/pcp/Makefile.am                      |    7 +-
src/libs/pcp/Makefile.in                      |  285 ++-
src/libs/pcp/pcp.c                            |  280 +--
src/libs/pcp/pcp_error.c                      |   87 -
src/libs/pcp/pcp_stream.c                     |  385 ----
src/main/main.c                               |   36 +-
src/main/pgpool_main.c                        |  405 ++--
src/parallel_query/pool_rewrite_query.c       |  241 +-
src/parser/Makefile.in                        |  291 ++-
src/parser/gram.c                             | 2989 ++++++++++++++++++++-----
src/parser/pool_string.c                      |   27 -
src/parser/scan.c                             |   72 +-
src/pcp_con/pcp_child.c                       |   10 +-
src/protocol/child.c                          |  437 ++--
src/protocol/pool_connection_pool.c           |   91 +-
src/protocol/pool_process_query.c             | 1393 ++++++------
src/protocol/pool_proto2.c                    |  134 +-
src/protocol/pool_proto_modules.c             |  704 ++----
src/query_cache/pool_memqcache.c              |  189 +-
src/rewrite/pool_lobj.c                       |    1 +
src/sample/pgpool.conf                        |   27 +
src/sample/pgpool.conf.sample                 |   26 +
src/sample/pgpool.conf.sample-master-slave    |   26 +
src/sample/pgpool.conf.sample-replication     |   26 +
src/sample/pgpool.conf.sample-stream          |   26 +
src/streaming_replication/pool_worker_child.c |    4 +-
src/system_db/pool_system.c                   |  161 +-
src/test/pgpool_setup                         |    2 +-
src/tools/Makefile.in                         |  275 ++-
src/tools/pcp/Makefile.am                     |   26 +-
src/tools/pcp/Makefile.in                     |  348 ++-
src/tools/pgmd5/Makefile.in                   |  350 +--
src/utils/error/elog.c                        |  366 +--
src/utils/mmgr/mcxt.c                         |    8 +-
src/utils/pcp/pcp_error.c                     |   87 +
src/utils/pcp/pcp_stream.c                    |  392 ++++
src/utils/pcp/pcp_timeout.c                   |   12 +
src/utils/pool_error.c                        |    2 +-
src/utils/pool_params.c                       |   65 +-
src/utils/pool_process_reporting.c            |   37 +-
src/utils/pool_select_walker.c                |   14 +-
src/utils/pool_stream.c                       |  324 +--
src/utils/ps_status.c                         |    1 +
src/watchdog/Makefile.in                      |  229 +-
src/watchdog/watchdog.c                       |   14 +-
70 files changed, 9325 insertions(+), 6571 deletions(-)



More information about the pgpool-committers mailing list