Muhammad Usama [Mon, 13 Feb 2017 19:34:56 +0000 (00:34 +0500)]
Fix for [pgpool-general: 5315] pg_terminate_backend
Pgpool-II process the pg_terminate_backend by setting the swallow_termination
flag of the backend connection_info referred in the pg_terminate_backend
function, and latter resets that flag when the query execution completes.
The problem with this approach is that if the command complete for
the pg_terminate_backend is received before the connection termination,
This termination is regarded as the backend failure since the
swallow_termination flag was already cleared by the Pgpool-II child after
receiving the query completion message.
The solution is to reset the swallow_termination flag only when the
pg_terminate_query query fails otherwise leave it as it is when the query
is successful, Since, after the termination of the connection the flag
will not matter anyway.
Tatsuo Ishii [Thu, 9 Feb 2017 09:11:04 +0000 (18:11 +0900)]
Enhance document.
Add note about %m in failover command. Add indexes to "streaming
replication mode", "master slave mode" and "native replication mode".
Muhammad Usama [Mon, 6 Feb 2017 14:41:31 +0000 (19:41 +0500)]
Adding the missing ExecStop and ExecReload commands to the systemd
service configuration file.
The patch was contributed by supp_k and enhanced by me.
Muhammad Usama [Mon, 30 Jan 2017 12:56:08 +0000 (17:56 +0500)]
Fix for 281: "segmentation fault" when execute pcp_attach_node
A DEBUG message was trying to de-reference a NULL value.
Tatsuo Ishii [Mon, 30 Jan 2017 07:30:57 +0000 (16:30 +0900)]
Fix load balancing bug in streaming replication mode.
In an explicit transaction, any SELECT will be load balanced until
write query is sent. After writing query is sent, any SELECT should be
sent to the primary node. However if a SELECT is sent before a sync
message is sent, this does not work since the treatment of writing
query is done after ready for query message arrives. Solution is, the
treatment for writing query is done in executing the writing query as
well.
The bug has been there since V3.5.
Tatsuo Ishii [Mon, 30 Jan 2017 06:29:29 +0000 (15:29 +0900)]
Fix yet another kind mismatch error in streaming replication mode.
1) Parse "BEGIN" using statement S1, and it is sent to both node 0 and 1.
2) Close S1.
3) Parse SELECT using S1, and it is sent to node 0 (or 1).
4) Bind retrieves info (sent_messages) regarding S1. Since Pgpool-II
only removes info on S1 when CloseComplete received, Bind decides
to send bind message to both node 0 & 1 because it was the info
regarding BEGIN. Node 0 or 1 tries to bind to non existent
statement S1.
As a result, something like "failed to read kind from backend.
kind mismatch among backends. Possible last query was: "BEGIN" kind
details are: 0[E: prepared statement "S1" does not exist] 1[3]
check data consistency among db nodes" occurs.
Note that in 3) if other than S1 is used, the problem does not occur.
Solution is, removing S1 when Close message is received. This problem
has been there since 3.5.0 was out.
Tatsuo Ishii [Fri, 27 Jan 2017 07:12:47 +0000 (16:12 +0900)]
Fix do_query() hangs after close message.
This is an en-bug in 3.6.1.
If an extend query appears right after a close message, do_query() is
called to check system catalogs, it hangs because it expects to read
pending data. This is caused by being mistakenly set the pending flag
after Close().
Back patch to 3.6-stable and 3.5-stable.
Muhammad Usama [Thu, 26 Jan 2017 20:53:42 +0000 (01:53 +0500)]
Fixing
0000280: stack smashing detected
It was a buffer overflow in wd_get_cmd function
Tatsuo Ishii [Tue, 24 Jan 2017 23:17:51 +0000 (08:17 +0900)]
Fix indentations of query cache documents.
Tatsuo Ishii [Tue, 24 Jan 2017 23:13:25 +0000 (08:13 +0900)]
Enhance query cache documents.
Muhammad Usama [Thu, 19 Jan 2017 15:58:24 +0000 (20:58 +0500)]
Fixing the issue with the watchdog process restart.
When the watchdog process gets abnormally terminated because of some problem
(e.g. Segmentation fault) the new spawned watchdog process fails to start and
produces an error "bind on ... failed with reason: Address already in use".
Reason is the abnormally terminating watchdog process never gets the time to
clean-up the socket it uses for IPC and the new process gets an error because
the socket address is already occupied
Fix is, the Pgpool main process sets the flag in shared memory to mark the
watchdog process was abnormally terminated and at startup when the watchdog
process see that the flag is set, it performs the clean up of the socket file and
also performs the de-escalation (If the watchdog process was crashed when it
was master/coordinator node) if required before initializing itself.
Tatsuo Ishii [Wed, 18 Jan 2017 23:24:34 +0000 (08:24 +0900)]
Fix query cache bug reported in pgpool-general-jp:1441.
In streaming replication mode with query cache enabled, SELECT hangs
in the following scenario:
1) a SELECT hits query cache and returns rows from the query cache.
2) following SELECT needs to search meta data and it hangs.
In #1, while returning the cached result, it misses to call
pool_unset_pending_response(), which leave the pending_response flag
be set. In #2, do_query() checks the flag and tries to read pending
response from backend. Since there's no pending data in backend, it
hangs in reading data from backend.
Fix is, just call pool_unset_pending_response() in #1 to reset the
flag.
Bug report and fix provided by Nobuyuki Nagai.
New regression test item (068) added by me.
Tatsuo Ishii [Tue, 10 Jan 2017 23:24:32 +0000 (08:24 +0900)]
Remove elog/ereport calls from signal handlers.
elog/ereport calls malloc(), which is not safe to be called inside
signal handlers, per discussion in [pgpool-hackers: 1950]. I ifdef
out them, rather than simply remove them in a hope we someday find a
better solution which make calling the functions inside signal
handlers.
Not that I did not touch exit_handler() of pgpool_main.c because
removing elog/ereport from them loses informative message like
"received smart shutdown request". Pgpool-II main process do not
heavily use malloc(), so the risk is minimum, I guess.
pengbo [Tue, 10 Jan 2017 08:35:29 +0000 (17:35 +0900)]
Fix typo in Japanese release notes.
pengbo [Tue, 10 Jan 2017 07:59:37 +0000 (16:59 +0900)]
Fix bug failed to create INET domain socket in FreeBSD if listen_addresses = '*'.
per bug202.
Muhammad Usama [Wed, 4 Jan 2017 13:23:33 +0000 (18:23 +0500)]
Fix for
0000249: watchdog sometimes fails de-escalation.
The logic in pgpool-II main process exit_handler and terminate_all_childrens was
not making sure that pgpool-II main process should only exit after all its
children have exited. And the problem occurs when the main process shutdowns
itself before watchdog and de-escalation child processes.
The solution is to use the waitpid() system call without WNOHANG option.
Yugo Nagata [Wed, 4 Jan 2017 05:20:24 +0000 (14:20 +0900)]
Fix connection_life_time broken by authentication_timeout
When authentication_timeout is enabled,
connection_life_time could never be expired, because
alarm(0) is called at reading start-up packet.
When there only one connection pool is used, this
problem doesn't occur because the signal handler
for connection_life_time is always set at the end
of the session. However, if more than one connection
pools exist, the handler isn't set but only the time
to colse the connection is calculated.
To fix it, when authentication_timeout is enabled,
save the signal handler for conneciont_life_time
and the remaining time, and undo the handler when
authentication_timeout is disabled.
Yugo Nagata [Wed, 28 Dec 2016 08:37:11 +0000 (17:37 +0900)]
Fix authentication timeout that can occur right after client connecttions
This is possible when connection_life_time is enabled.
SIGALRM signal is used for both connection_life_time and
authentication_timeout. Usually, SIGALRM is for connection_life_time,
but when the new connection is arrive, read_startup_packet() is called,
and the handler for authentication_timeout is set by pool_signal() and
alarm(authentication_timeout) is called in enable_authentication_timeout().
However, if connection_life_time is expired **between pool_signal() and
alarm()**, authenticate_timeout() will be called when connection_life_time
is expired instead of pool_backend_timer_handler().
To fix this, call alarm() before pool_signal() to prevent the signal
handler from being with wrong timing.
pengbo [Mon, 26 Dec 2016 02:35:42 +0000 (11:35 +0900)]
Some changes in release note 3.1-3.6.
pengbo [Sun, 25 Dec 2016 15:53:50 +0000 (00:53 +0900)]
Add Japanese release note 3.1-3.6.
Muhammad Usama [Fri, 23 Dec 2016 14:58:53 +0000 (19:58 +0500)]
Tightening up the watchdog security
Now wd_authkey uses the HMAC SHA-256 hashing.
pengbo [Thu, 22 Dec 2016 02:10:36 +0000 (11:10 +0900)]
Add pgpool_adm extension.
Tatsuo Ishii [Tue, 20 Dec 2016 07:50:57 +0000 (16:50 +0900)]
Add release 3.1-3.6 release notes.
The contents are not accurate at this moment except 3.6.1. They are
just copy of 3.5.5 release note.
Tatsuo Ishii [Tue, 20 Dec 2016 07:23:09 +0000 (16:23 +0900)]
Add 3.5.5 release note.
Tatsuo Ishii [Thu, 22 Dec 2016 01:24:25 +0000 (10:24 +0900)]
Update Pgpool-II version to "3.7devel".
Tatsuo Ishii [Tue, 20 Dec 2016 02:38:12 +0000 (11:38 +0900)]
Fix occasional segfault when query cache is enabled.
Per bug 263.
Tatsuo Ishii [Tue, 20 Dec 2016 01:28:20 +0000 (10:28 +0900)]
Fix packet kind does not match error in extended protocol per bug 231.
According to the bug231, the bug seem to bite you if all of following
conditions are met:
- Streaming replication mode
- Load balance node is not node 0
- Extended protocol is used
- SELECT is executed, the statement is closed, then a transaction
command is executed
The sequence of how the problem bites is:
1) SELECT executes on statement S1 on the load balance node 1
2) Frontend send Close statement
3) Pgool-II forward it to backend 1
4) Frontend sends Parse, Bind, Execute of COMMIT
5) Pgool-II forward it to backend 0 & 1
6) Frontend sends sync message
7) Pgool-II forward it to backend 0 & 1
8) Backend 0 replies back Parse complete ("1"), while backend 1
replies back close complete ("3") because of #3.
9) Kind mismatch occurs
The solution is, in #3, let Pgpool-II wait for response from backend
1, but do not read the response message. Later on Pgpool-II's state
machine will read the response from it before the sync message is sent
in #6. With this, backend 1 will reply back "1" in #8, and the kind
mismatch error does not occur.
Also, fix not calling pool_set_doing_extended_query_message() when
receives Close message. (I don't know why it was missed).
New regression test "067.bug231" was added.
Tatsuo Ishii [Tue, 20 Dec 2016 01:25:44 +0000 (10:25 +0900)]
Enhance documentation.
"Tips for Installation" section added.
Tatsuo Ishii [Tue, 20 Dec 2016 01:13:55 +0000 (10:13 +0900)]
Enhance documentation.
Add "Tips for Installation" section added.
Tatsuo Ishii [Tue, 6 Dec 2016 04:28:36 +0000 (13:28 +0900)]
Fix a race condition in a signal handler per bug 265.
In child.c there's signal handler which calls elog. Since the signal
handler is not blocked against other signals while processing, deadlock
could occur in the system calls in the pgpool shutdown sequence. To
fix the problem, now the signal handler is blocked by using
POOL_SETMASK.
Ideally we should avoid calling elog in signal handlers though.
Tatsuo Ishii [Thu, 24 Nov 2016 01:16:51 +0000 (10:16 +0900)]
Fix wrong minimum configuration value for client_idle_limit_in_recovery.
Per bug #264.
pengbo [Tue, 22 Nov 2016 03:43:35 +0000 (12:43 +0900)]
Merge branch 'master' of ssh://git.postgresql.org/pgpool2
pengbo [Tue, 22 Nov 2016 03:42:02 +0000 (12:42 +0900)]
Some changes in Makefile.in of doc and doc.ja
Tatsuo Ishii [Tue, 22 Nov 2016 02:21:01 +0000 (11:21 +0900)]
Allow to execute "make xslthtml" under doc.ja.
pengbo [Tue, 22 Nov 2016 02:16:13 +0000 (11:16 +0900)]
Change pgpool.spec to install sgml docs and man.
pengbo [Mon, 21 Nov 2016 10:41:37 +0000 (19:41 +0900)]
Add some necessary file to EXTRA_DIST to build sgml file.
pengbo [Mon, 21 Nov 2016 09:01:48 +0000 (18:01 +0900)]
Prepare 3.6.0
Yugo Nagata [Mon, 21 Nov 2016 01:07:20 +0000 (10:07 +0900)]
Unify the term in the Japanese document
Yugo Nagata [Sun, 20 Nov 2016 22:24:40 +0000 (07:24 +0900)]
Add some missing documents about load-balancing.
Some untranslated statement are also translated.
Muhammad Usama [Fri, 18 Nov 2016 10:20:07 +0000 (15:20 +0500)]
Adding AWS watchdog example
Tatsuo Ishii [Fri, 18 Nov 2016 02:46:48 +0000 (11:46 +0900)]
Translate AWS watchdog example.
Bo Peng [Wed, 16 Nov 2016 06:14:48 +0000 (15:14 +0900)]
Prepare 3.6RC1
Bo Peng [Wed, 16 Nov 2016 03:07:33 +0000 (12:07 +0900)]
Add Japanese and English release note
Muhammad Usama [Tue, 15 Nov 2016 13:46:02 +0000 (18:46 +0500)]
some watchdog log message enhancements
Tatsuo Ishii [Mon, 14 Nov 2016 23:16:52 +0000 (08:16 +0900)]
Translate the difference of docs made in the commit
f6ec43456cf91231d92d34fef4b1b44055bc1180.
Muhammad Usama [Mon, 14 Nov 2016 21:32:36 +0000 (02:32 +0500)]
Fixing a potential crash in pool_stream functions.
POOL_CONNECTION->con_info should be checked for null value before de-referencing
when read or write fails on backend socket.
Muhammad Usama [Mon, 14 Nov 2016 19:32:01 +0000 (00:32 +0500)]
Fixing the design of failover command propagation on watchdog cluster
Overhauling the design of how failover, failback and promote node commands are
propagated to the watchdog nodes. Previously the watchdog on pgpool-II node that
needs to perform the node command (failover, failback or promote node) used to
broadcast the failover command to all attached pgpool-II nodes. And this
sometimes makes the synchronization issues, especially when the watchdog cluster
contains a large number of nodes and consequently the failover command sometimes
gets executed by more than one pgpool-II.
Now with this commit all the node commands are forwarded to the
master/coordinator watchdog, which in turn propagates to all standby nodes.
Apart from above the commit also changes the failover command interlocking
mechanism and now only the master/coordinator node can become the lock holder
so the failover commands will only get executed on the master/coordinator node.
Muhammad Usama [Wed, 9 Nov 2016 20:22:12 +0000 (01:22 +0500)]
Fix the broken log_destination = syslog functionality.
Fixing the logging to the syslog destination, which got broken by the
PGPOOL SET/SHOW command commit, and also enhancing the log_destination
configuration parameter to be assigned with the comma separated list of multiple
destinations for the Pgpool-II log. Now, after this commit log_destination can
be set to any combination of 'syslog' and 'stderr' log destinations.
Tatsuo Ishii [Wed, 9 Nov 2016 08:18:06 +0000 (17:18 +0900)]
Fix untranslated sentence.
Tatsuo Ishii [Wed, 9 Nov 2016 08:12:17 +0000 (17:12 +0900)]
Adjust RPM installing description to pgpool-II-pg96.
Tatsuo Ishii [Wed, 9 Nov 2016 04:56:47 +0000 (13:56 +0900)]
Add RPM installation section.
Tatsuo Ishii [Wed, 9 Nov 2016 00:10:16 +0000 (09:10 +0900)]
Enhance the release note.
Add mention that now man pages are generated from SGML documents.
pengbo [Tue, 8 Nov 2016 10:42:20 +0000 (19:42 +0900)]
Merge branch 'master' of ssh://git.postgresql.org/pgpool2
pengbo [Tue, 8 Nov 2016 10:40:32 +0000 (19:40 +0900)]
specファイルを変更
pengbo [Tue, 8 Nov 2016 04:46:38 +0000 (13:46 +0900)]
Prepare 3.6beta2
pengbo [Tue, 8 Nov 2016 04:25:18 +0000 (13:25 +0900)]
Fix compile error and add man page
pengbo [Tue, 8 Nov 2016 02:39:17 +0000 (11:39 +0900)]
Fix compile error
pengbo [Tue, 8 Nov 2016 02:09:56 +0000 (11:09 +0900)]
fix 3.6alpha1, beta1 compile error and allow "make dist" to include generated man apges.
Tatsuo Ishii [Mon, 7 Nov 2016 08:53:37 +0000 (17:53 +0900)]
Allow to create man pages from SGML.
For this purpose, following changes are made:
- Allow to properly create pgpool.xml. For this purpose, add checking
for xmllint to configure.ac.
- Fix m4/docbook.m4 to not throw an error and properly set
DOCKBOOKSTYLE variable. (not sure if this is related to the fix
though. Anyway, this seems suppress shell errors while configure)
- Allow osx to process UTF-8 documents in doc.ja directory.
- Fix SGML tags in start.sgml and installation.sgml to suppress XML
validation errors generated by xmllint.
pengbo [Fri, 4 Nov 2016 05:06:21 +0000 (14:06 +0900)]
Prepare 3.6beta1
Tatsuo Ishii [Thu, 3 Nov 2016 08:33:35 +0000 (17:33 +0900)]
Fix typo in release-3.6.sgml.
Tatsuo Ishii [Wed, 2 Nov 2016 06:58:26 +0000 (15:58 +0900)]
Allow to "make dist" to include generated html files.
pengbo [Wed, 2 Nov 2016 05:49:30 +0000 (14:49 +0900)]
Prepare 3.6 beta1
pengbo [Wed, 2 Nov 2016 05:40:49 +0000 (14:40 +0900)]
add change in doc of 3.6 in pcp_node_info command
Yugo Nagata [Wed, 2 Nov 2016 05:34:24 +0000 (14:34 +0900)]
Translate examples.sgml into Japanese
Yugo Nagata [Wed, 2 Nov 2016 03:00:08 +0000 (12:00 +0900)]
Fix typos
Yugo Nagata [Wed, 2 Nov 2016 02:53:44 +0000 (11:53 +0900)]
Translate client-auth.sgml into Japanese
pengbo [Wed, 2 Nov 2016 02:47:03 +0000 (11:47 +0900)]
fix 3.6 release note
pengbo [Wed, 2 Nov 2016 01:39:40 +0000 (10:39 +0900)]
fix typo in release note
Yugo Nagata [Wed, 2 Nov 2016 01:36:59 +0000 (10:36 +0900)]
Translate SGML into Japanese
- failover.sgml
- memcache.sgml
- misc-config.sgml
- online-recovery.sgml
- ssl.sgml
- stream-check.sgml
- watchdog.sgml
Tatsuo Ishii [Wed, 2 Nov 2016 01:06:10 +0000 (10:06 +0900)]
Fix typos in Japanese translation of release-3.6.sgml.
So far, up to "Fix for avoiding downtime when
<productname>Pgpool-II</productname> changes require a
restart. (Muhammad Usama)" had been checked.
pengbo [Tue, 1 Nov 2016 12:54:04 +0000 (21:54 +0900)]
Merge branch 'master' of ssh://git.postgresql.org/pgpool2
pengbo [Tue, 1 Nov 2016 12:53:04 +0000 (21:53 +0900)]
add Japanese 3.6 releasenote
Yugo Nagata [Tue, 1 Nov 2016 11:01:09 +0000 (20:01 +0900)]
Translate healthcheck.sgml into Japanese
Yugo Nagata [Tue, 1 Nov 2016 08:51:48 +0000 (17:51 +0900)]
Fix a error of commenting-out
Yugo Nagata [Tue, 1 Nov 2016 08:42:08 +0000 (17:42 +0900)]
Add missing translation into loadbalance.sgml
Yugo Nagata [Tue, 1 Nov 2016 08:29:37 +0000 (17:29 +0900)]
Translate loadbalance.sgml into Japanese
Yugo Nagata [Tue, 1 Nov 2016 08:29:14 +0000 (17:29 +0900)]
Translate connection-pooling.sgml into Japanese
Yugo Nagata [Tue, 1 Nov 2016 08:28:43 +0000 (17:28 +0900)]
Fix a paramete type
Yugo Nagata [Tue, 1 Nov 2016 08:25:46 +0000 (17:25 +0900)]
Remove white space at end of line
Yugo Nagata [Mon, 31 Oct 2016 00:15:50 +0000 (09:15 +0900)]
Translate connection-setting.sgml into Japanes
pengbo [Mon, 31 Oct 2016 05:16:58 +0000 (14:16 +0900)]
add Japanese docs for reference
Yugo Nagata [Thu, 27 Oct 2016 11:14:23 +0000 (20:14 +0900)]
Translate connection-setting.sgml into Japanese
Some types fixes and elaboration are also done.
Tatsuo Ishii [Thu, 27 Oct 2016 08:36:28 +0000 (17:36 +0900)]
Adopt the incompatibility with psql of PostgreSQL 9.6.
Since -c option does not imply -X anymore in 9.6, regression fails if
.psqlrc is set, for example "\pset pager" is set.
Tatsuo Ishii [Thu, 27 Oct 2016 08:04:46 +0000 (17:04 +0900)]
Do not cancel a query when the query resulted in an error other than in native replication mode.
It was intended to keep the consistency, but there's no point in other
than native replication mode.
Tatsuo Ishii [Thu, 27 Oct 2016 04:24:56 +0000 (13:24 +0900)]
Remove obsoleted option "-c".
Also fix typo in the help message.
Tatsuo Ishii [Thu, 27 Oct 2016 02:19:12 +0000 (11:19 +0900)]
Minor enhancement on ref/pgpool.sgml.
Tatsuo Ishii [Thu, 27 Oct 2016 01:59:02 +0000 (10:59 +0900)]
Translate ref/pgpool.sgml into Japanese.
Also change document id to "Pgpool-II" to not conflict with the id in
ref/pgpool.sgml.
Tatsuo Ishii [Thu, 27 Oct 2016 01:26:56 +0000 (10:26 +0900)]
Add pgpool command reference manual.
To my surprise, there was no such a manual in the old HTML docs.
Yugo Nagata [Wed, 26 Oct 2016 10:00:29 +0000 (19:00 +0900)]
Translate config.sgml into Japanese
Tatsuo Ishii [Wed, 26 Oct 2016 08:10:24 +0000 (17:10 +0900)]
Add description about supported platform to intro.sgml.
Tatsuo Ishii [Tue, 25 Oct 2016 22:53:12 +0000 (07:53 +0900)]
Update Japanese translation according to the updating of English doc.
Muhammad Usama [Tue, 25 Oct 2016 10:11:42 +0000 (15:11 +0500)]
Rephrasing a section about start/stop watchdog in advanced.sgml
pengbo [Tue, 25 Oct 2016 09:10:46 +0000 (18:10 +0900)]
translate some reference docs into Japanese
Tatsuo Ishii [Tue, 25 Oct 2016 01:13:27 +0000 (10:13 +0900)]
Translate advanced.sgml into Japanese.
Also fix typos in the English doc.
Yugo Nagata [Mon, 24 Oct 2016 11:47:06 +0000 (20:47 +0900)]
Translate runtime.sgml into Japanese
Yugo Nagata [Mon, 24 Oct 2016 08:06:55 +0000 (17:06 +0900)]
Translate installation.sgml into Japanese
Tatsuo Ishii [Mon, 24 Oct 2016 04:45:33 +0000 (13:45 +0900)]
Translate watchdog.sgml into Japanese.
Tatsuo Ishii [Mon, 24 Oct 2016 01:07:25 +0000 (10:07 +0900)]
Translate figure title.
Yugo Nagata [Fri, 21 Oct 2016 08:30:27 +0000 (17:30 +0900)]
Fix typos and add some tags