public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alexander Korotkov <[email protected]>
To: [email protected]
Subject: pgsql: Introduce transaction_timeout
Date: Thu, 15 Feb 2024 21:57:10 +0000
Message-ID: <[email protected]> (raw)
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 <[email protected]>
Author: Japin Li <[email protected]>
Author: Junwang Zhao <[email protected]>
Reviewed-by: Nikolay Samokhvalov <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Reviewed-by: Fujii Masao <[email protected]>
Reviewed-by: bt23nguyent <[email protected]>
Reviewed-by: Yuhang Qiu <[email protected]>
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(-)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: Introduce transaction_timeout
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox