pgpool2.git
11 years agoFix inappropriate shared memory allocation size for clock hand.
Tatsuo Ishii [Sat, 26 Oct 2013 02:01:22 +0000 (11:01 +0900)]
Fix inappropriate shared memory allocation size for clock hand.

The memory for clock hand was allocated as
sizeof(pool_fsmm_clock_hand)) which is 8 bytes long because the
variable is declared as:

static int *pool_fsmm_clock_hand;

This is plain wrong. The memory size actually needed is only 4 bytes,
which is sizeof(*pool_fsmm_clock_hand)). In other word, the bug
allocated unnecessary 4 bytes, which did nothing bd for the execution
of program. But a bug is a bug.

Per covery report "1111476 Wrong sizeof argument"

11 years agocheckEnv() didn't do anything and always returned 0.
Nozomi Anzai [Tue, 22 Oct 2013 01:17:53 +0000 (10:17 +0900)]
checkEnv() didn't do anything and always returned 0.

11 years agoAvoid to run out free query cache hash index entry.
Tatsuo Ishii [Sat, 19 Oct 2013 03:58:20 +0000 (12:58 +0900)]
Avoid to run out free query cache hash index entry.

If hash index entries are run out, pgpool-II cannot reuse old cache
entry because pgpool-II always expects there's at least one empty hash
index entry. To mitigate the problem, if free hash index entries are run
out, look for victim cache block to reuse the hash index entry.

Per bug #70.

11 years agoFix occasional segfault in query cache + extended protocol.
Tatsuo Ishii [Sat, 19 Oct 2013 03:23:22 +0000 (12:23 +0900)]
Fix occasional segfault in query cache + extended protocol.

When the query is not "cache safe", bind_msg->param_offset was not set
in Bind(). However, Execute() unconditionally uses
bind_msg->param_offset to convert bind parameters to string so that
they can be added to the cached query string and it causes segfault
because bind_msg->param_offset is a garbage. Also logic bug to
calculate bind_msg->param_offset is corrected.

Per bug#76.

11 years agoFix memory allocation size bug in the code path of query cache.
Tatsuo Ishii [Tue, 15 Oct 2013 23:23:54 +0000 (08:23 +0900)]
Fix memory allocation size bug in the code path of query cache.

In execute() memory allocation size is too small incertain case.
No bug has been reported so far, but certainly this is a bug.

11 years agoFix data inconsistency problem with native replication mode + extended protocol case.
Tatsuo Ishii [Tue, 15 Oct 2013 01:37:38 +0000 (10:37 +0900)]
Fix data inconsistency problem with native replication mode + extended protocol case.

It is reported that concurrent INSERT using JDBC driver causes data
difference among database node. This only happens following conditions
are all met:

1) Native replication mode
2) Extended protocol used
3) The portal created by parse message is reused by bind message
4) autocommit is on
5) SERIAL (sequence) is used

