Yugo Nagata [Fri, 26 Apr 2013 02:52:00 +0000 (11:52 +0900)]
Prepare 3.1.7.
Tatsuo Ishii [Sun, 7 Apr 2013 23:07:51 +0000 (08:07 +0900)]
Fix error message mistakes in detect_postmaster_down_error().
Tatsuo Ishii [Sun, 7 Apr 2013 03:27:19 +0000 (12:27 +0900)]
Fix pool_has_pgpool_regclass() to check execute privilege of pgpool_regclass().
Bug track #53 shows that if pgpool cannot execute pgpool_regclass(),
the connection to backend hangs. You can reproduce the problem by just
dropping the execute privilege from pgpool_regclass and do some insert
in native replication mode:
2013-04-07 11:47:54 LOG: pid 11799: DB node id: 0 backend pid: 11918 statement: SELECT count(*) FROM pg_catalog.pg_proc AS p WHERE p.proname = 'pgpool_regclass'
2013-04-07 11:47:54 LOG: pid 11799: DB node id: 0 backend pid: 11918 statement: SELECT count(*) FROM pg_catalog.pg_attrdef AS d, pg_catalog.pg_class AS c WHERE d.adrelid = c.oid AND d.adsrc ~ 'nextval' AND c.oid = pgpool_regclass('t1')
2013-04-07 11:47:54 ERROR: pid 11799: do_query: error message from backend: permission denied for function pgpool_regclass
2013-04-07 11:47:54 ERROR: pid 11799: pool_search_relcache: do_query failed
2013-04-07 11:47:54 LOG: pid 11799: DB node id: 0 backend pid: 11918 statement: SELECT attname, d.adsrc, coalesce((d.ads
To fix the problem, use has_function_privilege() for the query and
passes username to pool_search_relcache() instead of
"pgpool_regclass"(this is just a fake parameter) as the search
key.
Tatsuo Ishii [Thu, 4 Apr 2013 02:11:40 +0000 (11:11 +0900)]
Merge branch 'V3_1_STABLE' of ssh://git.postgresql.org/pgpool2 into V3_1_STABLE
Tatsuo Ishii [Wed, 3 Apr 2013 07:20:15 +0000 (16:20 +0900)]
Adopt PostgreSQL 9.3. Patch contributed by Asif Rehman.
Slight editing by Tatsuo Ishii.
Yugo Nagata [Fri, 29 Mar 2013 12:51:29 +0000 (21:51 +0900)]
Fix to calculate replication delay only if standby server is
behind from the primay server.
When the primary server is behind from standby server, negative
value of delay is calculated and the value is assigned to unsigned
variable. It causes a log message informing negative replication
delay. And what is worse, it also causes SELECT queries to be sent
to the primary in load balance even though there are no replication
delay in fact.
The problem is reported and analyzed by Saitoh Hidenori in
[pgpoolgenera-jp: 1145]. (in Japanese)
Tatsuo Ishii [Fri, 29 Mar 2013 09:48:02 +0000 (18:48 +0900)]
Fix bug with md5 auth long user name handling.
If user name is longer than 32 bytes, md5 authentication doesn't work.
Problem reported in [pgpool-general: 1526] [pgPool-II 3.2.3] MD5
authentication and username longer than 32 characters.
Tatsuo Ishii [Mon, 18 Mar 2013 06:58:34 +0000 (15:58 +0900)]
Fix long standing bug with timestamp rewriting code for processing
extended protocol.
Parse() allocate memory using palloc() while rewriting the parse
message. Problem is, the rewritten message was kept in the data which
is managed by pool_create_sent_message() etc. The function assumes
that all the data is in session context memory. However, palloc()
allocates memory in query context of course, and gets freeed later on
when the query context disappears. And the function tries to free the
memory as well, which causes various problems, including segfault and
double free. To fix this, memory to store rewritten message is
allocated using session context. The bug was there since pgpool-II 3.0
was born.
Problem analysis and patch contributed by Naoya Anzai.
Yugo Nagata [Mon, 18 Feb 2013 02:09:45 +0000 (11:09 +0900)]
Fix a compiler warning due to a wrong format specifier.
Tatsuo Ishii [Fri, 8 Feb 2013 12:02:48 +0000 (21:02 +0900)]
Remove unnecessary release note entry.
Yugo Nagata [Fri, 8 Feb 2013 09:40:42 +0000 (18:40 +0900)]
Fix version number in document.
Yugo Nagata [Fri, 8 Feb 2013 07:55:29 +0000 (16:55 +0900)]
Replace double quote to single quote.
Yugo Nagata [Fri, 8 Feb 2013 07:28:39 +0000 (16:28 +0900)]
Prepare 3.1.6.
Yugo Nagata [Fri, 8 Feb 2013 06:59:31 +0000 (15:59 +0900)]
Prepare 3.1.6
Yugo Nagata [Thu, 7 Feb 2013 02:55:10 +0000 (11:55 +0900)]
Update copyright year.
Yugo Nagata [Wed, 6 Feb 2013 11:39:51 +0000 (20:39 +0900)]
Add pool_passwd option to pgpool.conf.sample, pool_process_reporting.c,
and documents.
Yugo Nagata [Wed, 6 Feb 2013 11:11:35 +0000 (20:11 +0900)]
Modify documents to correct information of whether a certain parameter
change requires restart.
Tatsuo Ishii [Thu, 27 Dec 2012 09:20:02 +0000 (18:20 +0900)]
Fix long standing bug with pool_open(). It initializes wrong buffer
pointer. Actually this is harmless because the pointer is
initialized by prior memset() call, though.
Nozomi Anzai [Mon, 17 Dec 2012 04:17:50 +0000 (13:17 +0900)]
Fix read_startup_packet() to reset alarm and free StartupPacket
when pool_read() returns 0 which means incorrect packet length.
Tatsuo Ishii [Sat, 15 Dec 2012 13:52:39 +0000 (22:52 +0900)]
Fix child_exit() to not call send_frontend_exits() if there's no
connection pool, otherwise it segfaults because send_frontend_exits()
referes to objects pointed to by pool_connection_pool. This could
happen in worker_child while it tries to do s_do_auth() and it calls
pool_read() failed to read backend socket then calls child_exit().
Per bug track #44.
Yugo Nagata [Wed, 12 Dec 2012 10:08:19 +0000 (19:08 +0900)]
Fix pg_md5 to output "\n" after user inputs password.
Tatsuo Ishii [Mon, 10 Dec 2012 04:23:16 +0000 (13:23 +0900)]
Fix long standing bug "portal not found" error when replication delay
is too much in streaming replication mode. The bug had been there
since the delay threshold was introduced.
We changed destination DB node if delay threshold exceeds in bind,
describe and execute. However, if parse sends to different node, bind,
describe or execute will fail because no parsed statement or portal
exists. Solution is, not to send to different parse node even if
delay threshold is too much.
Tatsuo Ishii [Fri, 7 Dec 2012 01:16:43 +0000 (10:16 +0900)]
Fix pool_search_relcache() to use MASTER or MASTER_NODE_ID macro,
rather than REAL_MASTER_NODE_ID. In case node 0 fail back in
streaming replication mode, pgpool does not restart child process. So
REAL_MASTER_NODE_ID looks for node 0 con info, which is not present
until new connection to backend made. Thus referring to node con info
results in segfault. MASTER or MASTER_NODE_ID are safe in this
situation because they look at cached former master node id.
Tatsuo Ishii [Fri, 23 Nov 2012 03:58:38 +0000 (12:58 +0900)]
Fix reaper() not to exit wait3() loop when catches pcp or worker child
exit event. Otherwise reaper() mistakenly ignore some process exit
event and make a risk of creating zombie process and forgetting to
create new process. Commit
a99744560f54f6723799408cd3623a73b2b335e6
should be enough for pcp child case, but not enough for worker process
case. Problem reported and fix suggested by Goto in
[pgpool-general-jp: 1123].
Nozomi Anzai [Tue, 20 Nov 2012 04:09:03 +0000 (13:09 +0900)]
Fix typo
Tatsuo Ishii [Sun, 18 Nov 2012 09:03:26 +0000 (18:03 +0900)]
Add a description about "-f" to help message.
Tatsuo Ishii [Thu, 15 Nov 2012 23:09:08 +0000 (08:09 +0900)]
Fix pool_send_severity_message() not to use uninitialized memory.
Reported in Bug#33's attached valgrind output:
==20875== Syscall param write(buf) points to uninitialised byte(s)
==20875== at 0x52680D0: __write_nocancel (syscall-template.S:82)
==20875== by 0x41CC49: pool_flush_it (pool_stream.c:436)
==20875== by 0x41CCF8: pool_flush (pool_stream.c:496)
==20875== by 0x417AE4: pool_send_severity_message (pool_process_query.c:1722)
==20875== by 0x417C12: pool_send_error_message (pool_process_query.c:1608)
==20875== by 0x4182A0: read_kind_from_backend (pool_process_query.c:3768)
==20875== by 0x449098: ProcessBackendResponse (pool_proto_modules.c:2562)
==20875== by 0x41B9C4: pool_process_query (pool_process_query.c:274)
==20875== by 0x40B1DF: do_child (child.c:362)
==20875== by 0x404BD4: fork_a_child (main.c:1243)
==20875== by 0x40795B: main (main.c:661)
==20875== Address 0x87cb243 is 275 bytes inside a block of size 8,192 alloc'd
==20875== at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==20875== by 0x41CEF4: pool_open (pool_stream.c:68)
==20875== by 0x40A7B2: do_accept (child.c:784)
==20875== by 0x40AA2A: do_child (child.c:185)
==20875== by 0x404BD4: fork_a_child (main.c:1243)
==20875== by 0x40795B: main (main.c:661)
Tatsuo Ishii [Wed, 14 Nov 2012 14:54:09 +0000 (23:54 +0900)]
Fix hung up while repeating pcp_attach_node and pcp_detatch_node
reported in bug track #32 etc. When node status is changed by
pcp_attach_node and pcp_detatch_node, failover() sends SIGUSR1 to
pcp_child process expecting it exits to refresh node status. In this
situation lots of pgpool children exit and produce SIGCHLD as
well. The SIGCHLD handler reaper() tries catch all SIGCHLD but
sometimes it fails depending on the system load and timing. If SIGCHLD
produced by pcp child is not caught, the process becomes zombie and
never restarted. The fix is, in failover() after sending SOGUSR1 to
pcp child, issue waitpid() to catch the pcp child exit event and
restart new pcp child process.
Tatsuo Ishii [Mon, 29 Oct 2012 13:20:38 +0000 (22:20 +0900)]
Fix race condition when using pool_get_passwd. The file descriptor to
pool_passwd is opened in pgpool main and pgpool child inherits
it. When concurrent connections try to authenticate md5 method, they
call pool_get_passwd and seek the fd and cause random md5 auth failure
because underlying fd is shared. Fix is, let individual pgpool child
open the file by calling pool_reopen_passwd_file.
Problem reported and analyzed by Jason Slagle in pgpool-general:1141.
Note that this patch requires commit
d5930588747f1d0759411f494714a7909efe5e35
which allows to reload to recognize md5 password change.
I know this is not fix but the fix above requires this commit.
Nozomi Anzai [Fri, 12 Oct 2012 06:52:14 +0000 (15:52 +0900)]
Prepare 3.1.5
Tatsuo Ishii [Tue, 2 Oct 2012 00:28:01 +0000 (09:28 +0900)]
Fix long standing problem with do_query(). When 1) extended protocol
used and 2)unnamed portal is used and 3) no explicit transaction is
used, user's unnamed portal is removed by Sync message. This is
because Sync message closes transaction and unnamed portal is
removed. This leads to "portal "" does not exist" error.
Fix is, use "Flush" message instead of Sync. Main difference between
using Sync and Flush is, Flush does not return Ready for Query
message. So do_query() does not return until all expected responses
are returned. It seems the order of messages returned from backend is
random, and do_query() manages it by using state bits.
Tatsuo Ishii [Fri, 28 Sep 2012 02:47:45 +0000 (11:47 +0900)]
Fix possible memory leak in nodeToString(). Since the memory context
could be session context, memory used for String object may be
considerable if user session continues for hours or days. See bug
track #24 for more details.
Tatsuo Ishii [Thu, 27 Sep 2012 12:42:57 +0000 (21:42 +0900)]
Fix memory leak in pool_get_insert_table_name(). If session context's
memory contex is used for nodeToString(), memory is not freed until
session ends.
Tatsuo Ishii [Wed, 26 Sep 2012 11:21:15 +0000 (20:21 +0900)]
Fix is_system_catalog to use pgpool_regclass if available.
Tatsuo Ishii [Fri, 21 Sep 2012 04:06:33 +0000 (13:06 +0900)]
Fix inifinit loop in SSL mode. When there's pending data in SSL layer
of frontend, pool_process_query() checks pending data in backend. If
there's non, it loops again and checks frontend/backend receive buffer
by using is_cache_empty(). Unfortunately it first checks pending data
in SSL layer of frontend, thus goes to backend data and checks
again(infinite loop). The solution is, if there's pending data in SSL
layer of frontend and query is not in progress, call
ProcessFrontendResponse() to process new request from frontend.
Tatsuo Ishii [Fri, 14 Sep 2012 07:23:20 +0000 (16:23 +0900)]
Remove outdated contents of ChangeLog and replace it with
just "See NEWS." per discussion in pgpool-hackers.
Tatsuo Ishii [Fri, 14 Sep 2012 05:59:55 +0000 (14:59 +0900)]
Fix long standing memory leak bug with free_select_result
since pgpool-II 2.3 was born in December 2009.
Actually this bug only appears when operated in replication mode
(triggered by timestamp rewriting process by coincidence).
Per bug track:
http://www.pgpool.net/mantisbt/view.php?id=24
Tatsuo Ishii [Sat, 1 Sep 2012 00:21:12 +0000 (09:21 +0900)]
Fix HBA section. enable_pool_hba is disabled by default.
Tatsuo Ishii [Wed, 29 Aug 2012 04:12:49 +0000 (13:12 +0900)]
Remove unnecessary/confusing debug log from s_do_auth.
Tatsuo Ishii [Tue, 28 Aug 2012 11:18:04 +0000 (20:18 +0900)]
Add NOTICE message handling to s_do_auth. Without this, health check
responses false alarm and causes failover. per bug track:
http://www.pgpool.net/mantisbt/view.php?id=25 Also allow to receive
ready for query packet *not* right after backend keydata. I'm not
sure if this could happen in the real world but the protocol seems to
allow this.
Tatsuo Ishii [Wed, 15 Aug 2012 05:47:00 +0000 (14:47 +0900)]
Fix read_startup_packet. If packet length is lower than 0, it should
have returned immediately. Otherwise it would cause memory allocation
error later on. per pgpool-general:886.
Also add canceling alarm.
Nozomi Anzai [Fri, 3 Aug 2012 05:21:26 +0000 (14:21 +0900)]
Merge branch 'V3_1_STABLE' of ssh://git.postgresql.org/pgpool2 into V3_1_STABLE
Nozomi Anzai [Fri, 3 Aug 2012 05:19:47 +0000 (14:19 +0900)]
Prepare 3.1.4
Tatsuo Ishii [Fri, 13 Jul 2012 06:36:51 +0000 (15:36 +0900)]
Fix send_to_where() when SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
case in streaming replication mode. It is sent to not only primary but
also to standby and of course this causes an error.
Similar SQLs are:
SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE or
SET transaction_isolation TO 'serializable'
SET default_transaction_isolation TO 'serializable'
Original complain is [pgpool-general: 715].
Tatsuo Ishii [Fri, 13 Jul 2012 06:23:30 +0000 (15:23 +0900)]
Remove unused parameter "query" from is_set_transaction_serializable().
Tatsuo Ishii [Thu, 12 Jul 2012 01:55:07 +0000 (10:55 +0900)]
Fix bug with treatment of BEGIN TRANSACTION in master/slave
mode. Original complain is [pgpool-general: 714]. From 3.1, pgpool-II
sends BEGIN.. to all DB nodes. Of course we cannot send BEGIN
TRANSACTION READ WRITE to standby nodes. Problem is, we did not check
BEGIN WORK ISOLATION LEVEL SERIALIZABLE; and sent to standby nodes. Of
course this is wrong, since it's not allowed to run transactions in
serializable mode on standby nodes. So I added check for BEGIN WORK
ISOLATION LEVEL SERIALIZABLE case, with some refactoring because
there's lots of redundant codes.
Tatsuo Ishii [Mon, 9 Jul 2012 04:54:17 +0000 (13:54 +0900)]
Fix wait_for_query_response() not to send param status to frontend if
frontend is NULL. This could happen while processing reset_query_list.
Tatsuo Ishii [Sun, 8 Jul 2012 22:33:17 +0000 (07:33 +0900)]
Fix pool_process_query() bug reported in [pgpool-general: 672].
> For some reason, this transaction was aborted, client disconnected
> from pgpool, pgpool aborted the transaction on the slave server
> (192.168.10.11) but not on the master (192.168.10.55).
This is caused by the function waits for primary node which does not
have pending data, while standbys have pending data.
Tatsuo Ishii [Thu, 5 Jul 2012 07:20:01 +0000 (16:20 +0900)]
Fix function call case. Before it did not change memory context
before calling raw_parser. This will make trouble afterward if
default pool_memory context is destroyed.
Tatsuo Ishii [Tue, 12 Jun 2012 08:11:41 +0000 (17:11 +0900)]
Modify read_pid_file() and write_pid_file(). write_pid_file() used to
use fopen() and friends, but it was pointed out that pid file might
not be written to persistent storage in erroneous system. Solution to
this is using fsync() althoug it's a little bit tricky to use with
fopen() and friends, so I decided to rewrite them to use open(2) and
friends. Changes made to read_pid_file() as well, but this is rather
for consistency of coding.
Yugo Nagata [Fri, 8 Jun 2012 05:51:50 +0000 (14:51 +0900)]
Fix to send an error message to the frontend when connection is terminated
due to conflict with recovery.
Yugo Nagata [Wed, 6 Jun 2012 09:29:38 +0000 (18:29 +0900)]
Fix hangup when query conflict occurs in Hot-Standby mode.
- Query example to reproduce:
(S1) BEGIN;
(S1) SELECT * FROM t;
(S2) DELETE FROM t;
(S2) VACUUM t;
Fix SmpleQuery() to handle errors by calling check_errors().
- Previously, check_errors() was called only in Execute().
Please enter the commit message for your changes. Lines starting
Tatsuo Ishii [Tue, 5 Jun 2012 06:53:10 +0000 (15:53 +0900)]
Fix is_system_catalog(). Its relcach was accidently defined as "session local".
Tatsuo Ishii [Sun, 3 Jun 2012 12:53:37 +0000 (21:53 +0900)]
Fix "unnamed prepared statment does not exist" error. This is caused
by pgpool's internal query, which breaks client's unnamed statements.
To fix this, if extended query is used (calling
pool_is_doing_extended_query_message()), named statement/portal for
internal are used for internal query.
Nozomi Anzai [Thu, 31 May 2012 07:42:57 +0000 (16:42 +0900)]
Update copyright year.
Nozomi Anzai [Thu, 31 May 2012 07:28:20 +0000 (16:28 +0900)]
Fix segfault of pcp_systemdb_info not in parallel mode and when enable_query_cache = 'off'.
Nozomi Anzai [Wed, 30 May 2012 02:58:15 +0000 (11:58 +0900)]
Add params to the result of "SHOW pool_status": backend_data_directory, ssl_ca_cert, ssl_ca_cert_dir.
Nozomi Anzai [Wed, 30 May 2012 02:50:12 +0000 (11:50 +0900)]
Add desctiption of pcp_pool_status command.
Tatsuo Ishii [Sat, 26 May 2012 05:17:32 +0000 (14:17 +0900)]
Adopt PostgreSQL 9.2.
Tatsuo Ishii [Thu, 10 May 2012 02:39:51 +0000 (11:39 +0900)]
Fix load balance in Solaris. If compiled in Solaris, use
srand()/rand() instead of srandom()/random(). Problem is, random() in
Solaris does not respect RAND_MAX (it's 2^16-1 in Solaris). So using
random() in Solaris results in strange load balancing calculation.
Use srand()/rand() instead although they produce lesser quality random
numbers. Problem reported at [pgpool-general: 396].
Tatsuo Ishii [Tue, 1 May 2012 04:08:48 +0000 (13:08 +0900)]
Fix pool_send_and_wait() to send or not to send commit/abort depending
on the transaction state on each node. It is possible that only
primary is in an explicit transaction but standby is not in it if
multi statement query has been sent.
Per bug report [pgpool-general-jp: 1049].
Yugo Nagata [Tue, 24 Apr 2012 04:38:16 +0000 (13:38 +0900)]
Modify mistaken release date and version no. in pgpool-ja.html.
Yugo Nagata [Mon, 23 Apr 2012 04:38:52 +0000 (13:38 +0900)]
Prepare 3.1.3
Yugo Nagata [Mon, 23 Apr 2012 04:33:20 +0000 (13:33 +0900)]
Prepare 3.1.3
Yugo Nagata [Mon, 23 Apr 2012 04:06:37 +0000 (13:06 +0900)]
Prepare 3.1.3
Yugo Nagata [Mon, 23 Apr 2012 04:01:18 +0000 (13:01 +0900)]
Prepare 3.1.3
Yugo Nagata [Mon, 23 Apr 2012 03:09:11 +0000 (12:09 +0900)]
Prepare 3.1.3
Tatsuo Ishii [Fri, 20 Apr 2012 04:17:26 +0000 (13:17 +0900)]
Add m4 files. This should prevent compiling problem on older
OS's.
Toshihiro Kitagawa [Thu, 19 Apr 2012 04:21:06 +0000 (13:21 +0900)]
Specify that health_check_password is not yet implemented.
Tatsuo Ishii [Sat, 14 Apr 2012 02:38:00 +0000 (11:38 +0900)]
Fix detect_postmaster_down_error to handle failover properly. It is
possible that it fails to read backend socket after detecting backend
errors and before actually detaching the backend. In this case we
should close this session. Otherwise continue to read the down backend
socket.
Tatsuo Ishii [Sat, 14 Apr 2012 00:24:00 +0000 (09:24 +0900)]
Before using semaphore, block signals. Otherwise the process will exit
before unlocking semaphore by a signal interrupt.
Tatsuo Ishii [Mon, 9 Apr 2012 11:21:16 +0000 (20:21 +0900)]
Fix memory leak. In case of reset_query, created query context was not
destroyed and never be freed.
Tatsuo Ishii [Thu, 5 Apr 2012 02:44:02 +0000 (11:44 +0900)]
Fix pool_ssl_read() to deal with large data reading.
It seems we should retry if SSL_read() returns SSL_ERROR_WANT_READ.
Original complain is here:
http://www.pgpool.net/pipermail/pgpool-general/2012-March/000299.html
Back patched to V3_1_STABLE and V3_0_STABLE.
Tatsuo Ishii [Sat, 31 Mar 2012 09:51:57 +0000 (18:51 +0900)]
Fix deadlock by enabling log_destination = syslog reported in bug
tracker http://www.pgpool.net/mantisbt/view.php?id=9. The workaround
is blocking signal before calling vsyslog in pool_log etc. This has
been already done log_destination = stderr case. Patch provided by
Gilles Darold.
Committed to master and V3_1_STABLE.
Tatsuo Ishii [Sat, 31 Mar 2012 00:50:17 +0000 (09:50 +0900)]
Allow to use multi statement in master/slave mode. From 3.1
transactional statements such as "BEGIN" are sent to not only primary
but also standbys. This brings an unfortunate side effect: if the
multi statement is "BEGIN;DELETE FROM table;END", this will be sent to
standy as well and cause an error because standby does not allow write
SQL. So fix is, if a query is a multi statement one, then send it to
primary only.
Committed to master and V3_1_STABLE.
Tatsuo Ishii [Sat, 24 Mar 2012 03:30:42 +0000 (12:30 +0900)]
Allow to have private cache of master node id. This is neccesary for
MASTER_CONNECTION macro and friends because when master goes down it
will immediately update the info on shared memory, which cause running
pgpool child to look into NULL pointer because the process does not
connect to the new master yet. The private cache returns the old
master node id and will avoid the situation. Per bug report
http://www.pgpool.net/mantisbt/view.php?id=5
backport from:
46386e8fc792beef592a1b90308ccd654bb949dd
Fix pool_start_query() so that it uses my_master_node_id for initial
virtual_master_node_id. Real master node could be changed while pgpool
is running in streaming replication mode. Before it assigned
REAL_MASTER_NODE_ID, which could have no connections after fail over
and cause segafult because there's no connection to it.
backport from:
d95cecac8ae73e735dee30ef6697b3d1adac2d52
Fix pool_setall_node_to_be_sent() to use private_backend_status. It
is possible that while processing, the node is not usable any more.
backport from:
e045a737f33e71b3a28eaa9779cdb672756051cd
Tatsuo Ishii [Sat, 24 Mar 2012 02:50:19 +0000 (11:50 +0900)]
Update copyright year.
Tatsuo Ishii [Sun, 4 Mar 2012 02:13:25 +0000 (11:13 +0900)]
Fix failover(). Before it only restarts worker child only when pgpool
child do not need restart. This is wrong. We need to restart worker
child in any case. Otherwise it continues to send replication time lag
check request to down the node.
Toshihiro Kitagawa [Tue, 20 Mar 2012 06:04:55 +0000 (15:04 +0900)]
Fix debug log message so that it does not contain null characters.
This bug was the cause that debug log file was recognized to be binary file.
Toshihiro Kitagawa [Tue, 20 Mar 2012 05:03:12 +0000 (14:03 +0900)]
Fix Parse() so that it doesn't read a destroyed query context.
This is an addition fix for the following:
[pgpool-committers: 55] pgpool: Fix hangup when PREPARE statement causes error.
Toshihiro Kitagawa [Mon, 19 Mar 2012 11:14:32 +0000 (20:14 +0900)]
Fix ReadyForQuery() so that it doesn't read a destroyed query context.
This is an addition fix for the following:
[pgpool-committers: 55] pgpool: Fix hangup when PREPARE statement causes error.
Tatsuo Ishii [Tue, 6 Mar 2012 13:56:18 +0000 (22:56 +0900)]
Fix SimpleQuery() so that restores parser memory context when:
1) Builtin show commands are used
2) Parallel query mode
3) Query cache is used
Before it left pool_memory with bogus memory pointer destroyed by
pool_query_context_destroy, and it caused succeeding palloc() to be
failed.
Toshihiro Kitagawa [Wed, 29 Feb 2012 10:31:37 +0000 (19:31 +0900)]
Fix hangup when PREPARE statement causes error.
Query example to reproduce:
PREPARE q4(nonexistenttype) AS select $1;
This issue was reported by Tomonari Katsumata:
Subject: [pgpool-general: 121] question of pgpool's behavior
Tatsuo Ishii [Tue, 28 Feb 2012 09:35:46 +0000 (18:35 +0900)]
Add doc/pgpool-fr.html to Makefile.am.
This had been forgotten when the doc was added.
Yugo Nagata [Tue, 14 Feb 2012 06:57:56 +0000 (15:57 +0900)]
Fix up hangup during md5 authentication that occurs in daemon mode and
log_destination is 'syslog'. (reported in [pgpool-hackers: 25]).
Before daemonizing, openlog() opens syslog connection socket and gets
a file descriptor (fd). Then in daemonizing process, the fd is closed
as well as others. After daemonizing, pool_passwd is opened for md5
authentication and the same fd is assigned. In md5 authentication process,
syslog() is called for logging. However it fails since the used fd is
not for socket but for file. So, syslog() closed the fd and reopen new
socket using the same fd again. Then in trying to read pool_passwd, it
fails because the using fd is not for the pool_passwd file but for syslog
connection socket and then gets hangup.
Fix the problem by calling closelog() to close syslog connection safely
before daemonizing and calling openlog() to reopen syslog connection
after daemonizing.
Nozomi Anzai [Tue, 31 Jan 2012 05:19:19 +0000 (14:19 +0900)]
Prepare 3.1.2.
Tatsuo Ishii [Tue, 20 Dec 2011 23:00:50 +0000 (08:00 +0900)]
Fix pool_process_query() rus into infinite loop reported in this
thread:
http://www.pgpool.net/pipermail/pgpool-general/2011-December/000099.html
In the code path the case when receive buffer of primary is empty and
one of standbys sends spontaneously packet to pgpool (thus their
recieve buffers have data) is not considered. This could happen when,
for example, reloading postgresql.conf. The fix is, read one packet
from standby's receive buffer and discard it.
Tatsuo Ishii [Fri, 9 Dec 2011 07:35:16 +0000 (16:35 +0900)]
Run libtoolize.
Tatsuo Ishii [Fri, 9 Dec 2011 07:33:08 +0000 (16:33 +0900)]
Add m4.
Tatsuo Ishii [Fri, 9 Dec 2011 07:29:50 +0000 (16:29 +0900)]
Fix pool_get_transaction_isolation() to recognize READ UNCOMMITTED
and REPEATABLE READ.
Tatsuo Ishii [Tue, 6 Dec 2011 01:43:13 +0000 (10:43 +0900)]
Fix release data of 3.1.1.
Tatsuo Ishii [Tue, 6 Dec 2011 01:38:12 +0000 (10:38 +0900)]
Prepare 3.1.1 (add one more fix).
Tatsuo Ishii [Tue, 6 Dec 2011 00:37:04 +0000 (09:37 +0900)]
Fix add_regex_pattern(). It does not allocate enough memory for each
black/white_function_list items. The function adds "^" and "$" to
each function items do not contain those characters. Unfortunately
the function forgot to add extra 2 bytes for those characters.
This may lead to memory corruption errors when pgpool starting up.
Tatsuo Ishii [Mon, 5 Dec 2011 07:56:44 +0000 (16:56 +0900)]
Prepare 3.1.1.
Tatsuo Ishii [Thu, 1 Dec 2011 08:47:29 +0000 (17:47 +0900)]
Fix check_replication_time_lag(). It emitted wrong error message when
it failed to connect to PostgreSQL. Because it does not use
health_check_user anymore.
Tatsuo Ishii [Sun, 27 Nov 2011 22:28:45 +0000 (07:28 +0900)]
Add .orig to .gitignore.
Tatsuo Ishii [Wed, 23 Nov 2011 08:19:54 +0000 (17:19 +0900)]
Fix memory leak in raw mode. This is essentially same as the fix
made for 3.0.5 (commit
19a4ea9215da0b61728741fc0da2271958b09238).
Tatsuo Ishii [Fri, 18 Nov 2011 06:11:05 +0000 (15:11 +0900)]
Add .gitignore.
Tatsuo Ishii [Thu, 27 Oct 2011 23:03:19 +0000 (23:03 +0000)]
Run autoconf.
Tatsuo Ishii [Thu, 27 Oct 2011 22:43:14 +0000 (22:43 +0000)]
Major cleanup for strncpy(). There are several places where
strncpy() is used. Problem is some of them do not consider the case
when copy lengh == buffer size. In this case copied buffer is not
null terminated and may cause tons of problems later.
To fix this, most of them are replaced by strlcpy().