pgpool2.git
7 years agoFully implement "disable_load_balance_on_write".
Tatsuo Ishii [Mon, 23 Apr 2018 04:12:47 +0000 (13:12 +0900)]
Fully implement "disable_load_balance_on_write".

This feature allows to specify the behavior when a write query issued.
Except Japanese documents, all done.

7 years agoFist cut of disable load balance feature.
Tatsuo Ishii [Thu, 19 Apr 2018 05:22:20 +0000 (14:22 +0900)]
Fist cut of disable load balance feature.

If write query is issued in an explicit transaction and
disable_load_balance is set to 'trans_transaction', then subsequent
read queries will be redirected to primary node even if the
transaction is closed.

TODO:

- Implement 'always' case. In addition to 'trans_transaction', the
  effect persists even outside of explicit transactions until the
  session ends.

- Documentation

7 years agoFix bug when USE_REPLICATION_SLOT is not used.
Tatsuo Ishii [Thu, 19 Apr 2018 05:17:37 +0000 (14:17 +0900)]
Fix bug when USE_REPLICATION_SLOT is not used.

7 years agoFix false primary node detection code.
Tatsuo Ishii [Wed, 18 Apr 2018 14:42:52 +0000 (23:42 +0900)]
Fix false primary node detection code.

The previous commit was wrong.

7 years agoEnhance figures explaining detach_false_primary.
Tatsuo Ishii [Wed, 18 Apr 2018 12:45:07 +0000 (21:45 +0900)]
Enhance figures explaining detach_false_primary.

7 years agoAdd Japanese doc for detach_false_primary parameter.
Tatsuo Ishii [Wed, 18 Apr 2018 06:56:00 +0000 (15:56 +0900)]
Add Japanese doc for detach_false_primary parameter.

Also add figures for the parameter.

7 years agoFix detach_false_primary bug.
Tatsuo Ishii [Wed, 18 Apr 2018 05:54:17 +0000 (14:54 +0900)]
Fix detach_false_primary bug.

Let regard any socket file staring with '/' is a UNIX domain socket
directory.

7 years agoUse replication slot if possible.
Tatsuo Ishii [Wed, 18 Apr 2018 02:40:18 +0000 (11:40 +0900)]
Use replication slot if possible.

By setting USE_REPLICATION_SLOT environment variable, now pgpool_setup
in all tests uses replication slots. This reduces disk space under
src/test/regression from 6.3GB to 5,1GB (1.2GB savings).

7 years agoLet pgpool_setup recognize an environment varible to turn on "-s" option.
Tatsuo Ishii [Wed, 18 Apr 2018 02:33:10 +0000 (11:33 +0900)]
Let pgpool_setup recognize an environment varible to turn on "-s" option.

For this purpose new environment variable "USE_REPLICATION_SLOT".

7 years agoPrevent pcp_recovery_node from recovering "unused" status node.
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.

7 years agoUpdate version to 4.0 devel.
Tatsuo Ishii [Tue, 17 Apr 2018 08:56:53 +0000 (17:56 +0900)]
Update version to 4.0 devel.

7 years agoAdd release notes 3.7.3 - 3.3.21.
Bo Peng [Tue, 17 Apr 2018 08:33:52 +0000 (17:33 +0900)]
Add release notes 3.7.3 - 3.3.21.

7 years agoComplete detach_false_primary feature.
Tatsuo Ishii [Tue, 17 Apr 2018 06:10:32 +0000 (15:10 +0900)]
Complete detach_false_primary feature.

In addition to the previous commit:

- Add new config variable detach_false_primary
- Allow to run test along with streaming replication delay checking
- English docs added (Japanese docs needed to be added later)
- Regression test (018.detach_primary) is added
- Sample configuration files are added
- Process reporting is added

7 years agoDisable health check per node parameters by default.
Bo Peng [Tue, 17 Apr 2018 05:32:26 +0000 (14:32 +0900)]
Disable health check per node parameters by default.

7 years agoAllow to use more than 1 standby in pgpool_setup using replication slot.
Tatsuo Ishii [Mon, 16 Apr 2018 02:47:20 +0000 (11:47 +0900)]
Allow to use more than 1 standby in pgpool_setup using replication slot.