Pgpool-II's parse message function knows it has to lock the target
table when INSERT (plus #5) is issued by clients. Unfortunately bind
message function did not know it. Once parse/bind/execute finishes,
pgpool releases the lock obtained by parse because of #4. JDBC wants
to reuse the portal and starts the cycle from bind message, which does
not obtain lock. As as result, lock-free INSERT are floating around
which causes data inconsistency of course.  The solution is, lock the
table in bind phase.

For this bind needs to issue LOCK in extended protocol. This was a
little bit hard because the module (do_command()) to issue internal
SQL command (other than SELECT) does not support extended protocol. To
solve the problem do_query() is modified so that it accepts other than
SELECT because it already accepts extended protocol. The modification
is minimum and is only tested for the case called from insert_lock(). I
do not recommend to replace every occurrence of do_command() with
do_query() at this point.

BTW the reason why the bug is not reported is, most users uses JDBC
with auto commit = off. In this case, the lock obtained by parse
persists until user explicitly issues commit or rollback.

Per bug report by Steve Kuekes in [pgpool-general: 2142].

11 years agoAvoid calling find_primary_node_repeatedly() when standby node goes down.
Tatsuo Ishii [Mon, 7 Oct 2013 01:33:36 +0000 (10:33 +0900)]
Avoid calling find_primary_node_repeatedly() when standby node goes down.

This will reduce the time to failover. Per bug #75, patch modified by
Tatsuo Ishii.

11 years agoFix misuse of the word "degenerate".
Tatsuo Ishii [Sun, 6 Oct 2013 08:51:36 +0000 (17:51 +0900)]
Fix misuse of the word "degenerate".

Correction suggested by Andrew Bruce in [pgpool-general: 2146].

11 years agoModify descriptions about restrictions of parallel mode
Yugo Nagata [Thu, 3 Oct 2013 03:21:14 +0000 (12:21 +0900)]
Modify descriptions about restrictions of parallel mode

Muliple rows INSERT using VALUES are not supported in parallel mode.

11 years agoFix a description about the version where pgpool.pg_ctl is required
Yugo Nagata [Wed, 2 Oct 2013 10:42:14 +0000 (19:42 +0900)]
Fix a description about the version where pgpool.pg_ctl is required

11 years agoFix a typo and descriptions about pgpool.pg_ctl parameter
Yugo Nagata [Wed, 2 Oct 2013 10:37:48 +0000 (19:37 +0900)]
Fix a typo and descriptions about pgpool.pg_ctl parameter

12 years agoFix segfault when pgpool.conf does not set log_standby_delay.
Tatsuo Ishii [Wed, 25 Sep 2013 13:58:07 +0000 (22:58 +0900)]
Fix segfault when pgpool.conf does not set log_standby_delay.

This is caused by wrong initialization for log_standby_delay in
pool_config.l. Per bug#74.

12 years agoFix typo in comment.
Tatsuo Ishii [Wed, 25 Sep 2013 01:41:18 +0000 (10:41 +0900)]
Fix typo in comment.

12 years agoRemove -lcompat because it confuses FreeBSD per bug#15.
Tatsuo Ishii [Fri, 13 Sep 2013 09:11:55 +0000 (18:11 +0900)]
Remove -lcompat because it confuses FreeBSD per bug#15.

12 years agoAdd Makefiles missed in source code reorganization.
Tatsuo Ishii [Thu, 12 Sep 2013 12:45:41 +0000 (21:45 +0900)]
Add Makefiles missed in source code reorganization.

Also incorporate changes from Christoph Berg ([pgpool-general: 2127]).

12 years agoFix a warning/error when compiling with -Werror=format-security.
Tatsuo Ishii [Thu, 12 Sep 2013 12:32:35 +0000 (21:32 +0900)]
Fix a warning/error when compiling with -Werror=format-security.

Patch contributed by Christoph Berg ([pgpool-general: 2127]).

12 years agoFix incorrect time stamp rewriting in replication mode for certain time zones.
Tatsuo Ishii [Wed, 11 Sep 2013 14:21:51 +0000 (23:21 +0900)]
Fix incorrect time stamp rewriting in replication mode for certain time zones.

Time stamp rewriting calls "SELECT now()" to get current
time. Unfortunately the buffer for the current time is too small for
certain time zones such as "02:30". Note that non-30-minutes-time-zone
such as "0900" does not reveal the problem. This explains why we
haven't the bug report until today. Bug reported in [pgpool-general:
2113] and fix provided by Sean Hogan.

12 years agoAdd 4th paramter "master node port number" to recovery script.
Tatsuo Ishii [Tue, 27 Aug 2013 00:25:26 +0000 (09:25 +0900)]
Add 4th paramter "master node port number" to recovery script.

This makes pgpool_setup's life lot easier since it does not need to
check the database cluster dir then guesses the port number of master
database cluster. Because of this, pgpool_setup had to limit the number
of database clusters generated up to 3.

12 years agoAdd lost Makefile while source reorganization.
Tatsuo Ishii [Tue, 27 Aug 2013 00:23:35 +0000 (09:23 +0900)]
Add lost Makefile while source reorganization.

12 years agoUnbreak pgpool_setup.
Tatsuo Ishii [Wed, 21 Aug 2013 11:05:24 +0000 (20:05 +0900)]
Unbreak pgpool_setup.

The command did not work in standalone anymore.

12 years agoRemove pcp directory from the repo root
Yugo Nagata [Wed, 21 Aug 2013 07:18:06 +0000 (16:18 +0900)]
Remove pcp directory from the repo root

Apply Usama's patch (rempcp.patch)

12 years agoSet code name for version 3.4.
Tatsuo Ishii [Sat, 17 Aug 2013 01:37:47 +0000 (10:37 +0900)]
Set code name for version 3.4.

