psycopg2/tests
Alexander Kukushkin 6cff5a3e08 Smart replication feedback
This commit makes psycopg2 responsible for sending the status update
(feedback) messages to the server regardless of whether a synchronous or
asynchronous connection is used.

Feedback is sent every *status_update* (default value is 10) seconds,
which could be configured by passing a corresponding parameter to the
`start_replication()` or `start_replication_expert()` methods.
The actual feedback message is sent by the
`pq_read_replication_message()` when the *status_update* timeout is
reached.

The default behavior of the `send_feedback()` method is changed.
It doesn't send a feedback message on every call anymore but just
updates internal structures. There is still a way to *force* sending
a message if *force* or *reply* parameters are set.

The new approach has certain advantages:
1. The client can simply call the `send_feedback()` for every
   processed message and the library will take care of not overwhelming
   the server. Actually, in the synchronous mode it is even mandatory
   to confirm every processed message.
2. The library tracks internally the pointer of the last received
   message which is not keepalive. If the client confirmed the last
   message and after that server sends only keepalives with increasing
   *wal_end*, the library can safely move forward *flush* position to
   the *wal_end* and later automatically report it to the server.

Reporting of the *wal_end* received from keepalive messages is very
important. Not doing so casing:
1. Excessive disk usage, because the replication slot prevents from
   WAL being cleaned up.
2. The smart and fast shutdown of the server could last indefinitely
   because walsender waits until the client report *flush* position
   equal to the *wal_end*.

This implementation is only extending the existing API and therefore
should not break any of the existing code.
2019-05-06 10:27:44 +02:00
..
__init__.py Copyright year updated 2019-02-17 01:36:36 +00:00
dbapi20_tpc.py hook up two phase commit tests. 2010-11-05 09:34:47 +00:00
dbapi20.py Use PY2, PY3 for conditional code instead of sys.version_info 2019-03-16 19:54:40 +00:00
test_async_keyword.py Smart replication feedback 2019-05-06 10:27:44 +02:00
test_async.py Test notifies are received ok polling an async cur 2019-04-05 19:04:48 +01:00
test_bug_gc.py Copyright year updated 2019-02-17 01:36:36 +00:00
test_bugX000.py Copyright year updated 2019-02-17 01:36:36 +00:00
test_cancel.py Copyright year updated 2019-02-17 01:36:36 +00:00
test_connection.py Allow tests to be ignored if dynamic binding failed 2019-03-18 19:49:16 +00:00
test_copy.py Use PY2, PY3 for conditional code instead of sys.version_info 2019-03-16 19:54:40 +00:00
test_cursor.py Allow tests to be ignored if dynamic binding failed 2019-03-18 19:49:16 +00:00
test_dates.py Other import moved to top level in tests 2019-03-16 19:13:58 +00:00
test_errcodes.py Dropped repeated conditional import of reload in test 2019-03-16 19:04:40 +00:00
test_errors.py Move imports to the top of the module across tests 2019-03-16 18:03:41 +00:00
test_extras_dictcursor.py RealDictRow inherits from OrderedDict 2019-04-06 19:43:31 +01:00
test_fast_executemany.py Move imports to the top of the module across tests 2019-03-16 18:03:41 +00:00
test_green.py Added pq_get_result_async() replaced pg_get_last_result() 2019-03-17 01:20:06 +00:00
test_ipaddress.py Other import moved to top level in tests 2019-03-16 19:13:58 +00:00
test_lobject.py Copyright year updated 2019-02-17 01:36:36 +00:00
test_module.py Other import moved to top level in tests 2019-03-16 19:13:58 +00:00
test_notify.py Move imports to the top of the module across tests 2019-03-16 18:03:41 +00:00
test_psycopg2_dbapi20.py Copyright year updated 2019-02-17 01:36:36 +00:00
test_quote.py Use PY2, PY3 for conditional code instead of sys.version_info 2019-03-16 19:54:40 +00:00
test_replication.py Smart replication feedback 2019-05-06 10:27:44 +02:00
test_sql.py Copyright year updated 2019-02-17 01:36:36 +00:00
test_transaction.py Copyright year updated 2019-02-17 01:36:36 +00:00
test_types_basic.py Use PY2, PY3 for conditional code instead of sys.version_info 2019-03-16 19:54:40 +00:00
test_types_extras.py Use PY2, PY3 for conditional code instead of sys.version_info 2019-03-16 19:54:40 +00:00
test_with.py Copyright year updated 2019-02-17 01:36:36 +00:00
testconfig.py Test moved to the right module, cleanup, but same problem 2016-07-01 18:01:16 +01:00
testutils.py Shorter timeout in the async tests select 2019-03-16 20:05:40 +00:00