For this purpose, add recovery target node argument to pgpool_recovery
extension.  So extension version is incremented to 1.2.

7 years agoAdd support for replication slot to pgpool_setup.
Tatsuo Ishii [Sun, 15 Apr 2018 11:32:32 +0000 (20:32 +0900)]
Add support for replication slot to pgpool_setup.

This eliminates the problem when standby is promoted. When a standby
is promoted, it changes the time line in PITR archive, which will stop
other standby if any because of shared archive directory.

7 years agoFix pcp_detach_node hung when -g option is specified.
Tatsuo Ishii [Thu, 12 Apr 2018 23:00:24 +0000 (08:00 +0900)]
Fix pcp_detach_node hung when -g option is specified.

"pcp_detach_node -g" had been broken since 3.7. The cause was a misuse
of degenerate_backend_set_ex(). Because of this, actual failover
request was not sent to the pgpool main process. As a result,
pcp_worker process waited vainly for a signal arriving from the
process.

Per bug 391. Problem reported by Tomoyuki Sato, fix by me.

7 years agoFirst cut of primary server checking.
Tatsuo Ishii [Mon, 9 Apr 2018 08:44:21 +0000 (17:44 +0900)]
First cut of primary server checking.

For now followings are implemented:

- Check all backend nodes starting node 0.

- If primary nodes appear twice or more, the second one or after are
  assumed invalid.

- Such invalid node will be degenerated at the next convenient
  time. Currently such timing is at the start up of Pgpool-II. This is
  apparently insufficient and should be improved later.

TODO:
- Verify primary nodes using pg_stat_wal_receiver.

- More chances to verify node status. Maybe in the same timing as
  streaming replication delay checking?

- Add new GUCs to control of this feature.

7 years agoAdd new regression test for node 0 is down.
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.

7 years agoMake calls to to_regclass fully schema qualified.
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.

7 years agoFix pgpool child process segfault when ALWAYS_MASTER is on.
Tatsuo Ishii [Thu, 5 Apr 2018 08:11:36 +0000 (17:11 +0900)]
Fix pgpool child process segfault when ALWAYS_MASTER is on.

If following conditions are all met pgpool child segfaults:

1) Streaming replication mode.

2) fail_over_on_backend_error is off.

3) ALWAYS_MASTER flag is set to the master (writer) node.

4) pgpool_status file indicates that the node mentioned in #3 is in
   down status.

What happens here is,

1) find_primary_node() returns node id 0 without checking the status
   of node 0 since ALWAYS_MASTER is set. It's remembered as the
   primary node id. The node id is stored in Req_info->primary_node_id.

2) The connection to backend 0 is not created since pgpool_status says
   it's in down status.

3) upon starting of session, select_load_balancing_node () is called
   and it tries to determine the database name from client's start up
   packet.

4) Since MASTER_CONNECTION macro points to the PRIMARY_NODE,
   MASTER_CONNECTION(ses->backend) is NULL and it results in a segfault.

The fix is, to change PRIMARY_NODE_ID macro so that it returns
REAL_MASTER_NODE_ID (that is the youngest node id which is alive) if
the node id in Req_info->primary_node_id is in down status. This can
be checked using VALID_BACKEND_RAW macro.