12 years agoFix bug with load balance in replication mode.
Tatsuo Ishii [Sat, 17 Aug 2013 01:21:32 +0000 (10:21 +0900)]
Fix bug with load balance in replication mode.

When load_balance_mode is off in replication mode, SELECT's should be
sent to master node only, rather than sent to all nodes in an
explicit transaction. Also add regression test case for this. Problem
reported in [pgpool-general: 2038].

12 years agoRemove unsed variable.
Tatsuo Ishii [Wed, 14 Aug 2013 22:41:57 +0000 (07:41 +0900)]
Remove unsed variable.

12 years agoFix a typo of the japanese document
Yugo Nagata [Wed, 14 Aug 2013 08:11:21 +0000 (17:11 +0900)]
Fix a typo of the japanese document

12 years agoFix a typo of log message
Yugo Nagata [Wed, 14 Aug 2013 07:47:59 +0000 (16:47 +0900)]
Fix a typo of log message

12 years agoSet version number to 3.4-alpha1
Tatsuo Ishii [Wed, 14 Aug 2013 07:36:53 +0000 (16:36 +0900)]
Set version number to 3.4-alpha1

12 years agoFix for "make dist".
Tatsuo Ishii [Wed, 14 Aug 2013 07:36:04 +0000 (16:36 +0900)]
Fix for "make dist".

12 years agoApply code reorganization maga patch from Muhammad Usama.
Tatsuo Ishii [Wed, 14 Aug 2013 07:08:06 +0000 (16:08 +0900)]
Apply code reorganization maga patch from Muhammad Usama.

Adjust for recent changes in the repository by Tatsuo Ishii.

12 years agoFix typos in installation of pgpool-recovery section.
Tatsuo Ishii [Mon, 12 Aug 2013 23:26:18 +0000 (08:26 +0900)]
Fix typos in installation of pgpool-recovery section.

12 years agoRemove old on disk query cache.
Tatsuo Ishii [Mon, 5 Aug 2013 22:47:44 +0000 (07:47 +0900)]
Remove old on disk query cache.

Patch contributed by Muhammad Usama. Japanese doc changes by Tatsuo Ishii.

12 years agoAdd regression test for bug #68.
Tatsuo Ishii [Mon, 5 Aug 2013 12:40:34 +0000 (21:40 +0900)]
Add regression test for bug #68.

12 years agoFix double free bug with on memory query cache reported in bug #68.
Tatsuo Ishii [Mon, 5 Aug 2013 12:15:41 +0000 (21:15 +0900)]
Fix double free bug with on memory query cache reported in bug #68.

The bug occurs when multiple bind/execute messages come after a parse
message. When a parse messages comes, query context is created along
with temp cache. The pointer to the temp cache is added to the temp
cache array when the query executed. Subsequent bind messages uses the
same temp cache pointer to the cache array. This is the source of
double free bug when the cache array discarded. The solution is, reset
temp cache pointer in the query context when the temp cache buffer is
added to the cache array.

12 years agoFix the version of pgpoolAdmin: 3.3 -> 3.3.0
Nozomi Anzai [Mon, 5 Aug 2013 08:07:05 +0000 (17:07 +0900)]
Fix the version of pgpoolAdmin: 3.3 -> 3.3.0

12 years agoRemove unnecessary function prototype declarations
Yugo Nagata [Fri, 2 Aug 2013 05:39:25 +0000 (14:39 +0900)]
Remove unnecessary function prototype declarations

12 years agoFix typos
Yugo Nagata [Fri, 2 Aug 2013 02:21:42 +0000 (11:21 +0900)]
Fix typos

12 years agoFix a compile error
Yugo Nagata [Wed, 31 Jul 2013 01:39:03 +0000 (10:39 +0900)]
Fix a compile error

12 years agoFix watchdog test script.
Tatsuo Ishii [Tue, 30 Jul 2013 13:29:30 +0000 (22:29 +0900)]
Fix watchdog test script.

12 years agoFix bug with wd_init_interlock pointed out in [pgpool-general: 1956].
Tatsuo Ishii [Tue, 30 Jul 2013 13:30:31 +0000 (22:30 +0900)]
Fix bug with wd_init_interlock pointed out in [pgpool-general: 1956].

