Tatsuo Ishii [Sat, 30 Mar 2019 01:33:58 +0000 (10:33 +0900)]
Fix wrong usage of volatile declaration.
From a PostgreSQL commit message:
Variables used after a longjmp() need to be declared volatile. In
case of a pointer, it's the pointer itself that needs to be declared
volatile, not the pointed-to value.
Same thing can be said to:
volatile StartupPacket *sp;
This should have been:
StartupPacket *volatile sp;
This also suppresses a compiler warning.
Bo Peng [Thu, 28 Mar 2019 09:35:04 +0000 (18:35 +0900)]
Prepare 3.4.23.
Muhammad Usama [Wed, 27 Mar 2019 07:51:20 +0000 (12:51 +0500)]
Add new configuration option ssl_prefer_server_ciphers
Add the new setting "ssl_prefer_server_ciphers" to let users configure if they
want client's or server's cipher order to take preference.
Tatsuo Ishii [Sat, 23 Mar 2019 04:04:21 +0000 (13:04 +0900)]
Allow to set a client cipher list.
For this purpose new parameter "ssl_ciphers" is added. This is already
implemented in PostgreSQL and useful to enhance security when SSL is
enabled.
Tatsuo Ishii [Mon, 18 Mar 2019 00:45:51 +0000 (09:45 +0900)]
Fix unnecessary fsync to pgpool_status file.
Whenever new connections are created to PostgreSQL backend, fsync()
was issued to pgpool_status file, which could generate excessive I/O
in certain conditions, for example num_init_children is large and
connections to backend have certain life time limit.
So reduce the chance of issuing fsync() so that it is issued only when
backend status is changed from CON_CONNECT_WAIT or others to CON_UP.
If the status is already CON_UP, we don't need to write to
pgpool_status.
Discussion: [pgpool-general: 6436] High I/O Usage on PGPool nodes
Bo Peng [Thu, 14 Mar 2019 05:21:59 +0000 (14:21 +0900)]
Add "tags" to gitignore file.
Bo Peng [Thu, 7 Mar 2019 02:26:17 +0000 (11:26 +0900)]
Fix some mistakes from previous commit.
Bo Peng [Thu, 7 Mar 2019 01:27:31 +0000 (10:27 +0900)]
Fix indent of pgpool.conf sample files.
Tatsuo Ishii [Wed, 27 Feb 2019 00:38:15 +0000 (09:38 +0900)]
Fix write_status_file()'s signature.
It was mistakenly declared as write_status_file(). Of course this
should be: write_status_file(void).
Bo Peng [Thu, 21 Feb 2019 01:09:04 +0000 (10:09 +0900)]
Prepare 3.4.22.
Tatsuo Ishii [Fri, 15 Feb 2019 05:26:55 +0000 (14:26 +0900)]
Fix configuration change timing regarding memory_cache_enabled.
This parameter must not be changed after Pgpool-II start but it was
possible to change by reloading.
Tatsuo Ishii [Tue, 12 Feb 2019 07:59:35 +0000 (16:59 +0900)]
Fix unwanted recovery timeout in certain cases.
In the second stage of online recovery in replication mode, it is
possible it fails with timeout (message: "wait_connection_closed:
existing connections did not close in %d sec.") if connection counter
is malformed by a child process aborts with SIGKILL, SEGFAULT or etc.
This could be detected by checking if client_idle_limit_in_recovery is
enabled and it has less value than recovery_timeout because all
clients must be kicked out by the time when
client_idle_limit_in_recovery is expired. If so, we should reset
conn_counter to 0 also.
Per bug 431.
Tatsuo Ishii [Tue, 29 Jan 2019 08:20:41 +0000 (17:20 +0900)]
Fix corner case bug with strip_quote().
strip_quote(), which is called by pattern_compare() did not properly
handle empty query string case. In the worst case it could wipe out
memory after a pointer returned from malloc(), which could cause a
segmentation fault in free() called in pattern_compare().
Per bug 458.
Tatsuo Ishii [Thu, 10 Jan 2019 03:20:07 +0000 (12:20 +0900)]
Fix Pgpool child segfault in a race condition.
1) frontend tries to connect to Pgpool-II
2) there's no existing connection cache
3) try to create new backend connections by calling connect_backend()
4) inside connect_backend(), pool_create_cp() gets called
5) pool_create_cp() calls new_connection()
6) failover occurs and the global backend status is set to down, but
the pgpool main does not send kill signal to the child process yet
7) inside new_connection() after checking VALID_BACKEND, it checks the
global backend status and finds it is set to down status, so that
it returns without creating new connection slot
8) connect_backend() continues and accesses the down connection slot
because local status says it's alive, which results in a segfault.
Since there's already checking for the global status in
new_connection(), a fix could be syncing the local status with the
global status there.
See [pgpool-hackers: 3214] for discussion.
Tatsuo Ishii [Thu, 6 Dec 2018 08:20:32 +0000 (17:20 +0900)]
Deal with "terminating connection due to idle-in-transaction timeout" error.
If idle_in_transaction_session_timeout parameter is set to reasonably
short in postgresql.conf, the fatal error easily occurs and the
connection from Pgpool-II to backend is terminated. This leads to
Pgpool-II either hang (if only one of PostgreSQL equips equips the
parameter) or unwanted failover (if all PostgreSQL equips with the
parameter), and both are not good. So intercept the message and send
the same message to frontend then exit to terminate the connection to
frontend. This is similar treatment as the error "connection was
terminated due to conflict with recovery, User was holding a relation
lock for too long."
Per bug 448.
Bo Peng [Wed, 21 Nov 2018 08:48:36 +0000 (17:48 +0900)]
Prepare 3.4.21.
Takuma Hoshiai [Wed, 21 Nov 2018 07:48:35 +0000 (16:48 +0900)]
Change sort algorism buble sort to quick sort.
This is used to sort startup packet's parameters.
Takuma Hoshiai [Wed, 21 Nov 2018 02:35:58 +0000 (11:35 +0900)]
Fix to sort startup packet's parameters sent by client.
If order of startup packet's parameters differ between cached connection pools and connection request, did't use connection pool ,and created new connection pool.
Per bug 444.
Tatsuo Ishii [Thu, 15 Nov 2018 00:21:30 +0000 (09:21 +0900)]
Fix memory leak found by Coverity,
This is actually harmless since in the situation pgpool child process
exits and the leaked memory is gone anyway. I just want to shut off
Coverity's complain.
Bo Peng [Tue, 13 Nov 2018 01:54:05 +0000 (10:54 +0900)]
Fix segmentation fault occurs when a certain Bind message is sent in native replication mode.
If the number of parameter format codes is specified to one, but the number of the original query's
parameter is zero, bind_rewrite_timestamp() will call memcpy with a negative value for size_t.
This causes segmentation fault.
Patch is provided by Yugo Nagata.
Per bug 443.
Tatsuo Ishii [Thu, 8 Nov 2018 05:37:18 +0000 (14:37 +0900)]
Fix a query passed to relcache so that it uses schema qualified table name.
This should have been done for all similar queries to follow PostgreSQL's schema usage pattern.
However there was one missed at that time.
Tatsuo Ishii [Mon, 5 Nov 2018 12:43:01 +0000 (21:43 +0900)]
Fix query cache invalidation bug.
When a DML is executed in an explicit transaction, the table oid
buffer is wiped out by pool_reset_memqcache_buffer() and query cache
is not invalidated at the commit time because there's no DML oid
exists to invalidate query cache any more. To fix this, add new bool
parameter to pool_reset_memqcache_buffer() to specify whether to reset
table oid buffer or not. When a DML is executed in an explicit
transaction, call pool_reset_memqcache_buffer(false) to preserve the
table oid buffer.
Issue reported at https://github.com/pgpool/pgpool2/issues/19.
Tatsuo Ishii [Thu, 1 Nov 2018 00:22:46 +0000 (09:22 +0900)]
Fix memory leak in extended query + query cache enabled.
If a bind message is sent again to an existing prepared statement, it
is possible that the previously allocated bind parameter string
remains and newly allocated bind parameter string's pointer is set to
there, which leads to a memory leak.
Note that if a statement is parsed again in usual way, the parameter
string will be freed along with the old query context. So the leak
does not happen.
I suspect the use case for the memory leak (bind, execute is repeated
against a same prepared statement) is actually rare in the
field. Probably that's why the problem has not been reported until
today although the leak had existed since day 0.
The leak case can be easily reproduced by "pgbench -M prepared" by the
way.
Bo Peng [Wed, 31 Oct 2018 04:40:41 +0000 (13:40 +0900)]
Change pgpool.spec.
Bo Peng [Wed, 31 Oct 2018 03:39:34 +0000 (12:39 +0900)]
Change spec file to include pgpool_recovery--1.0.sql and pgpool_recovery--1.0--1.1.sql.
Bo Peng [Wed, 31 Oct 2018 03:11:40 +0000 (12:11 +0900)]
Add pgpool_recovery--1.0.sql and pgpool_recovery--1.0--1.1.sql to tar ball.
Bo Peng [Wed, 31 Oct 2018 02:17:00 +0000 (11:17 +0900)]
Prepare 3.4.20.
Tatsuo Ishii [Thu, 25 Oct 2018 10:58:34 +0000 (19:58 +0900)]
Fix typo in child_max_connections description.
Patch provided by Phil Ramirez.
Takuma Hoshiai [Mon, 22 Oct 2018 08:18:35 +0000 (17:18 +0900)]
Fix segmentation fault, when client send sync message in native replication mode.
When the query to be executed does not exist, if client sent 'Sync' messages to Pgpool-II which in native replication mode, occurred segmentation fault.
See:
https://www.pgpool.net/mantisbt/view.php?id=434
for more details.
Bo Peng [Thu, 18 Oct 2018 09:12:24 +0000 (18:12 +0900)]
Fix syntax error in native replication, when queries including now() etc. and "IN (SELECT ...)" in WHERE clause.
In native replication, queries including now() etc. are rewritten to a timestamp constant value.
However, Pgpool-II didn't support queries including now() etc. and "IN (SELECT ...)" in WHERE clause.
Per bug433.
Bo Peng [Thu, 18 Oct 2018 08:51:13 +0000 (17:51 +0900)]
Change pgpool.spec file to install extension to server which supports LLVM JIT.
Tatsuo Ishii [Tue, 9 Oct 2018 04:49:49 +0000 (13:49 +0900)]
Fix memory leak in trigger_failover_command.
Pointed out by Coverity.
Bo Peng [Tue, 9 Oct 2018 00:22:31 +0000 (09:22 +0900)]
Fix memory leak when memory_cache_enabled = on and write SQLs are sent.
In a explicit transaction, we the SELECT results are cached in temporary buffer.
If a write SQL is sent which modifies the table, the temporary buffe should be reset.
Tatsuo Ishii [Mon, 8 Oct 2018 22:50:03 +0000 (07:50 +0900)]
Fix occasional failure in regression 065.bug152.
In the test first create a table with some data, then query
it. However sometimes it seems replication delay causes the table
still not ready in standby. Since there's no reason we need to a
standby or slave for this particular test, let the test have only
primary/master.
Bo Peng [Wed, 19 Sep 2018 00:25:31 +0000 (09:25 +0900)]
Add missing pgpool_recovery--1.0--1.1.sql file to update pgpool_recovery() function version to 1.1.
Tatsuo Ishii [Wed, 29 Aug 2018 02:58:36 +0000 (11:58 +0900)]
Add regression test for SSL connection.
This tests SSL connection between frontend <--> Pgpool-II and
Pgpool-II <--> backend.
Tatsuo Ishii [Mon, 27 Aug 2018 06:16:17 +0000 (15:16 +0900)]
Do not update pgpool_passwd if the password length is incorrect.
For Pgpool-II 3.7 or before, the password stored in pool_passwd is MD5
password only. So check the correctness of pool_passwd by scanning
entire file.
Patch created by Takuma Hoshiai. Minor error message tweak by me.
See bug425 for more details.
Bo Peng [Sat, 11 Aug 2018 00:25:34 +0000 (09:25 +0900)]
Remove some .gitignore files which doesn't belong this branch.
Bo Peng [Fri, 10 Aug 2018 04:16:02 +0000 (13:16 +0900)]
Add definition of PGLIB in regress.sh.
Patch provided by Jesper Pedersen.
Bo Peng [Fri, 10 Aug 2018 03:40:10 +0000 (12:40 +0900)]
Update clean.sh which clean up regression test results.
Patch provided by Jesper Pedersen.
Bo Peng [Fri, 10 Aug 2018 03:34:32 +0000 (12:34 +0900)]
Add .gitignore files.
Patch provided by Jesper Pedersen.
Tatsuo Ishii [Sun, 5 Aug 2018 01:54:18 +0000 (10:54 +0900)]
Fix segfault when node 0 is in down status.
MASTER_CONNECTION refers to the connection to "master"
node. "Master" means the first live backend appearing in
pgpool.conf. The master node is determined at the time of fail over.
Unfortunately with both health check and fail_over_on_backend_error
are disabled, there's no chance of failover, which means the master
node id is remained the default value 0. So the MASTER_CONNECTION
refers to the node 0, and the connection is NULL.
Fix is as follows.
If attempt to connection to backend fails, check the master node id in
the shared memory. If the master node id is the failed node, then
look for new master node using get_next_master_node (this was a static
function, but now it's made to public) and set the node id to the
master node id in the shared memory area.
Problem reported by Muhammad Usama in [pgpool-hackers: 2905].
Bo Peng [Tue, 31 Jul 2018 00:14:36 +0000 (09:14 +0900)]
Prepare 3.4.19.
Tatsuo Ishii [Wed, 11 Jul 2018 01:16:07 +0000 (10:16 +0900)]
Try to reduce the chance of regression 006.memcache failure.
It seems the occasional failure of the test is caused by replication
lag. The script tries to read tables from standby but it returns a
table not existing error. So insert pg_sleep() after creation of
tables.
Tatsuo Ishii [Wed, 4 Jul 2018 06:25:35 +0000 (15:25 +0900)]
Fix "write on backend 0 failed with error :"Success"" error.
While writing to a socket, sometimes write() returns 0. Before we
treated this as an error, but it seems this could happen in the field
and is better to be treated as normal. So if write() returns 0, then
retry write() instead of raise an error.
Per bug #403.
Tatsuo Ishii [Fri, 22 Jun 2018 05:37:25 +0000 (14:37 +0900)]
Add nap time after failover.
This should make the test failure less frequent.
Tatsuo Ishii [Wed, 20 Jun 2018 04:57:40 +0000 (13:57 +0900)]
Fix comments and coding style.
Tatsuo Ishii [Wed, 20 Jun 2018 02:49:45 +0000 (11:49 +0900)]
Fix 006.memqcache test.
It forgot to execute shutdownall if some of tests failed. This lead to
hang up of subsequent tests.
Tatsuo Ishii [Wed, 20 Jun 2018 01:25:23 +0000 (10:25 +0900)]
Fix memory leaks related to pool_extract_error_message().
After 3.4, the function starts to return palloc'ed memory, and the
caller should had been modified so that they pfree the memory returned
by it but actually they had not.
Tatsuo Ishii [Tue, 19 Jun 2018 02:31:29 +0000 (11:31 +0900)]
Fix oversight in pool_extract_error_message().
A variable used for storing the return value was mistakenly declared
as bool, rather than int. This led to a segfault issue mentioned in
75b27e7 on certain platform.
Tatsuo Ishii [Tue, 19 Jun 2018 01:10:33 +0000 (10:10 +0900)]
Fix segfault in per_node_error_log() on armhf architecture.
pool_extract_error_message() incorrectly returns 255 (in decimal) on
the architecture when previous message was not an error or a notice
message. In this case per_node_error_log() happily calls ereport since
the return value from pool_extract_error_message() is greater than
0. Unfortunately the message string returned by
pool_extract_error_message() points to garbage memory in this case, a
segfault occurs.
The fix gives per_node_error_log() a guard against the bug of
pool_extract_error_message(). Moreover, the change is more consistent
with other places where pool_extract_error_message() is called.
Fix for pool_extract_error_message() will come later on.
See:
https://github.com/pgpool/pgpool2/issues/14
for more detailed discussion.
Problem reported and patch by Christian Ehrhardt.
Tatsuo Ishii [Tue, 12 Jun 2018 06:53:39 +0000 (15:53 +0900)]
Revert "Fix 055.backend_all_down test failure."
This reverts commit
ca492a65bbf57c2dc78826690ea259ddc9d6e78b.
Tatsuo Ishii [Tue, 12 Jun 2018 06:21:52 +0000 (15:21 +0900)]
Fix 055.backend_all_down test failure.
The test fails because pgpool zombie child process remains. Actually
the failover process is properly performed but when the shutdown
script is executed in background, output to stdout/stderr was blocked,
and this could cause the zombie process syndrome. Soltution is,
redirecting stdout/stderr to /dev/null when sponing the shutdown
script in background.
Bo Peng [Mon, 11 Jun 2018 14:10:22 +0000 (23:10 +0900)]
Prepare 3.4.18.
Bo Peng [Wed, 25 Apr 2018 14:31:12 +0000 (23:31 +0900)]
Fix compile error.
Tatsuo Ishii [Wed, 18 Apr 2018 01:03:37 +0000 (10:03 +0900)]
Prevent pcp_recovery_node from recovering "unused" status node.
This allowed to try to recover a node without configuration data,
which leads to variety of problems. See discussion:
https://www.pgpool.net/pipermail/pgpool-general/2018-March/006021.html
for more details.
Also I fixed pgpool_recovery function so that it quotes an empty
string argument with double quotes. Without this, the argument is
treated as if it does not exist, which was the source of the complain
from the user.
Bo Peng [Tue, 17 Apr 2018 08:51:17 +0000 (17:51 +0900)]
Prepare 3.4.17.
Tatsuo Ishii [Mon, 9 Apr 2018 05:45:37 +0000 (14:45 +0900)]
Add new regression test for node 0 is down.
test case 1: node 0 is already down before pgpool starts.
test case 2: node 0 goes down after pgpool starts.
test case 3: node 0 goes down and DISALLOW_TO_FAILOVER flag is set after pgpool starts.
Tatsuo Ishii [Sun, 8 Apr 2018 10:18:36 +0000 (19:18 +0900)]
Make calls to to_regclass fully schema qualified.
This is always recommended way.
Bo Peng [Fri, 23 Mar 2018 09:21:34 +0000 (18:21 +0900)]
Change test script to allow test failure.
Bo Peng [Tue, 20 Mar 2018 08:42:46 +0000 (17:42 +0900)]
Add wait_for_failover_done function for test.
Bo Peng [Tue, 20 Mar 2018 08:31:31 +0000 (17:31 +0900)]
Improve the test script 003.failover.
Bo Peng [Wed, 14 Mar 2018 08:27:36 +0000 (17:27 +0900)]
Change the release version.
Bo Peng [Wed, 14 Mar 2018 06:36:34 +0000 (15:36 +0900)]
Prepare 3.4.16-2.
Bo Peng [Wed, 14 Mar 2018 05:01:52 +0000 (14:01 +0900)]
Fix some test errors.
Add "wait_for_pgpool_startup" to wait for Pgpool-II starting.
Tatsuo Ishii [Tue, 27 Feb 2018 04:22:15 +0000 (13:22 +0900)]
Allow to support pgpool_switch_xlog PostgreSQL 10.
Since PostgreSQL 10, pgpool_switch_xlog used in the recovery second
stage fails due to function name changes in PostgreSQL 10.
Tatsuo Ishii [Tue, 27 Feb 2018 04:29:38 +0000 (13:29 +0900)]
Fix failure in replication mode.
If .psqlrc exists, pgpool_seup for replication mode fails because psql
produces messages like "Pager usage is off." which in turn confuses
a command after a pipe. Fix is add -q option to psql.
Bo Peng [Tue, 13 Feb 2018 05:20:30 +0000 (14:20 +0900)]
Prepare 3.4.16.
Bo Peng [Mon, 12 Feb 2018 14:56:52 +0000 (23:56 +0900)]
Fix typos.
Tatsuo Ishii [Mon, 29 Jan 2018 04:53:18 +0000 (13:53 +0900)]
Set TCP_NODELAY and non blocking to frontend socket.
TCP_NODELAY is employed by PostgreSQL, so do we it.
Listen fd is set to non blocking. To make sure accept fd is set to non
blocking.
Tatsuo Ishii [Tue, 23 Jan 2018 23:01:22 +0000 (08:01 +0900)]
Fix segfault when %a is in log_line_prefix and debug message is on.
log_line_prefix() gets called to create a log line prefix string. If
"%a" is specified in "log_line_prefix" parameter, log_line_prefix()
calls MASTER_CONNECTION macro, which calls
pool_virtual_master_db_node_id(), which calls ereport(), which calls
log_line_prefix() if debug message is on. This leads to an infinite
recursion and a segfault. Fix is, calling MASTER_NODE_ID macro instead
of MASTER_CONNECTION macro.
Per bug 376.
Bo Peng [Fri, 19 Jan 2018 05:00:27 +0000 (14:00 +0900)]
Change systemd service file to use STOP_OPTS=" -m fast".
Bo Peng [Fri, 19 Jan 2018 04:58:44 +0000 (13:58 +0900)]
Change pgpool_setup to add restore_command in recovery.conf.
Tatsuo Ishii [Thu, 18 Jan 2018 14:34:38 +0000 (23:34 +0900)]
Revert "Fix queries hanging in parse_before_bind with extended protocol and replication + load-balancing."
This reverts commit
0ac97a9c9600d1ec8c4cbd0bf30191beeb28ace9.
Tatsuo Ishii [Thu, 18 Jan 2018 13:14:38 +0000 (22:14 +0900)]
Fix queries hanging in parse_before_bind with extended protocol and replication + load-balancing.
In case the client sends a BIND message for a query
that has not yet been parsed by the executing node,
the PARSE will be executed before attempting to BIND
the parameters.
However, during the execution of the PARSE, the session
context is not set to in_progress, which leads to wrong
backend validity tests in read_kind_from_backend which
in turn makes the process wait on a backend which is not
going to send anything.
Fixes bug #377.
Problem analysis and fix by Ancoron Luciferis and me.
Tatsuo Ishii [Thu, 18 Jan 2018 01:37:23 +0000 (10:37 +0900)]
Fix queries hanging in parse_before_bind with extended protocol and replication + load-balancing.
In case the client sends a BIND message for a query
that has not yet been parsed by the executing node,
the PARSE will be executed before attempting to BIND
the parameters.
However, during the execution of the PARSE, the session
context is not set to in_progress, which leads to wrong
backend validity tests in read_kind_from_backend which
in turn makes the process wait on a backend which is not
going to send anything.
Fixes bug #377.
Bug report, analysis and fix by Ancoron Luciferis.
Bo Peng [Mon, 8 Jan 2018 07:20:35 +0000 (16:20 +0900)]
Prepare 3.4.15.
Tatsuo Ishii [Fri, 22 Dec 2017 06:20:13 +0000 (15:20 +0900)]
Replace /bin/ed with /bin/sed.
This change requires less packages in order to install pgpool_setup,
because /bin/sed is included in most distribution's base packages,
while //bin/ed is not.
Bo Peng [Thu, 21 Dec 2017 05:42:39 +0000 (14:42 +0900)]
Change the pgpool.service and sysconfig files to output Pgpool-II log.
Removeing "Type=forking" and add OPTS=" -n" to
run Pgpool-II with non-daemon mode, because we need to redirect logs.
Using "journalctl" command to see Pgpool-II systemd log.
Bo Peng [Mon, 18 Dec 2017 02:31:59 +0000 (11:31 +0900)]
Fix some test script error of 002.native_replication.
Bo Peng [Sun, 17 Dec 2017 14:30:15 +0000 (23:30 +0900)]
Fix timestamp data inconsistency by replication mode.
From PostgreSQL10 the column default value such as 'CURRENT_DATE' changes,
Pgpool-II should also rewrite timestamp by the added default values in stead of
"'now'::text::date".
Tatsuo Ishii [Sun, 10 Dec 2017 12:04:15 +0000 (21:04 +0900)]
Fix returning transaction state when "ready for query" message received.
We return primary or master node state of ready for query message to
frontend. In most cases this is good. However if other than primary
node or master node returns an error state (this could happen if load
balance node is other than primary or master node and the query is an
errornous SELECT), this should be returned to frontend, because the
frontend already received an error.
How much this affects to applications is not clear. However this
behavior has been there for long time, probably applications do not
care the state returned by ready for query message.
Tatsuo Ishii [Wed, 15 Nov 2017 23:12:13 +0000 (08:12 +0900)]
Fix pgpool start message printed multiple times.
When an exception occurs in the main loop, longjmp() gets called and
the variable "first" restored to the initial value. This make the
pgpool start message printed multiple times. This is harmless but
confusing. To fix that, add "volatile" qualifier so that the variable
is on the stack, rather than on a register.
Fix suggested by Muhammad Usama.
pengbo [Wed, 1 Nov 2017 00:39:17 +0000 (09:39 +0900)]
Add pgpool_rhel7.sysconfig and pgpool_rhel6.sysconfig files to distribution.
pengbo [Wed, 1 Nov 2017 00:06:25 +0000 (09:06 +0900)]
Prepare 3.4.14.
pengbo [Tue, 31 Oct 2017 03:26:15 +0000 (12:26 +0900)]
Add different pgpool.sysconfig file for RHEL6 and RHEL7.
In RHEL6, the "-n" option is needed to redirect log.
Reported in bug 343.
Tatsuo Ishii [Sun, 8 Oct 2017 06:57:08 +0000 (15:57 +0900)]
Fix some compiler warnings.
Tatsuo Ishii [Sun, 8 Oct 2017 01:29:29 +0000 (10:29 +0900)]
Fix finding primary node is not working.
It was reported that finding primary node was not executed in local
mailing list [pgpool-general-jp: 1462]. The bug was introduced in
commit
e4ce880bd36b8f249bf693c086a1313148f3449a between 3.4.11 and
3.4.12. This requires the Req_info->primary_node_id to negatives
value but I forgot to miss the part. Fix the problem by initializing
Req_info->primary_node_id.
Note that the bug was not in 3.5 or above because commit
bda946e718fe6f3605eb7e82ada8754bd84a279c has made it. Unfortunately I
missed the commit was not in 3.4 stable.
Tatsuo Ishii [Fri, 22 Sep 2017 02:50:28 +0000 (11:50 +0900)]
Fix bug mistakenly overriding global backend status right after failover.
In [pgpool-general: 5728] it is reported that even if failover
disconnects a backend, the status is changed from "down" to "up" in
certain timing. After debugging I found that the backend status in
pgpool_status was changed to down, then changed again by the first
connection from a client after the failover. This happened in
new_connection(), which in charge of creating a new connection to
backend. It checks the local cached status of the backend and if it's
up, then it tries to connect to the backend. In the particular case,
the failover is triggered by failover_if_affected_tuples_mismatch, so
actually the backend is alive and new_connection() succeeds in
establishing connection to the disconnected backend. Then it override
the global status and pgpool_status file.
Fix is, check if the local backend status is obsoleted. If the global
status does not agree the local status, skip the effort to establish
the connection.
In this report the user uses native replication mode, but I think
similar situation can happen in other mode.
Tatsuo Ishii [Mon, 11 Sep 2017 06:11:28 +0000 (15:11 +0900)]
Deal with OpenSSL 1.1.
Patch by me and Usama.
pengbo [Mon, 4 Sep 2017 07:46:05 +0000 (16:46 +0900)]
Prepare 3.4.13.
Yugo Nagata [Thu, 24 Aug 2017 09:38:47 +0000 (18:38 +0900)]
Fix documentation of load-balancing
Tatsuo Ishii [Tue, 15 Aug 2017 01:25:35 +0000 (10:25 +0900)]
Fix ancient bug of pool_unread.
When realloc() is called in pool_unread(), it did not update the
buffer size. This could cause variety of memory corruption and
unexpected data reading from backend. The reason why we did not found
that is, probably recently Pgpool-II starts extensively to use
pool_unread().
Tatsuo Ishii [Thu, 3 Aug 2017 03:41:40 +0000 (12:41 +0900)]
Fix Java program in 005.regression test.
The program forgot issue commit and always ended up with ABORT. This
does not affect the test result itself, it would be better to finish
the test with commit, rather than ABORT.
Tatsuo Ishii [Thu, 3 Aug 2017 02:52:24 +0000 (11:52 +0900)]
Fix bug #303.
When failover is triggered by worker process, it is possible that
wrong DB node could failover. This is due to the db_node_id member in
the POLL_CONNECTION structure is not initialized in the process (in
child process the member is properly initialized). To solve the
problem, add new function pool_set_db_node_id() to set the structure
member variable and call it inside
make_persistent_db_connection(). For this purpose also the new
parameter "db_node_id" is added to make_persistent_db_connection and
friends.
Tatsuo Ishii [Mon, 31 Jul 2017 08:29:27 +0000 (17:29 +0900)]
Fix starting unnecessary transaction when SET command is issued.
In streaming replication mode, there's no point to start internal
transaction when SET command is issued. The existing behavior is
harmless but waste of CPU cycle.
Muhammad Usama [Thu, 27 Jul 2017 14:47:48 +0000 (19:47 +0500)]
Fix for [pgpool-general: 5621] pgpool 3.6.4 failover
Failover() function should be executed with health check alarm disabled
The reason is the find primary node and health check uses the same function to
make a connection to the backends, and the backend connect function has a built
in logic to bail out with the timeout error when the health check alarm occurs.
Now the problem is if the failover() is executed while the health check alarm is
still running, Their is a strong possibility that the find primary node function
may find the health check timer already expired and exit without locating the
new primary node.
The relevant part is back-ported from the 3.6 branch
Yugo Nagata [Thu, 20 Jul 2017 05:55:31 +0000 (14:55 +0900)]
Allow make dist to include pgpool.service
pengbo [Mon, 10 Jul 2017 07:40:10 +0000 (16:40 +0900)]
Prepare 3.4.12.
Muhammad Usama [Thu, 29 Jun 2017 15:30:59 +0000 (20:30 +0500)]
Importing the latest changes in the MemoryManager API from PostgreSQL code.
Pgpool-II has borrowed the MemoryManager from PostgreSQL source and recently
there have been some performance updates made to the PostgreSQL's
memory manager, from which Pgpool-II can also benefit from.
This need was identified by the reporter of issue: "315: High CPU usage when
commiting large transactions and using in (shared) memory cache"