VALID_BACKEND macro cannot be used here because it calls
pool_is_node_to_be_sent_in_current_query() inside. Problem is, when a
query is about to processed, pool_is_query_in_progress() is already
set but pool_is_node_to_be_sent() could return false because
where_to_send member in the query context may not be is set yet
(that's the cause of the enbug in Pgpool-II 3.7.2).

So we have the "true" primary node id in Req_info->primary_node_id,
and "fake" primary node id returned by PRIMARY_NODE_ID macro.

See [pgpool-hackers: 2687] and [pgpool-general: 5881] Pgpool-3.7.1
segmentation fault for more details.

Since ALWAYS_MASTER flag was introduced in 3.7, back pached to 3.7
only.
Per bug report from Philip Champon.

7 years agoImprove watchdog documents.
Tatsuo Ishii [Wed, 4 Apr 2018 02:17:02 +0000 (11:17 +0900)]
Improve watchdog documents.

7 years agoMore typo fix.
Tatsuo Ishii [Mon, 2 Apr 2018 22:38:18 +0000 (07:38 +0900)]
More typo fix.

7 years agoUpdate config README file.
Tatsuo Ishii [Sat, 31 Mar 2018 21:39:39 +0000 (06:39 +0900)]
Update config README file.

7 years agoMore description added.
Tatsuo Ishii [Fri, 30 Mar 2018 08:35:01 +0000 (17:35 +0900)]
More description added.

7 years agoAdd a document for adding new config parameter.
Tatsuo Ishii [Fri, 30 Mar 2018 08:04:22 +0000 (17:04 +0900)]
Add a document for adding new config parameter.

7 years agoImprove test script 003.failover.
Bo Peng [Tue, 20 Mar 2018 08:46:35 +0000 (17:46 +0900)]
Improve test script 003.failover.

7 years agoDeal with "unable to bind D cannot get parse message "S1" error.
Tatsuo Ishii [Wed, 14 Mar 2018 08:19:18 +0000 (17:19 +0900)]
Deal with "unable to bind D cannot get parse message "S1" error.

Before this just raised an exception and issue "DISCARD ALL" to only
node 0 if load balance node = 0 because query context wants to do
so. Problem is, when an exception is raised, the query context is not
active any more and Pgpool-II tries to read from node 1, which causes
a hang up.

Add new test for this to the extended query test.

7 years agoFix some test errors.
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.

7 years agoMention that users can avoid failover using backend_flag even PostgreSQL admin shutdown.
Tatsuo Ishii [Fri, 2 Mar 2018 05:22:35 +0000 (14:22 +0900)]
Mention that users can avoid failover using backend_flag even PostgreSQL admin shutdown.

7 years agoChange version to 3.8 devel.
Tatsuo Ishii [Fri, 2 Mar 2018 05:22:18 +0000 (14:22 +0900)]
Change version to 3.8 devel.

7 years agoFix document typos.
Bo Peng [Wed, 28 Feb 2018 08:46:54 +0000 (17:46 +0900)]
Fix document typos.

7 years agoAdd new regression test for node 0 not being primary.
Tatsuo Ishii [Tue, 27 Feb 2018 05:04:20 +0000 (14:04 +0900)]
Add new regression test for node 0 not being primary.

7 years agoFix failure in replication mode.
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.

7 years agoAllow to support pgpool_switch_xlog PostgreSQL 10.
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.

7 years agoRevert "Fix pgpool child process segfault when ALWAYS_MASTER is on."
Tatsuo Ishii [Mon, 26 Feb 2018 08:01:50 +0000 (17:01 +0900)]
Revert "Fix pgpool child process segfault when ALWAYS_MASTER is on."

This reverts commit 9022ff842fb5dbbe06e2f2f4cf38fadf47b592da.

With the commit, write queries are always sent to node 0 even if the
primary node is not 0 because PRIMARY_NODE_ID macro returns
REAL_MASTER_NODE_ID, which is usually 0. Thus write queries are failed
with:
ERROR:  cannot execute INSERT in a read-only transaction

7 years agoAdd description about temporarily installation for the test.
Tatsuo Ishii [Mon, 19 Feb 2018 05:44:39 +0000 (14:44 +0900)]
Add description about temporarily installation for the test.

7 years agoAllow to test using temporary installation.
Tatsuo Ishii [Mon, 19 Feb 2018 05:37:11 +0000 (14:37 +0900)]
Allow to test using temporary installation.

Most necessary stuffs for this was stolen fro regress.sh.

7 years agoEnhance extended query test.
Tatsuo Ishii [Mon, 19 Feb 2018 05:19:30 +0000 (14:19 +0900)]
Enhance extended query test.

Add extra_scripts directory to include extra scripts to be executed
after main test script (tests) run.  Currently only scripts for
parse-before-bind.data parse-before-bind-2.data exist so that the test
confirm the load balancing behavior.

Also some tests are fixed so that they can run individually in that a
table for testing is dropped at the end of the test and test results
are not affected by the existence of the table.

7 years agoFix pgpool_adm family functions examples.
Tatsuo Ishii [Wed, 14 Feb 2018 09:05:13 +0000 (18:05 +0900)]
Fix pgpool_adm family functions examples.

Wrong function names are used.

7 years agoStart 3.8 development.
Tatsuo Ishii [Wed, 14 Feb 2018 05:08:59 +0000 (14:08 +0900)]
Start 3.8 development.

- Set version string to "3.8devel".
- Set new code name "torokiboshi".
- Regenerate gram.[ch].
- Enable maintainer mode in configure.ac.

7 years agoAdd release-notes 3.7.2 - 3.3.20.
Bo Peng [Tue, 13 Feb 2018 05:06:22 +0000 (14:06 +0900)]
Add release-notes 3.7.2 - 3.3.20.

7 years agoMerge branch 'master' of ssh://git.postgresql.org/pgpool2
Bo Peng [Mon, 12 Feb 2018 14:43:07 +0000 (23:43 +0900)]
Merge branch 'master' of ssh://git.postgresql.org/pgpool2

7 years agoFix typos.
Bo Peng [Mon, 12 Feb 2018 14:41:04 +0000 (23:41 +0900)]
Fix typos.

7 years agoFix figures mistakes.
Bo Peng [Mon, 12 Feb 2018 14:29:13 +0000 (23:29 +0900)]
Fix figures mistakes.

7 years agoAllow to build with libressl.
Tatsuo Ishii [Sat, 10 Feb 2018 11:13:16 +0000 (20:13 +0900)]
Allow to build with libressl.

Per [pgpool-hackers: 2714].
Patch by Sandino Araico Sanchez.

7 years agoFix writing transaction flag is accidentally set at commit or rollback.
Tatsuo Ishii [Fri, 9 Feb 2018 04:18:50 +0000 (13:18 +0900)]
Fix writing transaction flag is accidentally set at commit or rollback.

We set writing transaction flag if it's a write query while processing
an execute message. However, the flag is set even it's a commit or
rollback. This is an oversight. The flag is reset while starting next
transaction anyway, so it's actually harmless but a bug is a bug.

7 years agoThrow a warning message when failover consensus settings on watchdog nodes differs.
Muhammad Usama [Thu, 1 Feb 2018 14:55:16 +0000 (19:55 +0500)]
Throw a warning message when failover consensus settings on watchdog nodes differs.

7 years agoFix document typo.
Bo Peng [Wed, 31 Jan 2018 02:39:37 +0000 (11:39 +0900)]
Fix document typo.

7 years agoFix bug with socket writing.
Tatsuo Ishii [Mon, 29 Jan 2018 10:13:21 +0000 (19:13 +0900)]
Fix bug with socket writing.

pool_write_flush() is responsible for writing to sockets when pgpool's
write buffer is full (this function was introduced in 3.6.6 etc). When
network write buffer in kernel is full, it does retrying but it forgot
to update the internal buffer pointer. As a result, broken data is
written to the socket. This results in variety of problems including
too large message length.

7 years agoSet TCP_NODELAY and non blocking to frontend socket.
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.

7 years agoFix pgpool child process segfault when ALWAYS_MASTER is on.
Tatsuo Ishii [Mon, 29 Jan 2018 04:04:58 +0000 (13:04 +0900)]
Fix pgpool child process segfault when ALWAYS_MASTER is on.

If following conditions are all met pgpool child segfaults:

1) Streaming replication mode.