It writes too much than allocated memory.

12 years agoFix to add test/regression/ for make dist.
Tatsuo Ishii [Tue, 30 Jul 2013 12:36:33 +0000 (21:36 +0900)]
Fix to add test/regression/ for make dist.

12 years agoFix to remove test results of watchdog.
Tatsuo Ishii [Tue, 30 Jul 2013 12:34:08 +0000 (21:34 +0900)]
Fix to remove test results of watchdog.

12 years agoRewrite descriptions about condition of watchdog's lifecheck starting V3_3_0
Yugo Nagata [Tue, 30 Jul 2013 07:43:02 +0000 (16:43 +0900)]
Rewrite descriptions about condition of watchdog's lifecheck starting

12 years agoPrepare 3.3
Yugo Nagata [Tue, 30 Jul 2013 07:34:50 +0000 (16:34 +0900)]
Prepare 3.3

12 years agoPrepare 3.3
Yugo Nagata [Tue, 30 Jul 2013 06:38:12 +0000 (15:38 +0900)]
Prepare 3.3

12 years agoFix a hang that occurs when mutiple pgpools startup before all backend startup
Yugo Nagata [Tue, 30 Jul 2013 06:32:41 +0000 (15:32 +0900)]
Fix a hang that occurs when mutiple pgpools startup before all backend startup

Specify a timeout value for lock-waiting loops.

12 years agoFix bug in parsing prepared statements with transaction handling in replication mode...
Tatsuo Ishii [Mon, 29 Jul 2013 14:52:41 +0000 (23:52 +0900)]
Fix bug in parsing prepared statements with transaction handling in replication mode reported in [pgpool-general: 1877].

Parse() automatically starts a transaction for non SELEC query to keep
consistency among nodes in replication mode. But it does not set
allow_close_transaction variable. If wrong query comes in, the
transaction goes into an abort state but pgpool does not close the
transaction. Thus next query causes error because the transaction is
still in abort status.

12 years agoPrevious commit is incomplete.
Tatsuo Ishii [Mon, 29 Jul 2013 14:46:16 +0000 (23:46 +0900)]
Previous commit is incomplete.

Fix some of test.sh to handle pgbench path correctly.

12 years agoFix pgbench path detection.
Tatsuo Ishii [Sun, 28 Jul 2013 10:46:04 +0000 (19:46 +0900)]
Fix pgbench path detection.

-b option specifies pgbench installed directory. But actually
regress.sh main script sets pgbench full path. I think what the main
script does is appropreate because it gives more flxibility. If -b is
not specifiedm, first search pgbench under PostgreSQL installation
directory. If not found, try to locate in command search path. If not
found, the gives up.

Also fix the behavior when PostgreSQL installation directory is not
found. It just exited in a sub shell and it continued to run.

12 years agoEnhance pgpool_setup and regression test suite.
Tatsuo Ishii [Fri, 26 Jul 2013 05:51:26 +0000 (14:51 +0900)]
Enhance pgpool_setup and regression test suite.

Patch contributed by Muhammad Usama. Below is the comment from him:

I tried to make some changes in the regression script, mainly because the
script uses lot of hard coded paths and regression starts reporting
failures if the pgpool-II or PostgreSQL are not found at the default path.

Please find the attached patch which enables the regress.sh script to
install the pgpool on fly in temp directory to run the tests on it
(optional), and now the regress script takes some additional arguments to
specify the paths of required components.

The list of all arguments accepted by regress.sh script as implemented by
the attached patch are
pgpool2/test/regression$ sh regress.sh -?
Usage:
  regress.sh: [Options]... [test_name]

Options:
  -p   DIRECTORY           Postgres installed directory
  -b   DIRECTORY           pgbench installed directory, if different from
Postgres installed directory
  -i   DIRECTORY           pgpool installed directory, if already installed
pgpool is to be used for tests
  -m   install/noinstall   make install pgpool to temp directory for
executing regression tests [Default: install]
  -j    FILE               Postgres jdbc jar file path
  -?                       print this help and then exit

12 years agoAdd internal links in Japanese release notes.
Nozomi Anzai [Fri, 26 Jul 2013 05:46:34 +0000 (14:46 +0900)]
Add internal links in Japanese release notes.

