Peter Eisentraut [Thu, 1 Aug 2019 15:59:40 +0000 (17:59 +0200)]
Fix shell syntax in test suite
Using return outside a function doesn't make sense.
Peter Eisentraut [Thu, 1 Aug 2019 08:00:12 +0000 (10:00 +0200)]
Add some debugging for failed tests
Print the log file of the failed test if the test fails. This helps
analyzing failures when run in a CI environment.
Peter Eisentraut [Wed, 31 Jul 2019 20:17:45 +0000 (22:17 +0200)]
Travis CI: Run tests as part of build
This required a fair amount of tweaking to get the tests stable
enough, but it seems good now.
Peter Eisentraut [Thu, 1 Aug 2019 12:02:21 +0000 (14:02 +0200)]
Tweak some test timing to make the tests more stable
Peter Eisentraut [Thu, 1 Aug 2019 07:03:28 +0000 (09:03 +0200)]
Rewrite test_server_connect_timeout_establish using pre_auth_delay
This avoids having to deal with strange behaviors and portability
issues from netcat.
Since ALTER SYSTEM is being used, this now requires at least
PostgreSQL 9.4 for the test.
Peter Eisentraut [Wed, 31 Jul 2019 11:51:44 +0000 (13:51 +0200)]
Fix wait time computation with auth_user
When using auth_user, the transition to the CL_WAITING_LOGIN state
would not initialize the client->wait_start field. This would either
lead to garbage values being recorded, or under assertions enabled it
would crash in activate_client().
(test_auth_user was actually reproducing this problem, but a crash
requires assertions enabled and new memory being all zero, so it was
difficult to catch it.)
Author: @pinaraf
see #393
Peter Eisentraut [Mon, 1 Jul 2019 07:02:10 +0000 (09:02 +0200)]
v1.10.0
Peter Eisentraut [Fri, 28 Jun 2019 07:06:57 +0000 (09:06 +0200)]
Bump libusual
Peter Eisentraut [Sat, 29 Jun 2019 13:47:43 +0000 (15:47 +0200)]
Rewrite man page filter to work independent of Pandoc
This allows it to work with really old Pandoc versions that don't have
the --filter option (e.g., on CentOS 6). This just makes it a plain
text-munging filter script.
Peter Eisentraut [Wed, 26 Jun 2019 21:28:06 +0000 (23:28 +0200)]
Make stress.py compatible with Python 3
Marco Nenciarini [Wed, 26 Jun 2019 13:38:48 +0000 (15:38 +0200)]
Do not depend on Pandoc 2.0
Replace the Lua filter with one written in Python, so it can work with
older Pandoc versions. Import pandocfilters.py package from Pandoc to
help with that.
Peter Eisentraut [Mon, 24 Jun 2019 20:46:10 +0000 (22:46 +0200)]
Improve pid file processing
Remove some useless code that triggers a TOCTOU warning from
Coverity. Make error messages more accurate.
Peter Eisentraut [Mon, 24 Jun 2019 20:23:19 +0000 (22:23 +0200)]
Add support for TLSv1.3 enabling and disabling
It already worked automatically; this just adds the options to enable
and disable the protocol version explicitly.
Peter Eisentraut [Mon, 24 Jun 2019 20:16:01 +0000 (22:16 +0200)]
Add missing options TOTALS and USERS
These were not included in the output of SHOW HELP.
Author: @davidfetter
fixes #388
Gabe Gorelick [Fri, 8 Feb 2019 21:33:40 +0000 (15:33 -0600)]
Fix usage typo
a online restart -> an online restart
Peter Eisentraut [Mon, 24 Jun 2019 19:58:37 +0000 (21:58 +0200)]
Improve error message
Peter Eisentraut [Mon, 24 Jun 2019 14:46:45 +0000 (16:46 +0200)]
Fix idle_transaction_timeout calculation
idle_transaction_timeout should count from the last request of the
server, because the server sent the idle information. The code
previously used the last request of the client, which could lead to
premature timeouts.
fixes #125
Peter Eisentraut [Mon, 24 Jun 2019 14:25:25 +0000 (16:25 +0200)]
Make error messages more precise
Peter Eisentraut [Mon, 24 Jun 2019 14:22:18 +0000 (16:22 +0200)]
Tweak some debug messages for clarity
Peter Eisentraut [Mon, 24 Jun 2019 14:18:54 +0000 (16:18 +0200)]
doc: Document remaining SHOW commands
Some of these present internal information that we don't want to
document fully, but at least mentioning them for completeness seems
reasonable.
fixes #394
Peter Eisentraut [Thu, 20 Jun 2019 14:02:52 +0000 (16:02 +0200)]
doc: Various cosmetic improvements
Peter Eisentraut [Wed, 19 Jun 2019 15:19:28 +0000 (17:19 +0200)]
Add documentation for available test suites
fixes #83
Peter Eisentraut [Wed, 19 Jun 2019 15:11:41 +0000 (17:11 +0200)]
pycodestyle (PEP8) pass over Python scripts
Peter Eisentraut [Wed, 19 Jun 2019 14:36:18 +0000 (16:36 +0200)]
stress.py: Convert to psycopg2
It was still on the ancient psycopg module.
Peter Eisentraut [Wed, 19 Jun 2019 14:35:43 +0000 (16:35 +0200)]
stress.py: Update port number in test script
from 6000 to 6432
Peter Eisentraut [Thu, 7 Feb 2019 12:47:56 +0000 (13:47 +0100)]
Convert documentation from rst to Markdown
It seems that many contributors already submit patches thinking that
rst is Markdown, which leads to incorrect and inconsistent formatting,
since the two are similar but not compatible. By using the more well
known Markdown, we can perhaps hope to achieve better formatted
documentation contributions.
Also, since the web site uses Markdown as its source format, by using
Markdown here we can avoid the fragile conversion process altogether.
Peter Eisentraut [Wed, 6 Feb 2019 21:07:42 +0000 (22:07 +0100)]
Remove outdated auth_file documentation
Once upon a time, one could point auth_file to pg_auth in the
PostgreSQL data directory, but this is long obsolete (gone as of
PostgreSQL 9.0), so remove mentions of it.
Peter Eisentraut [Tue, 5 Feb 2019 21:52:19 +0000 (22:52 +0100)]
Prevent too long user name or password from client
In most cases, this wouldn't work anyway, because for example the user
wouldn't be found in pgbouncer, since userlist.txt doesn't permit too
long user names. But in the case of PAM there was no such check, so
too long user names could be added by add_pam_user(), which would
truncate them, and then a subsequent search using the not-truncated
name wouldn't find it, causing duplicates to be added.
Reported-by: @achix
fixes #353
Petr Jelinek [Sun, 30 Dec 2018 18:35:18 +0000 (19:35 +0100)]
Merge pull request #356 from mnencia/issue-220
Avoid 'unexpected response from login query' after a postgres reload
Marco Nenciarini [Fri, 28 Dec 2018 19:06:58 +0000 (20:06 +0100)]
Avoid 'unexpected response from login query' after a postgres reload
After a PostgreSQL reload, the backend could inform the frontend about
configuration changes by sending some ParameterStatus messages
together with the usual login query response. These messages can be
safely ignored in the login query response handler.
Closes: #220
Peter Eisentraut [Mon, 3 Dec 2018 15:08:05 +0000 (16:08 +0100)]
Move comment to the right place
Peter Eisentraut [Fri, 23 Nov 2018 07:29:38 +0000 (08:29 +0100)]
Put units on log message
age=N -> age=Ns
Petr Jelinek [Fri, 9 Nov 2018 15:34:31 +0000 (16:34 +0100)]
Merge pull request #329 from marcocitus/cancellations_fix
Do not wait server_login_retry for next connect if cancellation succeeds
Marco Slot [Tue, 25 Sep 2018 10:10:52 +0000 (10:10 +0000)]
Do not wait server_login_retry for next connect if cancellation succeeds
If postgres restarts while there are N cancellations in the queue,
pgbouncer is currently unavailable for at least N*server_login_retry
because it uses every new connection for one queued cancellation and
then waits server_login_retry before opening a new connection because
the last_connect_failed flag is still set to 1. This can lead to
prolonged downtime.
This changes fixes the issue by introducing a last_login_failed flag.
The last_connect_failed is now reset when a cancellation succeeds, such
that launch_new_connection no longer waits if pgbouncer manages to
connect, but has queued cancellations. The last_login_failed flag has
the same semantics as the last_connect_failed flag had previously, such
that check_fast_fail still rejects connections when there are no servers
available and the last login failed.
Peter Eisentraut [Fri, 21 Sep 2018 13:35:00 +0000 (15:35 +0200)]
Add exit status to test scripts
When a test fails, exit with status 1, so automation can catch test
failures. Also add a way to skip tests that cannot be run (mainly for
lack of sudo in this case).
Peter Eisentraut [Tue, 11 Sep 2018 10:30:53 +0000 (12:30 +0200)]
Fix rare crash
SHOW FDS could in rare cases crash if a client had not been assigned
to a pool yet, causing a null pointer dereference.
fixes #311
Peter Eisentraut [Mon, 10 Sep 2018 08:32:00 +0000 (10:32 +0200)]
doc: Update SHOW DATABASES documentation
Documentation of reserve_pool was missing.
fixes #322
Peter Eisentraut [Mon, 10 Sep 2018 08:31:18 +0000 (10:31 +0200)]
Fix typos
fixes #322
Peter Eisentraut [Mon, 10 Sep 2018 08:01:32 +0000 (10:01 +0200)]
Clarify file descriptor use log message
Peter Eisentraut [Tue, 21 Aug 2018 19:55:33 +0000 (21:55 +0200)]
Make sure file descriptor info goes to the log
Delay the call to check_limits() until after daemonization so that the
message goes to the server log and is not printed to some other output
location.
Peter Eisentraut [Mon, 20 Aug 2018 17:48:45 +0000 (19:48 +0200)]
Fix rst syntax
Peter Eisentraut [Sat, 18 Aug 2018 20:11:43 +0000 (22:11 +0200)]
Improve shell script portability
Use printf instead of echo -n, for BSD compatibility, similar to
1b6db6c506cbed67fb4012a1217898a4b8e35252.
Peter Eisentraut [Sat, 18 Aug 2018 20:10:42 +0000 (22:10 +0200)]
Fix psql invocation in tests
similar to
4f48ae3c7c7a3ae7aab4594420b0646ae27d4c7d, but for the ssl
tests
Peter Eisentraut [Fri, 17 Aug 2018 19:50:04 +0000 (21:50 +0200)]
Fix up conntest test programs
Allow asynctest to run without an explicitly specified connection
string. That way it can pick up the connection parameters from the
environment. The run-conntest.sh driver script was already calling it
that way.
Fix the location of the pgbouncer binary in run-conntest.sh.
Peter Eisentraut [Thu, 16 Aug 2018 19:10:47 +0000 (21:10 +0200)]
Improve test script robustness
Consistently exit with an error if the OS is not supported by the
firewall manipulation commands. Previously, it would in some cases
print an error but not exit.
Peter Eisentraut [Wed, 15 Aug 2018 21:11:56 +0000 (23:11 +0200)]
Fix typo in test script
Peter Eisentraut [Wed, 15 Aug 2018 21:11:10 +0000 (23:11 +0200)]
Make log message more consistent
Peter Eisentraut [Tue, 14 Aug 2018 08:27:29 +0000 (10:27 +0200)]
Travis CI: Run optscan.sh
Peter Eisentraut [Tue, 14 Aug 2018 08:27:02 +0000 (10:27 +0200)]
optscan.sh: exit 1 on error
Peter Eisentraut [Mon, 13 Aug 2018 06:56:22 +0000 (08:56 +0200)]
Update v1.9.0 release date
Peter Eisentraut [Mon, 13 Aug 2018 06:55:14 +0000 (08:55 +0200)]
Fix typo
Petr Jelinek [Fri, 3 Aug 2018 15:29:17 +0000 (17:29 +0200)]
Bump libusual
Petr Jelinek [Fri, 3 Aug 2018 14:18:11 +0000 (16:18 +0200)]
v1.9
Peter Eisentraut [Thu, 26 Jul 2018 10:03:45 +0000 (12:03 +0200)]
WAIT_CLOSE command
Peter Eisentraut [Wed, 25 Jul 2018 10:57:24 +0000 (12:57 +0200)]
Fast close
Disconnect a server in session pool mode immediately if it is in
"close_needed" (reconnect) mode. This ensures that the RECONNECT
command doesn't have to wait for session end.
Peter Eisentraut [Wed, 25 Jul 2018 09:18:01 +0000 (11:18 +0200)]
RECONNECT command
Peter Eisentraut [Wed, 25 Jul 2018 07:44:14 +0000 (09:44 +0200)]
Add close_needed column to SHOW SERVERS
This allows monitoring which server connections need reconnecting after
a configuration change.
Peter Eisentraut [Tue, 31 Jul 2018 22:24:15 +0000 (00:24 +0200)]
Improve whitespace
Peter Eisentraut [Mon, 30 Jul 2018 19:53:38 +0000 (21:53 +0200)]
Fix -Wimplicit-fallthrough warnings
in otherwise forgotten test program file
Peter Eisentraut [Mon, 30 Jul 2018 19:52:23 +0000 (21:52 +0200)]
Minor whitespace fix in log message
Peter Eisentraut [Sun, 29 Jul 2018 05:56:29 +0000 (07:56 +0200)]
test: Update MacOS firewall commands
Make commands in conntest.sh match the newer variants in test.sh. Also
add a missing sudo.
Peter Eisentraut [Fri, 27 Jul 2018 15:33:17 +0000 (17:33 +0200)]
doc: Clarify file descriptor formula
The previous phrasing made it look like max_pool_size etc. were
configuration settings. Perhaps this way it's a bit clearer.
fixes #190
Peter Eisentraut [Fri, 27 Jul 2018 12:59:53 +0000 (14:59 +0200)]
Make capitalization of log messages consistent
also minor typo and punctuation corrections
Peter Eisentraut [Thu, 26 Jul 2018 21:17:50 +0000 (23:17 +0200)]
Merge pull request #255 from eulerto/reserve-pool-fix
Fix reserve_pool parameter
Peter Eisentraut [Thu, 26 Jul 2018 19:39:26 +0000 (21:39 +0200)]
NEWS: Fix typos
fixes #296
Peter Eisentraut [Thu, 26 Jul 2018 19:13:50 +0000 (21:13 +0200)]
doc: Clarify documentation of server_lifetime
fixes #305
Peter Eisentraut [Thu, 26 Jul 2018 16:09:21 +0000 (18:09 +0200)]
doc: Document that KILL requires RESUME afterwards
fixes #310
Peter Eisentraut [Thu, 26 Jul 2018 11:56:30 +0000 (13:56 +0200)]
test.sh: Sort out netcat zoo
The previous code distinguished between Linux and non-Linux netcat.
This didn't stand the test of time, since Linux distributions now ship
multiple variants of netcat and other operating systems also provide
multiple options. So instead try to detect the variant from the help
output. Also, the previous uses of the -q and -w options behaved
strangely with some versions and/or were inconsistent with the
documentation. So abandon those options and just rely on the existing
killall call.
The test_server_connect_timeout_establish test should now pass again on
hopefully most configurations.
Peter Eisentraut [Wed, 25 Jul 2018 20:14:56 +0000 (22:14 +0200)]
Fix comments
Peter Eisentraut [Wed, 25 Jul 2018 20:11:23 +0000 (22:11 +0200)]
Improve punctuation in stats message
Peter Eisentraut [Wed, 25 Jul 2018 07:34:37 +0000 (09:34 +0200)]
Update code comment
Peter Eisentraut [Wed, 25 Jul 2018 07:33:37 +0000 (09:33 +0200)]
doc: Document reconnect behavior on reload and DNS change
This is long-standing behavior, just make the documentation about it
more explicit.
Peter Eisentraut [Tue, 24 Jul 2018 19:59:57 +0000 (21:59 +0200)]
doc: Add missing documentation for various SHOW fields
Various output fields from SHOW commands were not documented.
Peter Eisentraut [Tue, 24 Jul 2018 10:19:18 +0000 (12:19 +0200)]
Fix -Wimplicit-fallthrough warnings
These warnings started showing up with GCC 7. The code was already
correct, but the intent is now a bit clearer. Compilation with recent
GCCs should now be warning-free again.
Peter Eisentraut [Mon, 23 Jul 2018 11:24:38 +0000 (13:24 +0200)]
test: Restore userlist.txt after test run
Peter Eisentraut [Mon, 23 Jul 2018 11:00:45 +0000 (13:00 +0200)]
test.sh: Wrap all sudo calls in CAN_SUDO check
One call had been missed.
Peter Eisentraut [Mon, 23 Jul 2018 10:58:24 +0000 (12:58 +0200)]
.gitignore: Add test/pgdata/
Peter Eisentraut [Thu, 19 Jul 2018 16:32:04 +0000 (18:32 +0200)]
Correct list of required software
In particular, pkg-config is required for normal builds, not just from
Git.
Peter Eisentraut [Thu, 19 Jul 2018 16:24:04 +0000 (18:24 +0200)]
Normalize spelling of Git
Peter Eisentraut [Thu, 19 Jul 2018 16:18:13 +0000 (18:18 +0200)]
doc: Document SET command
Peter Eisentraut [Thu, 19 Jul 2018 12:54:17 +0000 (14:54 +0200)]
doc: Small improvement in quick start
Add an indication that the "SHOW HELP" example output is not complete.
Then we don't have to feel obliged to update it every time we add
something to the actual help output.
Petr Jelinek [Wed, 13 Jun 2018 21:16:34 +0000 (23:16 +0200)]
Merge pull request #301 from danielgustafsson/dg-null_deref
Fix a double-free and a NULL pointer deref
Daniel Gustafsson [Thu, 7 Jun 2018 21:04:29 +0000 (23:04 +0200)]
Avoid NULL pointer deref in parse_line
If we fail to calloc the rule buffer, going to failed: will deref
rule via the rule_free() call. Avoid by returning false directly
and bypass the failed: block.
Daniel Gustafsson [Thu, 7 Jun 2018 20:59:53 +0000 (22:59 +0200)]
Avoid double-free in parse_filename
If the fopen() call fails parse_namefile() frees the filename buffer
fn, and the caller does the same. Avoid freeing in parse_namefile()
and leave the cleanup to the caller.
Peter Eisentraut [Thu, 15 Mar 2018 17:20:20 +0000 (13:20 -0400)]
Fix whitespace errors reported by Git
Peter Eisentraut [Thu, 8 Mar 2018 22:18:13 +0000 (17:18 -0500)]
doc: Improve signals documentation
Add SIGUSR1 and SIGUSR2. Fix grammar a bit.
Peter Eisentraut [Wed, 27 Dec 2017 22:30:46 +0000 (17:30 -0500)]
Port mkauth.py to Python 3
fixes #263
Peter Eisentraut [Wed, 27 Dec 2017 00:31:22 +0000 (19:31 -0500)]
Travis CI: Test make deb target
Peter Eisentraut [Tue, 26 Dec 2017 21:55:08 +0000 (16:55 -0500)]
Fix mistake in test setup
This caused the test test_database_change to fail.
Peter Eisentraut [Tue, 26 Dec 2017 21:49:36 +0000 (16:49 -0500)]
Fix psql invocation in tests
Always run psql with -X, otherwise some tests fail if there is something
in .psqlrc producing output. Also fix some potential portability
problems in option syntax: Put non-option arguments last, don't mix
options with and without arguments.
Peter Eisentraut [Wed, 20 Dec 2017 13:32:23 +0000 (08:32 -0500)]
v1.8.1
Peter Eisentraut [Tue, 19 Dec 2017 23:43:44 +0000 (18:43 -0500)]
Travis CI: Add configure arguments matrix
Peter Eisentraut [Wed, 20 Dec 2017 00:09:41 +0000 (19:09 -0500)]
Travis CI: Convert script to single YAML block
Otherwise the scripts are all run independently of each other, which
doesn't make sense.
Peter Eisentraut [Tue, 19 Dec 2017 21:54:24 +0000 (16:54 -0500)]
Travis CI: Add test for building from dist tarball
Check that the distribution tarball can actually be built from, in case
it's missing a file. Also check `make install` while we're here.
Peter Eisentraut [Tue, 19 Dec 2017 23:15:25 +0000 (18:15 -0500)]
Add include/pam.h to distribution tarball
fixes #261
Peter Eisentraut [Tue, 19 Dec 2017 13:35:54 +0000 (08:35 -0500)]
v1.8
Peter Eisentraut [Tue, 19 Dec 2017 14:19:05 +0000 (09:19 -0500)]
doc: Fix rst syntax
Words ending in underscore are links. This confuses pandoc (for the web
site) (but apparently not rst2man). Escape with backslash to fix.
Petr Jelinek [Mon, 18 Dec 2017 21:08:12 +0000 (22:08 +0100)]
Display 0 ttl for stale DNS entries in SHOW DNS_HOSTS
Peter Eisentraut [Mon, 18 Dec 2017 16:34:58 +0000 (11:34 -0500)]
Travis CI: Add dist target to script
Peter Eisentraut [Mon, 18 Dec 2017 15:54:32 +0000 (10:54 -0500)]
Use strerror() instead of %m for portability