2) fail_over_on_backend_error is off.

3) ALWAYS_MASTER flags is set to the master (writer) node.

4) pgpool_status file indicates that the node mentioned in #3 is in
   down status.

What happens here is,

1) find_primary_node() returns node id 0 without checking the status
   of node 0 since ALWAYS_MASTER is set. It's remembered as the
   primary node id. The node id is stored in Req_info->primary_node_id.

2) The connection to backend 0 is not created since pgpool_status says
   it's in down status.

3) upon starting of session, select_load_balancing_node () is called
   and it tries to determine the database name from client's start up
   packet.

4) Since MASTER_CONNECTION macro points to the PRIMARY_NODE,
   MASTER_CONNECTION(ses->backend) is NULL and it results in a segfault.

The fix I propose is, to change PRIMARY_NODE_ID macro so that it
returns REAL_MASTER_NODE_ID (that is the youngest node id which is
alive) if the node id in Req_info->primary_node_id is in down status.
So we have the "true" primary node id in Req_info->primary_node_id,
and "fake" primary node id returned by PRIMARY_NODE_ID macro.

See [pgpool-hackers: 2687] and [pgpool-general: 5881] Pgpool-3.7.1
segmentation fault for more details.

Since ALWAYS_MASTER flag was introduced in 3.7, back pached to 3.7
only.