12 years agoFix a bug of setting heartbeat_destination parameter V3_3_0_RC1
Yugo Nagata [Thu, 25 Jul 2013 08:19:03 +0000 (17:19 +0900)]
Fix a bug of setting heartbeat_destination parameter

12 years agoFix some comments, messages and variables
Yugo Nagata [Thu, 25 Jul 2013 06:20:36 +0000 (15:20 +0900)]
Fix some comments, messages and variables

12 years agoFix PATH variable to prioritize pghome
Yugo Nagata [Thu, 25 Jul 2013 06:03:30 +0000 (15:03 +0900)]
Fix PATH variable to prioritize pghome

12 years agoFix to configure path to bin/lib of postgresql92 and pgpoolAdmin tar ball
Yugo Nagata [Thu, 25 Jul 2013 05:42:41 +0000 (14:42 +0900)]
Fix to configure path to bin/lib of postgresql92 and pgpoolAdmin tar ball

12 years agoPrepare 3.3.0-RC1
Yugo Nagata [Thu, 25 Jul 2013 03:29:12 +0000 (12:29 +0900)]
Prepare 3.3.0-RC1

12 years agoMerge branch 'master' of ssh://git.postgresql.org/pgpool2
Nozomi Anzai [Thu, 25 Jul 2013 05:14:48 +0000 (14:14 +0900)]
Merge branch 'master' of ssh://git.postgresql.org/pgpool2

12 years agoAdd debug mode of install.sh itself so that script becomes quiet.
Nozomi Anzai [Thu, 25 Jul 2013 05:11:47 +0000 (14:11 +0900)]
Add debug mode of install.sh itself so that script becomes quiet.

12 years agoFix typos
Yugo Nagata [Thu, 25 Jul 2013 03:22:19 +0000 (12:22 +0900)]
Fix typos

12 years agoPrepare 3.3.0-RC1
Yugo Nagata [Thu, 25 Jul 2013 03:17:30 +0000 (12:17 +0900)]
Prepare 3.3.0-RC1

12 years agoPrepare 3.3.0-RC1
Yugo Nagata [Thu, 25 Jul 2013 03:11:04 +0000 (12:11 +0900)]
Prepare 3.3.0-RC1

12 years agoFix mistake in ssh command.
Tatsuo Ishii [Thu, 25 Jul 2013 01:00:27 +0000 (10:00 +0900)]
Fix mistake in ssh command.

12 years agoMerge branch 'master' of ssh://git.postgresql.org/pgpool2
Nozomi Anzai [Wed, 24 Jul 2013 06:59:20 +0000 (15:59 +0900)]
Merge branch 'master' of ssh://git.postgresql.org/pgpool2

12 years agoAdd the description about pgpool.pg_ctl.
Nozomi Anzai [Wed, 24 Jul 2013 06:56:56 +0000 (15:56 +0900)]
Add the description about pgpool.pg_ctl.
Some visual improvements.

12 years agoFix typos of the version name
Yugo Nagata [Wed, 24 Jul 2013 04:56:13 +0000 (13:56 +0900)]
Fix typos of the version name

12 years agoFix to not print netmask to pg_hba.conf if node is specified by hostname
Yugo Nagata [Tue, 23 Jul 2013 07:23:42 +0000 (16:23 +0900)]
Fix to not print netmask to pg_hba.conf if node is specified by hostname

12 years agoFix a bug that password-less ssh setting fails when postgres user home isn't /home...
Yugo Nagata [Tue, 23 Jul 2013 06:34:34 +0000 (15:34 +0900)]
Fix a bug that password-less ssh setting fails when postgres user home isn't /home/postgres

12 years agoFix to remove /vaw/www/html/pgpoolAdmin directory in uninstall.sh
Yugo Nagata [Tue, 23 Jul 2013 06:28:44 +0000 (15:28 +0900)]
Fix to remove /vaw/www/html/pgpoolAdmin directory in uninstall.sh

12 years agoAdd pcp_watchdog_info to pgpool.spec
Yugo Nagata [Tue, 23 Jul 2013 05:03:15 +0000 (14:03 +0900)]
Add pcp_watchdog_info to pgpool.spec

12 years agoAdd watchdog test.
Tatsuo Ishii [Tue, 23 Jul 2013 04:36:37 +0000 (13:36 +0900)]
Add watchdog test.

Currently the test is minimum. It just checks standby->master
escalation.

