Yugo Nagata [Wed, 6 Jan 2016 04:13:01 +0000 (13:13 +0900)]
Fix regression test 003.failover for rhel7 postgresql rpm
The expected result of 'show pool_nodes' is fixed to use
PGSOCKET_DIR in hostname column.
Yugo Nagata [Tue, 5 Jan 2016 08:42:02 +0000 (17:42 +0900)]
Add missing \n in help messages
Yugo Nagata [Fri, 25 Dec 2015 05:46:46 +0000 (14:46 +0900)]
Fix to use timeout command to handle time out of regress test 062
Yugo Nagata [Mon, 28 Dec 2015 02:18:08 +0000 (11:18 +0900)]
doc: Add restriction about starting multiple pgpool simultaneously
Tatsuo Ishii [Wed, 2 Dec 2015 10:37:14 +0000 (19:37 +0900)]
Fix bug with "SET TRANSACTION READ ONLY".
Pgpool-II remembers that non read only queries (including SET) were
executed in an explicit transaction and adds a "writing transaction"
mark to the transaction. The mark affects the query routing behavior
of pgpool-II while running in streaming replication mode. Pgpool-II
starts sending queries to the primary after the mark is set. Because
the effect of writing queries may appear on standbys after some delay
in streaming replication mode, it is safer to route read queries to
the primary after the mark is set.
However there's oversight here. "SET TRANSACTION READ ONLY" does no
data modification and should be treated as an exception.
Per bug #157.
Muhammad Usama [Wed, 18 Nov 2015 13:58:49 +0000 (18:58 +0500)]
Fixing [pgpool-II
0000139]: broken arping_cmd
wd_chk_setuid() function was bailing out with the error message as soon as it
finds the setuid bit is not set on any configured network command and was
ignoring the rest of configurations.
Yugo Nagata [Wed, 11 Nov 2015 07:00:36 +0000 (16:00 +0900)]
Fix previous commit for regression test 055
Yugo Nagata [Wed, 11 Nov 2015 07:00:36 +0000 (16:00 +0900)]
Fix previous commit for regression test 055
Yugo Nagata [Tue, 10 Nov 2015 12:32:14 +0000 (21:32 +0900)]
Fix regression test 055 for rhel7 rpm
Yugo Nagata [Mon, 9 Nov 2015 10:32:40 +0000 (19:32 +0900)]
Fix a bug of regress.sh option handling
Yugo Nagata [Mon, 9 Nov 2015 05:20:50 +0000 (14:20 +0900)]
Add missing descriptions about default values to documents
Yugo Nagata [Thu, 5 Nov 2015 17:29:28 +0000 (02:29 +0900)]
Fix the previous commit's echo missing redirect to conf file
Yugo Nagata [Wed, 4 Nov 2015 09:30:20 +0000 (18:30 +0900)]
Add option to regress.sh and pgpool_setup for unix domain socket directory
The new option of regress.sh is -s to specivy unix domain socket
directory. Default is /tmp. And environment variable PGSOCKET_DIR
is added for pgpool_setup
Yugo Nagata [Wed, 4 Nov 2015 07:28:23 +0000 (16:28 +0900)]
Fix pgpool_setup to use DEFAULT_PGSOCKET_DIR in pg_config_manual.h
Some Postgresql rpms define DEFAULT_PGSOCKET_DIR as /tmp, others as
/var/run/postgresql. This affects not only PostgreSQL server but
also libpq and psql.
This is a workaround for regression test. We might have to fix
pgpool-II code to control default value of backend_hostname*.
Yugo Nagata [Wed, 4 Nov 2015 04:56:27 +0000 (13:56 +0900)]
Force pgpool_setup to set unix_socket_directories to '/tmp'
This is a workaround for PostgreSQL RHEL7 RPM, which sets
it to '/var/run/postgresql'.
Tatsuo Ishii [Sat, 31 Oct 2015 00:35:30 +0000 (09:35 +0900)]
Unbreak "make dist".
While removing some directories under src/test, Makefile.am was left
unchaged and "make dist" has been broken since then.
Tatsuo Ishii [Fri, 30 Oct 2015 06:08:42 +0000 (15:08 +0900)]
Ignore close statement/portal request if they do not exist.
In this case just returns a close complete message to client.
This is a back port of commit:
1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0
which should have been back ported earlier.
Tatsuo Ishii [Thu, 29 Oct 2015 04:26:44 +0000 (13:26 +0900)]
Fix regression test 065.
The path to JDBC driver was explicitly defined. This is wrong. This
should be inherited from JDBC_DRIVER environment variable.
Tatsuo Ishii [Mon, 19 Oct 2015 04:20:05 +0000 (13:20 +0900)]
Fix in memory query cache bug reported in bug#152.
If extended query protocol is used and a bind/execute message arrives
which uses a statement created by prior parse message, the temp_cache
is not initialized by a parse messages. Thus messages are added to pre
existing temp cache buffer which causes the trouble (when the cached
result returns, Data Row message and Command Complete message appeared
*twice*).
Also new regression test is added to check the bug.
t-ishii@localhost:
Tatsuo Ishii [Fri, 16 Oct 2015 05:32:24 +0000 (14:32 +0900)]
Update copyright year.
Tatsuo Ishii [Wed, 14 Oct 2015 03:09:42 +0000 (12:09 +0900)]
Fix bugs with data modifying WITH clause reported in bug#153.
pgpool-II does not recognize the data modifying WITH clause despite
pgpool-II 3.3 or after has SQL parser which recognizes it. The bug has
been fixed in pgpool-II 3.5 (having PostgreSQL 9.5 parser).
Data modifying WITH clause was introduced in PostgreSQL 9.1. Since
pgpool-II 3.3 has 9.2 parser and pgpool-II 3.4 has 9.4 parser, the fix
is back ported to pgpool-II 3.3 and 3.4.
Yugo Nagata [Fri, 4 Sep 2015 05:10:39 +0000 (14:10 +0900)]
Fix wrong description in documents about log_standby_delay
Tatsuo Ishii [Thu, 3 Sep 2015 01:28:29 +0000 (10:28 +0900)]
Fix ancient bug of pool_push() and friends.
It allocates buffer using realloc and uses the pointer
returned. However it does the pointer calculation *before* realloc
gets called. So the calculation uses the old pointer value, which
causes various problems including segfault later. It is surprising
that this bug was not found earlier because the bug was there since
the function was added. This is probably due to the fact that actual
pointer moving does not happen until certain amount of memory.
Also there were other problems with it. The buffer pointer and buffer
size variable is not initialized. The buffer is not freed by
pool_close. Typo in debugging message (3.4 or later only). They are
fixed as well.
Tatsuo Ishii [Thu, 27 Aug 2015 04:07:35 +0000 (13:07 +0900)]
Fix regression test driver.
In pgpool-II 3.5, libpcp.a is not compatible with previous ones. This
results in segfault when pcp_recovery_node gets executed if the
command links to older version of the library. Solution is, set
${PGPOOL_INSTALL_DIR}/lib to LD_LIBRARY_PATH so that the command links
proper version of library.
Tatsuo Ishii [Mon, 24 Aug 2015 02:54:17 +0000 (11:54 +0900)]
Fix compiler warning.
Since memqcache_total_size is 64bit integer, the format string should
be %ld, rather than %d.
Yugo Nagata [Fri, 21 Aug 2015 06:38:09 +0000 (15:38 +0900)]
Remove rpm_installer directory
Codes of RPM building and installer are maintained by GitHub.
Yugo Nagata [Fri, 21 Aug 2015 06:34:03 +0000 (15:34 +0900)]
Move 006 memory leak test to test/regression from src/test/regression
It seem to be git-cherry-pick mistake.
Yugo Nagata [Fri, 21 Aug 2015 06:33:17 +0000 (15:33 +0900)]
Remove tests directory which are incorporated into regression test
Yugo Nagata [Thu, 20 Aug 2015 04:06:25 +0000 (13:06 +0900)]
Add timestamp-rewrite unit test to regression test suite
Yugo Nagata [Fri, 21 Aug 2015 04:35:35 +0000 (13:35 +0900)]
Fix typo in Document
Yugo Nagata [Wed, 19 Aug 2015 09:53:59 +0000 (18:53 +0900)]
Fix complication error and segfault of timestamp rewrite test
Yugo Nagata [Wed, 19 Aug 2015 08:07:15 +0000 (17:07 +0900)]
Fix inconsistency of sequence values in replication mode
Due to the following commit, table names were always quoted
in queries to check needs for insert lock, whether this is
view, wheter this has default value of timestamp etc. However,
when schema name was provided, table name was quoted wrongly as
like "public.tbl" instead of "public"."tbl". So, pool_regclass
and to_regclass couldn't find right talbe oid and insert lock
was never executed. This caused inconsistency between DB nodes.
In previous codes, quotation marks "" are once remove from
table name returnd by nodeToString, and re-quoted in issued
query. Instead, fixed codes don't remove and use directy in
pgpool_regclass or to_regclass. make_table_from_rangevar()
are also fixed to return table name including quotation marks.
However, when neither pgool_regclass or to_regclass is available,
quotation marks and schema name are removed from table name,
because pg_class.relname is used in this case.
In addition, fix to use to_regclass in insert lock functions
if available.
Yugo Nagata [Wed, 19 Aug 2015 07:49:24 +0000 (16:49 +0900)]
Fix regress test to sleep after pgpool_reload
Some regression tests test behaviors after pgpool-II configuration
is modified and reloaded. However, sometimes these modification
were not applied to pgpool just after reloading.
It was observed after the following commit.
commit
ba24a708ed61d6a5fa296451b194c4b448ed5966
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Thu Aug 6 13:02:42 2015 +0900
Issue fsync() when writing pgpool_status.
This ensures that pgpool_status is saved to permanent storage and
allow to survive after system crash.
It seem to be because fsync() takes a time before SIGHUP is sent
to child processes in reload_config().
Fix is to add sleep to wait for applying modification after
pgpool_reload.
In addition, some messages are added to test for debugging.
Yugo Nagata [Tue, 18 Aug 2015 10:31:03 +0000 (19:31 +0900)]
Fix broken regression test for native replication
Test for insert lock didn't work.
Yugo Nagata [Tue, 18 Aug 2015 10:25:30 +0000 (19:25 +0900)]
Fix false alert of regression tset 062
Sleep before timedout was too short.
Tatsuo Ishii [Thu, 6 Aug 2015 06:15:24 +0000 (15:15 +0900)]
Issue fsync() when writing pgpool_status.
This ensures that pgpool_status is saved to permanent storage and
allow to survive after system crash.
Tatsuo Ishii [Wed, 5 Aug 2015 06:19:44 +0000 (15:19 +0900)]
Fix misinformation regarding load balancing in docs.
In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent
to primary node only. Pointed out in [pgpool-general-jp: 1378].
Yugo Nagata [Fri, 24 Jul 2015 05:33:41 +0000 (14:33 +0900)]
Prepare 3.3.7
Tatsuo Ishii [Sun, 21 Jun 2015 09:51:34 +0000 (18:51 +0900)]
Do not send a query for checking insert lock in non replication mode with extended query
This unnecessary code was there since day 0.
Tatsuo Ishii [Sat, 20 Jun 2015 10:03:22 +0000 (19:03 +0900)]
Allow to use in memory query cache size > 4GB
This should have been allowed since in memory query cache was born.
Tatsuo Ishii [Fri, 19 Jun 2015 17:14:41 +0000 (02:14 +0900)]
Add a test case for previous commit.
Tatsuo Ishii [Fri, 19 Jun 2015 16:39:44 +0000 (01:39 +0900)]
Fix the case when user table includes spaces.
For example if table names including space are used (of course using
delimited identifier), pgpool-II cannot be handled correctly by the
internal functions which access system catalogs and it results in SQL
errors. Solution is, to always use delimited identifier. Per bug#136.
Also see [pgpool-general: 3818].
Tatsuo Ishii [Fri, 29 May 2015 00:27:41 +0000 (09:27 +0900)]
Fix "select() system call interrupted" error.
The health check process complains above then
ERROR: failed to make persistent db connection
DETAIL: connection to host:"x.x.x.x:5432 failed
But the healthchek does not trigger fail over nor retrying (if the
retry parameter is configured). So except the annoying message above
everything goes well.
I guess this is caused by SIGCHLD interrupt while select(2) waiting
for completion of connect(2) call. It is likely that pgpool child dies
because of child_life_time. The directive is triggered if child is
idle for specified period. Since this happens independently among each
child process, if num_init_children is big (in the reported case, it
is 2000). So the case could occur more easily if 1) num_init_children
is big and 2) pgpool children go into idle state (no query arrived
from client for child_life_time seconds).
We suppose a system call interruption could occur by SIGALRM which is
set by pgpool to detect time of the connect(2) call if
health_check_timeout is non 0. However we did not think about the case
above.
The fix is, if select(2) is interrupted by a system call, check
health_check_timeout variable and it is not set, we can assume that
the interruption is caused by other than SIGALRM and retries the
select(2).
Original bug report is [pgpool-general: 3756] Connection Interrupted.
Patch created by me. Enhancement from Usama.
Also I got similar report (but on 3.3) from another user. So I will
make similar commit to 3.3 stable tree as well.
Tatsuo Ishii [Wed, 13 May 2015 01:29:14 +0000 (10:29 +0900)]
Fix outdated limitation description about load balancing using JDBC driver.
Even if autocommit is false, load balancing is possible in certain conditions.
Tatsuo Ishii [Mon, 11 May 2015 06:48:26 +0000 (15:48 +0900)]
Clarify description of pcp_promote_node.
It does not actually promote PostgreSQL standby.
Tatsuo Ishii [Mon, 11 May 2015 06:33:15 +0000 (15:33 +0900)]
Clarify load balancing condition.
Muhammad Usama [Wed, 29 Apr 2015 14:13:58 +0000 (19:13 +0500)]
Passing empty string parameters in failover command when pgpool-II does not have a value for any particular parameter
Instead of omitting the values for the parameters when pgpool-II does not have
any value for a particular parameter, It now passes an empty string instead to
the failover command, This makes sure that failover script will always receive
the exact number of expected parameters.
Muhammad Usama [Thu, 9 Apr 2015 17:38:59 +0000 (22:38 +0500)]
Fixing "cannot find xlog functions" error in pgpool-recovery
The argument data type of PG's pg_xlogfile_name() function has been changed from
text to pg_lsn since PostgreSQL 9.4. And pgpool-recovery was still trying to
locate the function by old signature.
Yugo Nagata [Wed, 8 Apr 2015 07:27:46 +0000 (16:27 +0900)]
Prepare 3.3.6
Muhammad Usama [Tue, 7 Apr 2015 14:54:20 +0000 (19:54 +0500)]
Fixing a problem with pcp_detach_node, When graceful node detach is requested
gracefully detaching a node by pcp_detach_node should check if it is allowed to
process detach_node command on the particular node before blocking the incoming
connections and closing the existing connections.
Yugo Nagata [Tue, 7 Apr 2015 08:02:45 +0000 (17:02 +0900)]
Update table and flowchart of where a query should be sent
Yugo Nagata [Mon, 30 Mar 2015 07:10:29 +0000 (16:10 +0900)]
Add a regression test for SELECT error hangs bug
The fix commit is:
commit
41ee68c0696bb484d0a68bbc72677b80a15d4410
Author: Yugo Nagata <nagata@sraoss.co.jp>
Date: Mon Mar 30 15:23:32 2015 +0900
Fix a hang when an error occurs in a transaction block with replication mode
Yugo Nagata [Mon, 30 Mar 2015 06:23:32 +0000 (15:23 +0900)]
Fix a hang when an error occurs in a transaction block with replication mode
When an error occurs at a backend node in a transaction block with
replication mode, pgpool-II sends an invalid query to other
backends to sync transaction states. However, previously, this was
not sent to master node, and pgpool-II was waiting for master's
response forever.
This bug is caused to a specification change since 3.3.0 that load
balance is allowed in a transaction block with replication mode.
To fix this, pgpool sends the invalid query to all backends,
including master, except the node which the original query was sent.
Tatsuo Ishii [Sat, 21 Mar 2015 00:54:08 +0000 (09:54 +0900)]
Use to_regclass if available in time stamp rewriting in replication mode.
Newer pgpool-II supposed to use to reg_class, but this was
accidentally left.
Muhammad Usama [Wed, 18 Mar 2015 10:21:31 +0000 (15:21 +0500)]
Support SSL certificate chains in the certificate file for incoming frontend connections.
Yugo Nagata [Fri, 6 Mar 2015 08:47:05 +0000 (17:47 +0900)]
Update document of condition for load balancig
Load balancing is possible in an explicit transaction block
even in replication mode since 3.3.0.
Tatsuo Ishii [Thu, 19 Feb 2015 01:33:57 +0000 (10:33 +0900)]
Enlarge POOLCONFIG_MAXDESCLEN to 80.
This is used in show pool_status command and limits the length of
parameter description. Unfortunately recovery_timeout description is
64 chars, which is 1 byte longer than former definition of the macro
because we need on more byte for null termination.
Yugo Nagata [Fri, 20 Feb 2015 08:01:58 +0000 (17:01 +0900)]
Update release number
Yugo Nagata [Fri, 20 Feb 2015 07:31:09 +0000 (16:31 +0900)]
Remove an unnecessary include directive
Yugo Nagata [Fri, 20 Feb 2015 07:21:18 +0000 (16:21 +0900)]
Fix to set SIGCHLD to SIG_DFL instead of SIG_IGN in watchdog processes
When using waitpid, it isn't necessary to set SIGCHLD SIG_IGN. Rather,
waitpid returns ECHLD and WIFEXITED could be zero even when the child
process exit successfully. Due to this, it was recognized that ping
exited abnormally in error.
In addition, signal functions are replaced to pool_singal.
Yugo Nagata [Fri, 20 Feb 2015 05:27:41 +0000 (14:27 +0900)]
Fix to use void * for receiving return value of thread function
Previously int was used and this could occur stack buffer overflow.
This caused an infinity loop of ping error at bringing up or down
VIP, since a loop variable in a for loop was overwritten to zero.
Nozomi Anzai [Tue, 10 Feb 2015 07:43:23 +0000 (16:43 +0900)]
Fix %tmpfiles_create to not be executed in RHEL/CentOS 6
Nozomi Anzai [Fri, 6 Feb 2015 07:08:39 +0000 (16:08 +0900)]
Merge branch 'V3_3_STABLE' of ssh://git.postgresql.org/pgpool2 into V3_3_STABLE
Nozomi Anzai [Fri, 6 Feb 2015 07:08:00 +0000 (16:08 +0900)]
pgpool.service is required only in RHEL/CentOS 7
Yugo Nagata [Thu, 5 Feb 2015 10:13:47 +0000 (19:13 +0900)]
Prepare 3.3.5
Nozomi Anzai [Thu, 29 Jan 2015 09:43:02 +0000 (18:43 +0900)]
Add pgpool.service for systemd in RHEL/CentOS 7
Nozomi Anzai [Thu, 29 Jan 2015 05:06:53 +0000 (14:06 +0900)]
Change to use systemd if it is available and adopt to PostgreSQL 9.4
Yugo Nagata [Wed, 7 Jan 2015 08:00:27 +0000 (17:00 +0900)]
Fix a mistake in the previous commit
Restore SIGCHLD handler to its original after executing if_up/down_cmd V3_3_STABLE
commit
b9e532b9ab50b1cf1d090a187016a1d155ebc4fd
Yugo Nagata [Wed, 7 Jan 2015 06:54:22 +0000 (15:54 +0900)]
Restore SIGCHLD handler to its original after executing if_up/down_cmd
Previously SIGCHLD was set to SIGIGN always after if_up/down_cmd.
This led to a incorrect error handling of ping or other commands
execution, and warning messages were output to log even when the
command exited successfully.
Yugo Nagata [Mon, 5 Jan 2015 05:27:23 +0000 (14:27 +0900)]
Fix occasional failure in regression test '004.watchdog'
Switchover between pgpools sometimes fails, since the active
pgpool is stopped before the standby pgpool's watchdog is ready.
To avoid this, take a sleep before stopping the active.
The patch provided by uerhara in bug #127.
Muhammad Usama [Tue, 23 Dec 2014 18:04:20 +0000 (23:04 +0500)]
Fix for [pgpool-general: 3374] show pool_nodes
The size of string for holding the node id in POOL_REPORT_NODES was too small
for ids having more than one digits. Also adjusting the port string size in
same structure which was lot more than what is actually required.
Tatsuo Ishii [Sun, 21 Dec 2014 00:38:49 +0000 (09:38 +0900)]
Fix bogus date and raise rpm version number.
Tatsuo Ishii [Sat, 20 Dec 2014 15:54:00 +0000 (00:54 +0900)]
Copy m4/* files.
Use autoreconf -i
Tatsuo Ishii [Sat, 20 Dec 2014 15:43:04 +0000 (00:43 +0900)]
Change ltmain.sh from symlink to copy.
Use libtoolize --copy
Tatsuo Ishii [Sat, 20 Dec 2014 15:36:27 +0000 (00:36 +0900)]
Change "compile" from symlink to copy to enhance portability.
Use automake --add-missing --copy
Tatsuo Ishii [Sat, 20 Dec 2014 14:30:21 +0000 (23:30 +0900)]
Add "compile" generated by "automake --add-missing."
Tatsuo Ishii [Sat, 20 Dec 2014 14:25:49 +0000 (23:25 +0900)]
Overhaul configure and friends as aleady done in V3.4.
Rename configure.in to configure.ac.
Change AC_INIT and AC_INIT_AUTOMAKE macro.
Add AM_MAINTAINER_MODE(disable).
Muhammad Usama [Fri, 12 Dec 2014 18:24:49 +0000 (23:24 +0500)]
Fix for
0000122: pgpool-II 3.4.0 - if_up_cmd and if_down_cmd $_IP_$ substitution
is too optimistic.
exec_ifconfig() function while breaking the command string into tokens was
assuming that "$_IP_$" keyword will always have a white space at the end and
when "$_IP_$" has some prefix, it gets broken down into two tokens "$_IP_$"
instead of one.
To fix this the command string in exec_ifconfig() is passed to newly added
string_replace() function to substitute all occurrences of "$_IP_$"
with delegate_IP before tokenizing.
Tatsuo Ishii [Sat, 6 Dec 2014 14:07:49 +0000 (23:07 +0900)]
Fix ill signal befavior of SIGCHLD in exec_ifconfig().
For some reason signal(SIGCHLD, SIG_IGN) was set *and* tries to wait
child process which always fails because SIGCHLD is never
delivered. Due to this "ifconfig up" fails when switching to watchdog
master. Fix is, before calling fork(), do "signal(SIGCHLD,
SIG_DFL)". See "[pgpool-general: 3310] Watchdog - ifconfig up failed."
for more details.
Tatsuo Ishii [Thu, 4 Dec 2014 01:46:13 +0000 (10:46 +0900)]
Fix memory leak test.
Fix wrong test memory leak existence.
Fix from Usama:
> Also I have made a small change in the newly added test case to test memory
> leaks, I have added the statement to run the pgbench for 1 second before
> the script takes the initial memory size to catter the startup memory
> required by child process.
Tatsuo Ishii [Wed, 3 Dec 2014 02:12:22 +0000 (11:12 +0900)]
Add memory leak regression test.
The test executes pgbench -S for a while (currently 30 seconds) and
compare pgpool child process size before and after. If it increases,
the test fails. The test is executed in streaming replication, native
replication and raw mode.
Yugo Nagata [Tue, 2 Dec 2014 07:47:52 +0000 (16:47 +0900)]
Update changelog
Tatsuo Ishii [Fri, 28 Nov 2014 23:29:43 +0000 (08:29 +0900)]
Fix failover script to use absolute path to the database cluster.
Otherwise failover doesn't work when startall is executed from other
than in the directory where pgpool_setup starts.
Tatsuo Ishii [Wed, 19 Nov 2014 01:26:30 +0000 (10:26 +0900)]
Fix node id range check bug in trigger_failover_command().
The node id should be lower than NUM_BACKENDS. Probably harmless since
callers never pass node ids greater or equal to NUM_BACKENDS. But a
bug is a bug.
Yugo Nagata [Wed, 19 Nov 2014 01:32:21 +0000 (10:32 +0900)]
Update pgpool-II-head.patch for RPM release
Yugo Nagata [Tue, 18 Nov 2014 11:21:10 +0000 (20:21 +0900)]
Rename RPM file
Rename filename to include RHEL version no. like PostgreSQL's
official RPM file.
e.g.)pgpool-II-pg93-3.4.0-2pgdg.rhel6.x86_64.rpm
Tatsuo Ishii [Thu, 13 Nov 2014 07:42:42 +0000 (16:42 +0900)]
Allow to set configuration file directory by setting environment variable PGPOOLDIR.
Avoid errors when pcp.conf.sample does not exist. This could happen in RPM installation.
Tatsuo Ishii [Wed, 12 Nov 2014 04:37:26 +0000 (13:37 +0900)]
Add to support for memcached.
Tatsuo Ishii [Fri, 7 Nov 2014 00:43:53 +0000 (09:43 +0900)]
Fix possible segfault in query cache.
In ReadyForQuery, it does not check if session_context->query_context
exists. Thus it could lead to segfault later on if it does not exists.
Tatsuo Ishii [Thu, 30 Oct 2014 15:11:11 +0000 (00:11 +0900)]
Fix wait_for_pgpool_startup to use "postgres" database rathern than "test".
The test database may or may not exist and if it does not, it will
always retry until timeout expired (20 seconds), and regression test
takes unnecessary long.
Muhammad Usama [Thu, 23 Oct 2014 18:56:30 +0000 (23:56 +0500)]
The commit tries to fix the failover deadlock problem
"[pgpool-II
0000105]: Failover dead lock".
Although the issue is not readily reproducible but analysis of Yugo reveals
the following scenario which can cause the deadlock.
Scenario:
--quote--
When watchdog is used and a backend goes down, pgpools can hang.
This is related to semaphore locking used in failover(),degenerate_backend_set().
I analyzed and made a hypothesis of mechanism as below.
1. A backend goes down during many child processes are accepting connection.
2. A child process (P_c0) which detects the backend down executes
degererate_backend_set(). Then in this function,
- aquires a semaphore lock (pool_semaphore_lock(REQUEST_INFO_SEM))
- notifies to other pgpools (wd_degenrate_backend_sent())
- sends a signal to trigger failover (kill(parent, SIGUSR1))
- release the lock (pool_semaphore_unlock(REQUEST_INFO_SEM))
3. Then, other child process (P_c1) which detects backend down acquires the lock
as similar to P_c0.
4. watchdog process (P_w) which receives notification from P_c0 in other pgpool
also executes degenerate_backend_set() in wd_sent_response(), and tries to
acquires the lock. However, P_w can't acquire lock and goes into waiting since
P_c1 is already holding the lock.
5. The parent process (P_p) executes failover() and tries to acquires the lock.
However, P_p can't get lock and goes waiting for the same reason.
6. P_c1 tries to notify to other pgpools (wd_degenrate_backend_sent()).
However, P_w in other pgpools are also waiting lock and can't respond.
So, P_c1 waits response forever.
7. As a result, both pgools hang in following status;
- P_c1: lock holder and waiting response from P_w in other pgpool
- P_w: waiting lock
- P_p: waiting lock
--unquote--
Fix:
The commit fixes the mentioned scenario by introducing the request info queues
in place of single request info structure for failover requests.
so the failover reporter process can quickly gets back control after enqueueing
the failover request and continue with its normal duty.
There are few minor behavioural changes happened because of the commit mainly in
the area where the failover() function intimates the PCP child for waking up
after processing the failover.
1-) Now the failover() function only sends the WAKEUP call to the PCP child
after executing all the queued failover/failback requests.
2-) Restart signal is sent to PCP child only once after processing all queued requests.
3-) failover() function sets the switching flag to true when starting to process
failover queue and the flag keeps set till complete queue is processed.
Yugo Nagata [Wed, 22 Oct 2014 12:33:02 +0000 (21:33 +0900)]
Fix to disable debug mode with a config reload
Per bug #114.
Tatsuo Ishii [Tue, 21 Oct 2014 01:25:54 +0000 (10:25 +0900)]
Fix missing release note entries in the previous release.
Tatsuo Ishii [Tue, 21 Oct 2014 01:22:05 +0000 (10:22 +0900)]
Fix missing release note entries in the previous release.
Tatsuo Ishii [Fri, 17 Oct 2014 11:08:12 +0000 (20:08 +0900)]
Fix uninitialized variable.
Per Coverity
1234603.
Tatsuo Ishii [Thu, 25 Sep 2014 02:03:32 +0000 (11:03 +0900)]
Update history.
Tatsuo Ishii [Thu, 25 Sep 2014 00:47:11 +0000 (09:47 +0900)]
Fix typo in docs.
Per Yaron Naveh.
Tatsuo Ishii [Sat, 20 Sep 2014 23:03:34 +0000 (08:03 +0900)]
Update history.
Tatsuo Ishii [Sat, 20 Sep 2014 22:52:59 +0000 (07:52 +0900)]
Fix wrong SSL configure option in the RPM spec file.
SSL enabling option is "--with-openssl=/usr" and this is wrong. This
should be "--with-openssl". Per bug #115.
Tatsuo Ishii [Tue, 16 Sep 2014 08:39:23 +0000 (17:39 +0900)]
Fix typo in an error message.
Per Scalia, John.