Per bug report from Philip Champon.

7 years agoFix segfault when %a is in log_line_prefix and debug message is on.
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.

7 years agoFix per node health check parameters.
Tatsuo Ishii [Tue, 23 Jan 2018 04:24:40 +0000 (13:24 +0900)]
Fix per node health check parameters.

Some them were string types, that should have been integer types.

7 years agoChange systemd service file to use STOP_OPTS=" -m fast".
Bo Peng [Fri, 19 Jan 2018 05:00:27 +0000 (14:00 +0900)]
Change systemd service file to use STOP_OPTS=" -m fast".

7 years agoChange pgpool_setup to add restore_command in recovery.conf.
Bo Peng [Fri, 19 Jan 2018 04:58:44 +0000 (13:58 +0900)]
Change pgpool_setup to add restore_command in recovery.conf.

7 years agoFix queries hanging in parse_before_bind with extended protocol and replication ...
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.

7 years agoFix comment typo.
Tatsuo Ishii [Wed, 10 Jan 2018 08:29:58 +0000 (17:29 +0900)]
Fix comment typo.

7 years agoAdd 3.7.1 - 3.3.19 release-notes.
Bo Peng [Mon, 8 Jan 2018 06:46:34 +0000 (15:46 +0900)]
Add 3.7.1 - 3.3.19 release-notes.

7 years agoImprove Makefiles.
Bo Peng [Mon, 8 Jan 2018 06:13:11 +0000 (15:13 +0900)]
Improve Makefiles.

Patch provided by Tomoaki Sato.

7 years agoFix document typo.
Bo Peng [Sat, 6 Jan 2018 07:16:17 +0000 (16:16 +0900)]
Fix document typo.

7 years agoReplace /bin/ed with /bin/sed.
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.

7 years agoChange the pgpool.service and sysconfig files to output Pgpool-II log.
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.

7 years agoFix some document errors.
Bo Peng [Thu, 21 Dec 2017 03:34:05 +0000 (12:34 +0900)]
Fix some document errors.

7 years agoAdd documentation for SGML document build.
Tatsuo Ishii [Tue, 19 Dec 2017 08:33:31 +0000 (17:33 +0900)]
Add documentation for SGML document build.

7 years agoFix per node health check parameters ignored.
Tatsuo Ishii [Tue, 19 Dec 2017 01:09:46 +0000 (10:09 +0900)]
Fix per node health check parameters ignored.

Per bug 371. Back patch to the 3.7 stable tree where the feature was
introduced.

Also pgpool_setup is modified to add appropriate per node health check
parameters to pgpool.conf.  This is necessary because
pgpool.conf.sample sets health_check_user0 to 'nobody', which
immediately causes health check failure on DB node 0.

7 years agoFix health checking process death and forking forever.
Tatsuo Ishii [Mon, 18 Dec 2017 22:25:35 +0000 (07:25 +0900)]
Fix health checking process death and forking forever.

When failed to read from backend socket (this could happen when wrong
health_check_user is specified), the health check process raises a
FATAL error in pool_read(), which causes death of health check
process. And Pgpool-II main forks off a new health check process. This
repeats forever.

Fix is, check the process type and it raises if the type is HEALTH
CHECK in addition to MAIN.

Back patch to 3.7 stable tree as well.

7 years agoFix some test script error of 002.native_replication.
Bo Peng [Mon, 18 Dec 2017 02:31:59 +0000 (11:31 +0900)]
Fix some test script error of 002.native_replication.

7 years agoFix timestamp data inconsistency by replication mode.
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".

7 years agoFix watchdog_setup up doc.
Tatsuo Ishii [Thu, 14 Dec 2017 04:21:20 +0000 (13:21 +0900)]
Fix watchdog_setup up doc.

It lacked to mention that it supports logical replication mode.

7 years agoDowngrade a log message to debug message.
Tatsuo Ishii [Thu, 14 Dec 2017 04:06:35 +0000 (13:06 +0900)]
Downgrade a log message to debug message.