12 years agoFix "deploy" section.
Tatsuo Ishii [Mon, 22 Jul 2013 23:09:04 +0000 (08:09 +0900)]
Fix "deploy" section.

This should had been updated when watchdog is introduced.

12 years agoFix to not bind network devices to sockets when heartbeat_device parameter is empty
Yugo Nagata [Mon, 22 Jul 2013 09:59:14 +0000 (18:59 +0900)]
Fix to not bind network devices to sockets when heartbeat_device parameter is empty

12 years agoFix bug introduced in 8b803e1ea38c3ac9a7775f7fb9ba43870bca7dca (Add wait_for_pgpool_r...
Tatsuo Ishii [Mon, 22 Jul 2013 08:41:32 +0000 (17:41 +0900)]
Fix bug introduced in 8b803e1ea38c3ac9a7775f7fb9ba43870bca7dca (Add wait_for_pgpool_reload function).
Add -p option to specify start port #.

12 years agoFix bug with health check when used with child_life_time reported in [pgpool-general...
Tatsuo Ishii [Sat, 20 Jul 2013 03:58:09 +0000 (12:58 +0900)]
Fix bug with health check when used with child_life_time reported in [pgpool-general: 1892].

Here is the explanation why the problem occurs:

--------------------------------------------------------------------------------
Ok. I think I finally understand what's going on here.

Pgpool main process (14317) started health checking at Jul 12 09:17:04.

Jul 12 09:17:04 purple1-node1-ps pgpool[14317]: starting health checking

Pgpool main process set timer at 09:17:14 because you set
health_check_timeout 10.  This time the health check successfully
completed. The timer for 09:17:14 is blocked by calling
signal(SIGALRM, SIG_IGN).

Unfortunately child life time was expired at 09:17:14 and pgpool main
process was busy at the time because of this.

Jul 12 09:17:14 purple1-node1-ps pgpool[16789]: child life 300 seconds expired
Jul 12 09:17:14 purple1-node1-ps pgpool[14317]: reap_handler called

Jul 12 09:17:14 purple1-node1-ps pgpool[14317]: starting health checking

Pgpool main re-enabled the timer and reset the timer variable
(health_check_timer_expired = 0). But when the timer re-enabled, the
signal handler for the timer set health_check_timer_expired to 1.  As
a result pgpool thought that health check timer was expired.

Jul 12 09:17:14 purple1-node1-ps pgpool[14317]: health_check: health check timer has been already expired before attempting to connect to 0 th backend

Thus failover happend even if the backend was running fine.
--------------------------------------------------------------------------------

To fix the problem new macro CLEAR_ALARM, which calls alarm(0) until
all pending alarms are cleared, is defined and used whenever necessary
to cancel health check timer. Also before forking off child process
health_check_timer_expire is explicitely cleared.

Also this causes the error message.

Jul 12 09:32:14 purple1-node1-ps pgpool[11465]: connect_inet_domain_socket_by_port: health check timer expired

Process 11465 is a child process and is not supposed to run into this
situation. This is caused because the global variable
"health_check_timer_expired" is set to 1 before the new child is
forked off after child_life_time expired is set to 1. This could if
SIGCHLD signal is received at the moment when the bug below happens.
To make sure this never happens in connect_inet_domain_socket_by_port
checks health_check_timer_expired only if it is a main process.

12 years agoFix bug reported in bug #62 (main process segfault).
Tatsuo Ishii [Sat, 20 Jul 2013 03:34:37 +0000 (12:34 +0900)]
Fix bug reported in bug #62 (main process segfault).

The bug report showed main process died after the log:

Jun 22 10:23:20 pgpool[32629]: pool_read: read failed (Connection reset by peer)
Jun 22 10:23:20 pgpool[32629]: notice_backend_error: called from pgpool main. ignored.
Jun 22 10:23:20 pgpool[32629]: child_exit: called from pgpool main. ignored.
Jun 22 10:23:20 kernel: [11850568.371509] pgpool[32629]: segfault at 6f0ff2 ip 00007fbd7ed9811f sp 00007fff27275f08 error 4 in libc-2.15.so[7fbd7ec49000+1b5000]

This indicates that after reading from socket while health checking
failed, it tried to initiate failover by calling notice_backend_error,
which is not appropriate because that should be handled in the health
check logic. So it is ignored. So far so good. pool_read called
child_exit after that and again it was ignored. This is also
good. Problem is, it continued to run with undefined read length from
read(2). Finally pool_read call memmove with the undefined length to
update its internal buffer, which could cause segfault depending on
the value of the read length.

Fix is, after child_exit, return with -1 to indicate error was
happened. Also I fixed the code after pool_check_fd fails. Before it
just exits process, which is never good for pgpool main
process. Although I don't think the case ever happened because I never
saw single error report which showed the case.

12 years agoUpdate JDBC driver version.
Tatsuo Ishii [Sat, 20 Jul 2013 03:34:22 +0000 (12:34 +0900)]
Update JDBC driver version.

12 years agoAdd descriptions of pcp_watchdog_info to documents
Yugo Nagata [Fri, 19 Jul 2013 05:23:58 +0000 (14:23 +0900)]
Add descriptions of pcp_watchdog_info to documents

12 years agoRemove a FIXME comment
Yugo Nagata [Tue, 16 Jul 2013 09:52:57 +0000 (18:52 +0900)]
Remove a FIXME comment

12 years agoRemove a comment
Yugo Nagata [Tue, 16 Jul 2013 09:40:34 +0000 (18:40 +0900)]
Remove a comment

12 years agoAdd pcp_watchdog_info command
Yugo Nagata [Tue, 16 Jul 2013 09:28:51 +0000 (18:28 +0900)]
Add pcp_watchdog_info command

pcp_watchdog_info displays pgpool-II watchdog's information.

Usage: pcp_watchdog_info [-d] timeout hostname port# username password [watchdogID]
  -d, --debug    : enable debug message (optional)
  timeout        : connection timeout value in seconds. command exits on timeout
  hostname       : pgpool-II hostname
  port#          : PCP port number
  username       : username for PCP authentication
  password       : password for PCP authentication
  watchdogID     : ID of a other pgpool to get information for
                   If omitted then get one's self information

12 years agoAdd a missing item to japanese release notes
Yugo Nagata [Tue, 16 Jul 2013 04:22:54 +0000 (13:22 +0900)]
Add a missing item to japanese release notes

12 years agoAdd a missing item to release notes
Yugo Nagata [Tue, 16 Jul 2013 04:19:53 +0000 (13:19 +0900)]
Add a missing item to release notes

12 years agoAdd release notes of minor version up
Yugo Nagata [Wed, 10 Jul 2013 04:55:21 +0000 (13:55 +0900)]
Add release notes of minor version up

12 years agoFix typos
Yugo Nagata [Mon, 8 Jul 2013 05:16:33 +0000 (14:16 +0900)]
Fix typos

12 years agoFix a typo
Yugo Nagata [Mon, 8 Jul 2013 02:55:30 +0000 (11:55 +0900)]
Fix a typo

12 years agoFix to verify the backend node number in pcp_recovery_node
Yugo Nagata [Mon, 8 Jul 2013 01:23:25 +0000 (10:23 +0900)]
Fix to verify the backend node number in pcp_recovery_node

When an invalid number is used, null value is passed as an arguments
of recovery script, and this causes a malfunction. In especially,
rsync may delete unrelated files in basebackup scripts.

12 years agoAdd wait_for_pgpool_reload function
Yugo Nagata [Mon, 8 Jul 2013 01:18:50 +0000 (10:18 +0900)]
Add wait_for_pgpool_reload function

This avoids pgpool recovery before new backends information reloaded.

12 years agoAdd ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document.
Yugo Nagata [Fri, 5 Jul 2013 05:57:27 +0000 (14:57 +0900)]
Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document.

12 years agoMove ssl_ca_cert and ssl_ca_cert_dir descriptons to the SSL section
Yugo Nagata [Thu, 4 Jul 2013 04:06:15 +0000 (13:06 +0900)]
Move ssl_ca_cert and ssl_ca_cert_dir descriptons to the SSL section

12 years agoFix compile error on Mac OS/X
Tatsuo Ishii [Wed, 3 Jul 2013 07:00:37 +0000 (16:00 +0900)]
Fix compile error on Mac OS/X

Patch contributed by Muhammad Usama.

12 years agoFix execute() in memory allocation logic when memqcache enabled.
Tatsuo Ishii [Tue, 2 Jul 2013 08:13:10 +0000 (17:13 +0900)]
Fix execute() in memory allocation logic when memqcache enabled.

When very long query string (>1024) supplied in extended query with
bind parameters, it fails to allocate enough memory.

12 years agoAdd a tess for the previous commit
Yugo Nagata [Tue, 2 Jul 2013 05:50:10 +0000 (14:50 +0900)]
Add a tess for the previous commit

12 years agoFix segmentation fault of child that occurs when startup packet has
Yugo Nagata [Tue, 2 Jul 2013 02:12:20 +0000 (11:12 +0900)]
Fix segmentation fault of child that occurs when startup packet has
no PostgreSQL user information.

When a startup packet has no PostgreSQL user specified, pgpool-II
terminated abnormally. You can reproduce it by

 $ psql -p 9999 -U ''

If enable_pool_hba is on, a child process terminates by segmentation
fault. Otherwise if enable_pool_hba is off, the error message is

 ERROR: pool_discard_cp: cannot get connection pool for user (null) database (null)

In both cases, psql terminates with no message on frontend.

To resolve it, if PostgreSQL user is not specified in startup packet,
the message as following is output to both log and frontend. This is
the same behavior as PostgreSQL.

 FATAL: no PostgreSQL user name specified in startup packet

12 years agoAdd regression test for bug#63.
Tatsuo Ishii [Sun, 30 Jun 2013 08:25:45 +0000 (17:25 +0900)]
Add regression test for bug#63.

12 years agoFix memqcache segfaults reported in bug#63.
Tatsuo Ishii [Sun, 30 Jun 2013 08:05:04 +0000 (17:05 +0900)]
Fix memqcache segfaults reported in bug#63.

When a query executes and the query result is too large,
query_context->temp_cache is discarded the query result is not
committed to cache storage when the query completed. In extended query
mode, it is possible that the same query context is used for
subsequent bind/execute cycle through reusing the portal. Problem is,
query_context->temp_cache is already gone and a segfault is caused by
accessing the pointer. To fix this, when query_context->temp_cache is
discarded, set the pointer to NULL and whenever access
query_context->temp_cache, check it is NULL or not.

12 years agoFix pg_md5 command crash.
Tatsuo Ishii [Sat, 29 Jun 2013 09:21:33 +0000 (18:21 +0900)]
Fix pg_md5 command crash.

Fix contributed by Muhammad Usama(from [pgpool-hackers: 302])

While looking at the pgpool-II code I found a potential crash or stack
smash in pg_md5 utility.
The problem is update_pool_passwd() calls pg_md5_encrypt() function to get
the md5 password, and the password format generated by pg_md5_encrypt()
function is
"md5" followed by 32-hex digits, which sums up to 35 characters while the
host variable defined in update_pool_passwd() function to hold this
password can contain maximum 32 characters.

12 years agoAdd new regression test.
Tatsuo Ishii [Wed, 26 Jun 2013 09:50:01 +0000 (18:50 +0900)]
Add new regression test.

12 years agoFix comment.
Tatsuo Ishii [Wed, 26 Jun 2013 09:48:23 +0000 (18:48 +0900)]
Fix comment.

12 years agoFix pgpool -m f stop" hang.
Tatsuo Ishii [Wed, 26 Jun 2013 09:17:11 +0000 (18:17 +0900)]
Fix pgpool -m f stop" hang.

This is caused by unmanaged pgpool children remaining.  This could
happen if multiple PostgreSQL are going down (or even starting pgpool,
without starting PostgreSQL can easily trigger this).  Child calls
degenerate_backend_set() and it tries to aquire semaphore to write a
failover request. In this case the signal mask is set as well, thus
signals are never received. To fix this, kill pgpool children before
forking them.

12 years agoFix failover.sh to not cause shell error in certain cases.
Tatsuo Ishii [Wed, 26 Jun 2013 05:49:26 +0000 (14:49 +0900)]
Fix failover.sh to not cause shell error in certain cases.

If not all arguments are supplied (this could happen if no available
backend exists, for example), the script could fail.

12 years agoFix comment in create_failover_script() and create_follow_master_script().
Tatsuo Ishii [Wed, 26 Jun 2013 05:34:58 +0000 (14:34 +0900)]
Fix comment in create_failover_script() and create_follow_master_script().