[pgpool-committers: 1408] pgpool: This is the first of the series of commits to import PostgreSQL

Muhammad Usama muhammad.usama at enterprisedb.com
Mon Nov 4 22:05:59 JST 2013


This is the first of the series of commits to import PostgreSQL's exception and memory manager in pgpool.
This checkin includes the following items.

1-- Exception manager API of Postgres is added to pgpool, The API consists of elog.c and elog.h files.
Since this API is very extensive and is designed for PostgreSQL, So to fit it properly into pgpool I have
modified it a little bit, and most of the modifications are related to removal of code which is not required for pgpool.

2-- Added on_proc_exit callback mechanism of Postgres. To facilitate the cleanup at exit time.

3-- Added PostgreSQL's memory manager (palloc API). This includes the client side palloc functions placed in 'src/tools' directory (fe_memutils)

4-- Removed the existing memory manager which was very minimalistic and was not integrated in all parts of the code.

5-- The checkin also refectors some portions of code to make the code more readable at first glance. That includes

-- Dividing the main.c file into two files main.c and pgpool_main.c, Now the main.c file only contains the code
related to early initialisations of pgpool and parsing of the command line options.
The actual logic of the pgpool main process is moved to new pgpool_main.c file.
-- Breaking up some large functions in child.c into smaller functions.
-- Rewrite the pgpool's main loop logic to make the code more readable.

Remaining TODOs on this front.

1-- The current checkin only integrates the memory and exception manager in main process and connection creation
segment of pgpool child process. And the next TODO is to integrate it in pcp and worker child process.

2-- Integration of newly added API into query processor logic in child processes.

3-- elog.c and elog.h files needs some cleanups and changes (To remove unwanted functions and data members of ErrorData structure).

Branch
------
EXCEPTION_MGR

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=84b45d34c630f76dfc2288db74274bfa0af75c79
Author: Muhammad Usama <m.usama at gmail.com>

Modified Files
--------------
src/Makefile.am                                 |    6 +-
src/Makefile.in                                 |   95 +-
src/auth/pool_auth.c                            |  159 +-
src/auth/pool_hba.c                             |   39 +-
src/config/pool_config.c                        |  128 +-
src/config/pool_config.l                        |   48 +-
src/config/pool_config_md5.c                    |    2 +
src/context/pool_query_context.c                |   18 +-
src/context/pool_session_context.c              |   29 +-
src/include/Makefile.in                         |   25 +-
src/include/context/pool_query_context.h        |    4 +-
src/include/context/pool_session_context.h      |    3 +-
src/include/parallel_query/pool_rewrite_query.h |    1 -
src/include/parser/memnodes.h                   |   79 -
src/include/parser/pool_memory.h                |   77 -
src/include/parser/pool_parser.h                |   17 +-
src/include/parser/pool_string.h                |    3 +-
src/include/parser/stringinfo.h                 |    4 +
src/include/pool.h                              |   23 +-
src/include/pool_type.h                         |  288 +-
src/include/protocol/pool_proto_modules.h       |    1 -
src/include/utils/elog.h                        |  508 ++
src/include/utils/fe_ports.h                    |   28 +
src/include/utils/memdebug.h                    |   34 +
src/include/utils/memnodes.h                    |   78 +
src/include/utils/memutils.h                    |  148 +
src/include/utils/palloc.h                      |  105 +
src/include/utils/pool_ipc.h                    |    2 +-
src/include/utils/pool_path.h                   |   29 -
src/libs/Makefile.in                            |   19 +-
src/libs/pcp/Makefile.in                        |   31 +-
src/main/main.c                                 | 2586 +------
src/main/pgpool_main.c                          | 2383 +++++++
src/main/pool_globals.c                         |    1 +
src/parallel_query/pool_rewrite_outfuncs.c      |    1 +
src/parser/Makefile.am                          |    4 +-
src/parser/Makefile.in                          |   87 +-
src/parser/copyfuncs.c                          |    2 +-
src/parser/gram.c                               | 8358 +++++++----------------
src/parser/gram.y                               |    5 +-
src/parser/list.c                               |    4 +-
src/parser/makefuncs.c                          |    2 +-
src/parser/outfuncs.c                           |    6 +-
src/parser/parser.c                             |   41 +-
src/parser/pool_memory.c                        |  342 -
src/parser/pool_string.c                        |    2 +-
src/parser/scan.c                               |   78 +-
src/parser/scan.l                               |    6 +-
src/parser/scansup.c                            |    2 +-
src/parser/snprintf.c                           |    2 +-
src/parser/stringinfo.c                         |    2 +-
src/parser/value.c                              |    2 +-
src/parser/wchar.c                              |  104 +
src/protocol/child.c                            | 1050 ++-
src/protocol/pool_connection_pool.c             |   19 +-
src/protocol/pool_process_query.c               |   16 +-
src/protocol/pool_proto_modules.c               |   59 +-
src/query_cache/pool_memqcache.c                |   52 +-
src/rewrite/pool_timestamp.c                    |    4 +-
src/system_db/pool_system.c                     |   86 +
src/tools/Makefile.in                           |   19 +-
src/tools/fe_memutils.c                         |  131 +
src/tools/pcp/Makefile.in                       |   43 +-
src/tools/pgmd5/Makefile.am                     |    7 +-
src/tools/pgmd5/Makefile.in                     |   25 +-
src/utils/error/elog.c                          | 2438 +++++++
src/utils/mmgr/aset.c                           | 1383 ++++
src/utils/mmgr/mcxt.c                           |  858 +++
src/utils/pool_ip.c                             |    9 +
src/utils/pool_shmem.c                          |   85 +-
src/utils/pool_stream.c                         |    1 +
src/watchdog/Makefile.in                        |   21 +-
src/watchdog/watchdog.c                         |    7 +-
73 files changed, 12542 insertions(+), 9822 deletions(-)



More information about the pgpool-committers mailing list