That was mistaken left while last development cycle.

7 years agoAdd test data for bug370.
Tatsuo Ishii [Wed, 13 Dec 2017 05:13:06 +0000 (14:13 +0900)]
Add test data for bug370.

7 years agoFix for re-sync logic in reading packet from backend.
Tatsuo Ishii [Tue, 12 Dec 2017 06:18:56 +0000 (15:18 +0900)]
Fix for re-sync logic in reading packet from backend.

read_kind_from_backend(), which reads message kind from backend,
re-syncs backend nodes when a ready for query message is
received. Unfortunately it forgot to call
pool_pending_message_pull_out() to delete sync pending message. This
leads to random stuck while reading packets from backend. Fix this to
call pool_pending_message_pull_out().

7 years agoFix bug reported in bug370.
Tatsuo Ishii [Mon, 11 Dec 2017 23:13:16 +0000 (08:13 +0900)]
Fix bug reported in bug370.

If an erroneous query is sent to primary and the next query requires a
catalog cache look up, Pgpool-II hangs in do_query().  do_query()
calls pool_push_pending_data() which expects response from backend
because it internally send CLOSE message and flush message. In normal
cases this guarantees some response from backend at least. However
since the backend is in error state, any command including CLOSE sent
by pool_push_pending_data() is ignored.

This only happens if the erroneous query is sent to primary and
without a sync message next query is sent *and* the query requires
catalog cache look up.

Fix is, let pool_push_pending_data() detect an error message and set
ignore_till_sync flag. This will let do_query() just pops the data
pushed in pool_push_pending_data(). pool_search_relcache(), caller of
do_query(), in turn checks the flag. If the flag is set, do not cache
the result. The caller of pool_search_relcache(), pool_select_walker()
may get wrong result, which may let where_to_send() (caller of
pool_select_walker) choose wrong db node, but this is harmless because
ignore_till_sync flag is set.

7 years agoFix returning transaction state when "ready for query" message received.
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.

7 years agoFix but with extended-query-test test driver.
Tatsuo Ishii [Sun, 10 Dec 2017 08:54:06 +0000 (17:54 +0900)]
Fix but with extended-query-test test driver.

The driver checked directory "result" instead of "results".

7 years agoEnhance documents.
Tatsuo Ishii [Thu, 23 Nov 2017 09:10:59 +0000 (18:10 +0900)]
Enhance documents.

restrictions.sgml: use "xreflabel" in the sect1 title so that xref can
render proper label.

runtime.sgml: enhance "Running mode of Pgpool-II" section.

7 years agoEnhance documents.
Tatsuo Ishii [Thu, 23 Nov 2017 08:40:24 +0000 (17:40 +0900)]
Enhance documents.

restrictions.sgml: use "xreflabel" in the sect1 title so that xref can
render proper label.

runtime.sgml: enhance "Running mode of Pgpool-II" section.

7 years agoChange the test script directory name to fix some make dist error. V3_7_0 V3_7_0_RPM
Bo Peng [Tue, 21 Nov 2017 07:43:20 +0000 (16:43 +0900)]
Change the test script directory name to fix some make dist error.

7 years agoPrepare 3.7.0.
Bo Peng [Tue, 21 Nov 2017 07:05:56 +0000 (16:05 +0900)]
Prepare 3.7.0.

7 years agoEnhancing few comments in pgpool.conf sample files
Muhammad Usama [Fri, 17 Nov 2017 13:55:47 +0000 (18:55 +0500)]
Enhancing few comments in pgpool.conf sample files

7 years agoFix pgpool start message printed multiple times.
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.

7 years agoAdd an execute permission bit to the start/stop script.
Tatsuo Ishii [Tue, 14 Nov 2017 23:18:13 +0000 (08:18 +0900)]
Add an execute permission bit to the start/stop script.

7 years agoPrepare 3.7RC1. V3_7_0_RC1 V3_7_0_RC1_RPM
pengbo [Sun, 12 Nov 2017 07:15:10 +0000 (16:15 +0900)]
Prepare 3.7RC1.

7 years agoAdd 3.7RC1 release-notes.
pengbo [Sun, 12 Nov 2017 07:09:48 +0000 (16:09 +0900)]
Add 3.7RC1 release-notes.

