postgresql/src/test
Peter Eisentraut 8edacab209 Fix DROP SUBSCRIPTION hang
When ALTER SUBSCRIPTION DISABLE is run in the same transaction before
DROP SUBSCRIPTION, the latter will hang because workers will still be
running, not having seen the DISABLE committed, and DROP SUBSCRIPTION
will wait until the workers have vacated the replication origin slots.

Previously, DROP SUBSCRIPTION killed the logical replication workers
immediately only if it was going to drop the replication slot, otherwise
it scheduled the worker killing for the end of the transaction, as a
result of 7e174fa793.  This, however,
causes the present problem.  To fix, kill the workers immediately in all
cases.  This covers all cases: A subscription that doesn't have a
replication slot must be disabled.  It was either disabled in the same
transaction, or it was already disabled before the current transaction,
but then there shouldn't be any workers left and this won't make a
difference.

Reported-by: Arseny Sher <a.sher@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/87mv6av84w.fsf%40ars-thinkpad
2017-09-17 22:00:23 -04:00
..
authentication Post-PG 10 beta1 pgperltidy run 2017-05-17 19:01:23 -04:00
examples Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
isolation Remove unnecessary parentheses in return statements 2017-09-05 14:52:55 -04:00
ldap src/test/ldap: Fix test function in Linux port 2017-09-16 00:39:37 +02:00
locale Clean up Perl code according to perlcritic 2017-03-27 08:18:22 -04:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Add a test harness for the red-black tree code. 2017-09-10 13:26:46 -04:00
perl Fix RecursiveCopy.pm to cope with disappearing files. 2017-09-11 22:02:58 -04:00
recovery Fix RecursiveCopy.pm to cope with disappearing files. 2017-09-11 22:02:58 -04:00
regress Ensure that BEFORE STATEMENT triggers fire the right number of times. 2017-09-17 12:16:38 -04:00
ssl Remove incorrect comment 2017-06-17 10:19:48 +02:00
subscription Fix DROP SUBSCRIPTION hang 2017-09-17 22:00:23 -04:00
thread Avoid use of bool in thread_test.c 2017-09-14 13:27:54 -04:00
Makefile Add LDAP authentication test suite 2017-09-15 11:44:29 -04:00
README Add TAP tests for password-based authentication methods. 2017-03-17 11:34:16 +02:00

README

PostgreSQL tests
================

This directory contains a variety of test infrastructure as well as some of the
tests in PostgreSQL. Not all tests are here -- in particular, there are more in
individual contrib/ modules and in src/bin.

Not all these tests get run by "make check". Check src/test/Makefile to see
which tests get run automatically.

authentication/
  Tests for authentication

examples/
  Demonstration programs for libpq that double as regression tests via
  "make check"

isolation/
  Tests for concurrent behavior at the SQL level

locale/
  Sanity checks for locale data, encodings, etc

mb/
  Tests for multibyte encoding (UTF-8) support

modules/
  Extensions used only or mainly for test purposes, generally not suitable
  for installing in production databases

perl/
  Infrastructure for Perl-based TAP tests

recovery/
  Test suite for recovery and replication

regress/
  PostgreSQL's main regression test suite, pg_regress

ssl/
  Tests to exercise and verify SSL certificate handling

subscription/
  Tests for logical replication

thread/
  A thread-safety-testing utility used by configure