pgsql: Introduce transaction_timeout

Поиск
Список
Период
Сортировка
Искать

pgsql: Introduce transaction_timeout

От:
Alexander Korotkov <akorotkov@postgresql.org>
Дата:
Introduce transaction_timeout

This commit adds timeout that is expected to be used as a prevention
of long-running queries. Any session within the transaction will be
terminated after spanning longer than this timeout.

However, this timeout is not applied to prepared transactions.
Only transactions with user connections are affected.

Discussion: https://postgr.es/m/CAAhFRxiQsRs2Eq5kCo9nXE3HTugsAAJdSQSmxncivebAxdmBjQ%40mail.gmail.com
Author: Andrey Borodin 
Author: Japin Li 
Author: Junwang Zhao 
Reviewed-by: Nikolay Samokhvalov 
Reviewed-by: Andres Freund 
Reviewed-by: Fujii Masao 
Reviewed-by: bt23nguyent 
Reviewed-by: Yuhang Qiu 

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/51efe38cb92f4b15b68811bcce9ab878fbc71ea5

Modified Files
--------------
doc/src/sgml/config.sgml                      | 36 ++++++++++++
src/backend/access/transam/xact.c             |  4 ++
src/backend/postmaster/autovacuum.c           |  2 +
src/backend/storage/lmgr/proc.c               |  1 +
src/backend/tcop/postgres.c                   | 46 +++++++++++++++-
src/backend/utils/errcodes.txt                |  1 +
src/backend/utils/init/globals.c              |  1 +
src/backend/utils/init/postinit.c             | 10 ++++
src/backend/utils/misc/guc_tables.c           | 11 ++++
src/backend/utils/misc/postgresql.conf.sample |  1 +
src/bin/pg_dump/pg_backup_archiver.c          |  1 +
src/bin/pg_dump/pg_dump.c                     |  2 +
src/bin/pg_rewind/libpq_source.c              |  1 +
src/include/miscadmin.h                       |  1 +
src/include/storage/proc.h                    |  1 +
src/include/utils/guc_hooks.h                 |  1 +
src/include/utils/timeout.h                   |  1 +
src/test/isolation/Makefile                   |  3 +
src/test/isolation/expected/timeouts-long.out | 69 +++++++++++++++++++++++
src/test/isolation/expected/timeouts.out      | 79 ++++++++++++++++++++++++++-
src/test/isolation/isolation_schedule         |  1 +
src/test/isolation/specs/timeouts-long.spec   | 35 ++++++++++++
src/test/isolation/specs/timeouts.spec        | 40 +++++++++++++-
23 files changed, 343 insertions(+), 5 deletions(-)

FAQ