From: Tatsuo Ishii Date: Sat, 3 Feb 2007 04:22:21 +0000 (+0000) Subject: Add support for log_hostname X-Git-Tag: V3_2~5 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=69bd41066d54b60c117d3614d942fd33d9dee79b;p=pgpool1.git Add support for log_hostname Prepare for 3.2 --- diff --git a/ChangeLog b/ChangeLog index 232a44e..8dde6f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-02-XX + * Version 3.2 + * Support HBA authentication(Taiki) + * Support log_connections(Taiki) + * Support log_hostname(Tatsuo) + * Show pgpool status in ps command(Tatsuo) + * Fix bug with prepared query(Yoshiyuki) + 2006-12-12 * Version 3.1.2 * Allow 0 weight(Tatsuo) diff --git a/NEWS b/NEWS index d29d26f..9930a4e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,15 @@ +3.2(kalekale) 2007/2/XX + o HBAǧ¾Ú¤ò¥µ¥Ý¡¼¥È¤·¤¿(Taiki) + + o log_connections¤ò¥µ¥Ý¡¼¥È¤·¤¿(Taiki) + + o log_hostname¤ò¥µ¥Ý¡¼¥È¤·¤¿(Tatsuo) + + o ps¥³¥Þ¥ó¥É¤Çpgpool¤Î¾õÂÖ¤¬¤ï¤«¤ë¤è¤¦¤Ë¤·¤¿(Tatsuo) + + o prepared object¤ÎPHP PDO, Perl DBD-PgÍøÍÑ»þ¤Î¼«Æ°²òÊüµ¡Ç½¤Î + ¥Ð¥°¤ò½¤Àµ(Yoshiyuki) + 3.1.2(kawakawa) 2006/12/12 o weight ¤Ë 0 ¤ò»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿(Tatsuo) @@ -6,7 +18,7 @@ Kikuchi »á¡£ o COPY FROM STDIN ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ë kind mismatch ¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²Ä - ǽÀ­¤¬¥Ð¥°¤ò½¤Àµ(Yoshiyuki) + ǽÀ­¤¬¤¢¤ë¥Ð¥°¤ò½¤Àµ(Yoshiyuki) o ³ÈÄ¥Ì䤤¹ç¤ï¤»¥×¥í¥È¥³¥ë¤ò»È¤Ã¤¿¥¯¥¨¥ê¤ò¥í¡¼¥É¥Ð¥é¥ó¥¹¤Ç¤­¤ë¤è¤¦¤Ë ¤·¤¿(Yoshiyuki) diff --git a/README b/README index 353553d..48e6650 100644 --- a/README +++ b/README @@ -189,6 +189,7 @@ pgpool version 3.1 README Here are small lists from users where pgpool is running: + Vine Linux 4.0 (kernel 2.6.16-0vl166)/PostgreSQL 8.2.1 Vine Linux 3.2 (kernel 2.4.31-0vl1.10)/PostgreSQL 8.1.1 Vine Linux 2.6r4 (kernel 2.4.22-0vl2.12)/PostgreSQL 8.1.0 Vine Linux 2.6r4 (kernel 2.4.22-0vl2.12)/PostgreSQL 8.0.3 @@ -676,6 +677,7 @@ pgpool version 3.1 README num_reset_queries | 3 | number of queries in reset_query_list log_statement | 0 | if true, print all statements to the log log_connections | 1 | if true, print incoming connections to the log + log_hostname | 0 | if true, resolve hostname for ps and log print enable_pool_hba | 1 | if true, use pool_hba.conf for client authentication server_status | master( on 5432) up secondary( on 5433) up | server status (39 rows) diff --git a/README.euc_jp b/README.euc_jp index b163aea..049f754 100644 --- a/README.euc_jp +++ b/README.euc_jp @@ -1,6 +1,6 @@ $Header$ -pgpool version 3.1(kalekale) README +pgpool version 3.2(kalekale) README 1. pgpool¤È¤Ï @@ -308,6 +308,7 @@ pgpool version 3.1(kalekale) README Âбþ¤¹¤ëOS¤ÏÆÃ¤ËÀ©¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡¥°Ê²¼¡¤Æ°ºî¤¬³Îǧ¤µ¤ì¤¿´Ä¶­¤Ç¤¹¡¥ + Vine Linux 4.0 (kernel 2.6.16-0vl166)/PostgreSQL 8.2.1 Vine Linux 3.2 (kernel 2.4.31-0vl1.10)/PostgreSQL 8.1.1 Vine Linux 2.6r4 (kernel 2.4.22-0vl2.12)/PostgreSQL 8.1.0 Vine Linux 2.6r4 (kernel 2.4.22-0vl2.12)/PostgreSQL 8.0.3 @@ -670,6 +671,12 @@ pgpool version 3.1(kalekale) README true¤Ê¤é¤Ð¡¢Á´¤Æ¤Î¥¯¥é¥¤¥¢¥ó¥ÈÀܳ¤ò¥í¥°¤Ø½ÐÎϤ·¤Þ¤¹¡£ + log_hostname + + true¤Ê¤é¤Ð¡¤ps¥³¥Þ¥ó¥É¤Ç¤Î¾õÂÖɽ¼¨»þ¤ËIP¥¢¥É¥ì¥¹¤Ç¤Ï¤Ê¤¯¡¤¥Û¥¹¥È̾ + ¤òɽ¼¨¤·¤Þ¤¹¡¥¤Þ¤¿¡¤log_connections¤¬Í­¸ú¤Ê¾ì¹ç¤Ë¤Ï¥í¥°¤Ë¥Û¥¹¥È̾¤ò + ½ÐÎϤ·¤Þ¤¹¡¥ + enable_pool_conf true¤Ê¤é¤Ð¡¢pool_hba.conf¤Ë½¾¤Ã¤Æ¥¯¥é¥¤¥¢¥ó¥Èǧ¾Ú¤ò¹Ô¤¤¤Þ¤¹¡£pgpool @@ -743,7 +750,7 @@ pgpool version 3.1(kalekale) README ¤Ç¤­¤Þ¤¹¡£pgpool¤òPAM¥µ¥Ý¡¼¥ÈÉÕ¤­¤Ç¥Ó¥ë¥É¤¹¤ë¤Ë¤Ïconfigure¥ª¥×¥·¥ç ¥ó¤Ë"--with-pam"¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£ - configure --with-pam + ./configure --with-pam 8. pgpool¤Îµ¯Æ° @@ -902,6 +909,7 @@ pgpool version 3.1(kalekale) README num_reset_queries | 3 | number of queries in reset_query_list log_statement | 0 | if true, print all statements to the log log_connections | 1 | if true, print incoming connections to the log + log_hostname | 0 | if true, resolve hostname for ps and log print enable_pool_hba | 1 | if true, use pool_hba.conf for client authentication server_status | master( on 5432) up secondary( on 5433) up | server status (39 rows) diff --git a/configure b/configure index 6cde5b6..2dcc88c 100755 --- a/configure +++ b/configure @@ -718,13 +718,13 @@ echo X"$0" | /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then + if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r "$srcdir/$ac_unique_file"; then +if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } @@ -733,7 +733,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then { (exit 1); exit 1; }; } fi fi -(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null || +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` @@ -2604,7 +2604,7 @@ fi # Define the identity of the package. PACKAGE=pgpool - VERSION=3.1.2 + VERSION=3.2 cat >>confdefs.h <<_ACEOF diff --git a/configure.in b/configure.in index 588450a..2f3abe4 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ AC_INIT dnl Checks for programs. AC_PROG_CC -AM_INIT_AUTOMAKE(pgpool, 3.1.2) +AM_INIT_AUTOMAKE(pgpool, 3.2) AM_PROG_LEX diff --git a/pgpool.conf.sample b/pgpool.conf.sample index 5fe90af..ad5d851 100644 --- a/pgpool.conf.sample +++ b/pgpool.conf.sample @@ -128,6 +128,11 @@ log_statement = false # If true, incoming connections will be printed to the log. log_connections = false +# If true, hostname will be shown in ps status. Also shown in +# connection log if log_connections = true. +# Be warned that this feature will add overhead to look up hostname. +log_hostname = false + # - HBA - # If true, use pool_hba.conf for client authentication. In pgpool 3.2, diff --git a/pool.h b/pool.h index 410436f..4f5772b 100644 --- a/pool.h +++ b/pool.h @@ -165,6 +165,7 @@ typedef struct { int server_status[MAX_CONNECTION_SLOTS]; /* server status 0:unused, 1:up, 2:down */ int log_statement; /* 0:false, 1: true - logs all SQL statements */ int log_connections; /* 0:false, 1:true - logs incoming connections */ + int log_hostname; /* 0:false, 1:true - resolve hostname */ int enable_pool_hba; /* 0:false, 1:true - enables pool_hba.conf file authentication */ } POOL_CONFIG; diff --git a/pool_config.c b/pool_config.c index 13fcdce..b99177b 100644 --- a/pool_config.c +++ b/pool_config.c @@ -1677,6 +1677,7 @@ int pool_get_config(char *confpath) pool_config.num_servers = 0; pool_config.log_statement = 0; pool_config.log_connections = 0; + pool_config.log_hostname = 0; pool_config.enable_pool_hba = 0; #define PARSE_ERROR() pool_error("pool_config: parse error at line %d '%s'", Lineno, yytext) @@ -2167,6 +2168,17 @@ int pool_get_config(char *confpath) } pool_config.log_connections = v; } + else if (!strcmp(key, "log_hostname")) + { + int v = eval_logical(yytext); + + if (v < 0) + { + pool_error("pool_config: invalid value %s for %s", yytext, key); + return(-1); + } + pool_config.log_hostname = v; + } else if (!strcmp(key, "enable_pool_hba")) { int v = eval_logical(yytext); diff --git a/pool_config.l b/pool_config.l index f40062d..97cba2c 100644 --- a/pool_config.l +++ b/pool_config.l @@ -139,6 +139,7 @@ int pool_get_config(char *confpath) pool_config.num_servers = 0; pool_config.log_statement = 0; pool_config.log_connections = 0; + pool_config.log_hostname = 0; pool_config.enable_pool_hba = 0; #define PARSE_ERROR() pool_error("pool_config: parse error at line %d '%s'", Lineno, yytext) @@ -629,6 +630,17 @@ int pool_get_config(char *confpath) } pool_config.log_connections = v; } + else if (!strcmp(key, "log_hostname")) + { + int v = eval_logical(yytext); + + if (v < 0) + { + pool_error("pool_config: invalid value %s for %s", yytext, key); + return(-1); + } + pool_config.log_hostname = v; + } else if (!strcmp(key, "enable_pool_hba")) { int v = eval_logical(yytext); diff --git a/pool_ip.c b/pool_ip.c index 3dfd7d4..8de9d41 100644 --- a/pool_ip.c +++ b/pool_ip.c @@ -82,7 +82,7 @@ void pool_getnameinfo_all(SockAddr *saddr, char *remote_host, char *remote_port) if (getnameinfo_all(&saddr->addr, saddr->salen, remote_host, NI_MAXHOST, remote_port, NI_MAXSERV, - NI_NUMERICSERV)) + (pool_config.log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) { int ret = getnameinfo_all(&saddr->addr, saddr->salen, remote_host, NI_MAXHOST, diff --git a/pool_process_query.c b/pool_process_query.c index 0ebeb89..c487a85 100644 --- a/pool_process_query.c +++ b/pool_process_query.c @@ -2262,6 +2262,11 @@ static void process_reporting(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *b status[i].desc = "if true, print incoming connections to the log"; i++; + status[i].name = "log_hostname"; + snprintf(status[i].value, MAXVALLEN, "%d", pool_config.log_hostname); + status[i].desc = "if true, resolve hostname for ps and log print"; + i++; + status[i].name = "enable_pool_hba"; snprintf(status[i].value, MAXVALLEN, "%d", pool_config.enable_pool_hba); status[i].desc = "if true, use pool_hba.conf for client authentication";