7 years agoAdd some watchdog test cases
Muhammad Usama [Thu, 9 Nov 2017 13:46:52 +0000 (18:46 +0500)]
Add some watchdog test cases

7 years agoChange the "failover_when_quorum_exists", "failover_require_consensus"
pengbo [Thu, 9 Nov 2017 02:22:44 +0000 (11:22 +0900)]
Change the "failover_when_quorum_exists", "failover_require_consensus"
and "enable_multiple_failover_requests_from_node" default value to "on/off".

7 years agoFix for a possible issue in watchdog failover handling.
Muhammad Usama [Thu, 2 Nov 2017 13:48:43 +0000 (18:48 +0500)]
Fix for a possible issue in watchdog failover handling.

Watchdog process should make sure that it's Master/coordinator status is
synchronised across the watchdog cluster before accepting the failover requests.
This will make sure that no other node is processing the same failover request.

7 years agoAdd pgpool_rhel7.sysconfig and pgpool_rhel6.sysconfig files to distribution.
pengbo [Wed, 1 Nov 2017 00:54:26 +0000 (09:54 +0900)]
Add pgpool_rhel7.sysconfig and pgpool_rhel6.sysconfig files to distribution.

7 years agoAdd 3.3.18 - 3.6.7 release notes.
pengbo [Tue, 31 Oct 2017 23:49:57 +0000 (08:49 +0900)]
Add 3.3.18 - 3.6.7 release notes.

7 years agoAdd different pgpool.sysconfig file for RHEL6 and RHEL7.
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.

7 years agoFixing an issue in the handling of pg_terminate_backend()
Muhammad Usama [Wed, 25 Oct 2017 15:22:38 +0000 (20:22 +0500)]
Fixing an issue in the handling of pg_terminate_backend()

In some cases pg_terminate_backend() can cause failover even when
the call is properly issued through Pgpool-II.

This problem is, we do not set of the swallow_termination flag when the
pg_terminate_backend refers to the backend connection of the child
process on which the pg_terminate_backend() was issued.
This was due to the wrong assumption, that we always get the proper
socket close indication when backend to terminate is the same on which
pg_terminate_backend() is issued, Apparently this is not the case,
and PostgreSQL backend can still get abruptly killed even when it is
asked to terminate itself, And this abrupt termination of the connection
makes the Pgpool-II to consider it as a backend failure.

The solution to this is to always set the swallow_termination, even when the
pg_terminate_backend is referring to the local backend connection.

7 years agoFix centos6 compiler error. V3_7_0_BETA1 V3_7_0_BETA1_RPM
pengbo [Mon, 16 Oct 2017 12:18:51 +0000 (21:18 +0900)]
Fix centos6 compiler error.

7 years agoAllow make dist to include pgpool.conf.sample-logical file.
pengbo [Mon, 16 Oct 2017 06:02:36 +0000 (15:02 +0900)]
Allow make dist to include pgpool.conf.sample-logical file.

7 years agoUpdate documentation version to 3.7beta1.
pengbo [Mon, 16 Oct 2017 01:53:29 +0000 (10:53 +0900)]
Update documentation version to 3.7beta1.

7 years agoDisable AM_MAINTAINER_MODE.
pengbo [Mon, 16 Oct 2017 01:04:23 +0000 (10:04 +0900)]
Disable AM_MAINTAINER_MODE.

7 years agoPrepare 3.7beta1.
pengbo [Mon, 16 Oct 2017 01:01:48 +0000 (10:01 +0900)]
Prepare 3.7beta1.

7 years agoEnglish/Japanese documentation updates.
pengbo [Sun, 15 Oct 2017 22:53:30 +0000 (07:53 +0900)]
English/Japanese documentation updates.

7 years agoUpdate Japanese document for pool_hba enhancements.
pengbo [Sun, 15 Oct 2017 22:47:32 +0000 (07:47 +0900)]
Update Japanese document for pool_hba enhancements.

7 years agoAdd Japanese document "5.14.6 Controlling the Failover behavior".
pengbo [Sun, 15 Oct 2017 22:45:17 +0000 (07:45 +0900)]
Add Japanese document "5.14.6 Controlling the Failover behavior".