Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8383486

Browse files
committed
Force idle_in_transaction_session_timeout off in pg_dump and autovacuum.
We disable statement_timeout and lock_timeout during dump and restore, toprevent any global settings that might exist from breaking routine backups.Commitc6dda1f should have added idle_in_transaction_session_timeout tothat list, but failed to.Another place where these timeouts get turned off is autovacuum. WhileI doubt an idle timeout could fire there, it seems better to be safe thansorry.pg_dump issue noted by Bernd Helmle, the other one found by grepping.Report: <352F9B77DB5D3082578D17BB@eje.land.credativ.lan>
1 parentf0688d6 commit8383486

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

‎src/backend/postmaster/autovacuum.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,13 @@ AutoVacLauncherMain(int argc, char *argv[])
538538
SetConfigOption("zero_damaged_pages","false",PGC_SUSET,PGC_S_OVERRIDE);
539539

540540
/*
541-
* Forcestatement_timeout and lock_timeout tozero toavoid letting these
542-
*settings preventregular maintenance from being executed.
541+
* Forcesettable timeouts off to avoid letting these settings prevent
542+
* regular maintenance from being executed.
543543
*/
544544
SetConfigOption("statement_timeout","0",PGC_SUSET,PGC_S_OVERRIDE);
545545
SetConfigOption("lock_timeout","0",PGC_SUSET,PGC_S_OVERRIDE);
546+
SetConfigOption("idle_in_transaction_session_timeout","0",
547+
PGC_SUSET,PGC_S_OVERRIDE);
546548

547549
/*
548550
* Force default_transaction_isolation to READ COMMITTED. We don't want
@@ -1551,11 +1553,13 @@ AutoVacWorkerMain(int argc, char *argv[])
15511553
SetConfigOption("zero_damaged_pages","false",PGC_SUSET,PGC_S_OVERRIDE);
15521554

15531555
/*
1554-
* Forcestatement_timeout and lock_timeout tozero toavoid letting these
1555-
*settings preventregular maintenance from being executed.
1556+
* Forcesettable timeouts off to avoid letting these settings prevent
1557+
* regular maintenance from being executed.
15561558
*/
15571559
SetConfigOption("statement_timeout","0",PGC_SUSET,PGC_S_OVERRIDE);
15581560
SetConfigOption("lock_timeout","0",PGC_SUSET,PGC_S_OVERRIDE);
1561+
SetConfigOption("idle_in_transaction_session_timeout","0",
1562+
PGC_SUSET,PGC_S_OVERRIDE);
15591563

15601564
/*
15611565
* Force default_transaction_isolation to READ COMMITTED. We don't want

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,11 +2859,12 @@ _doSetFixedOutputState(ArchiveHandle *AH)
28592859
{
28602860
RestoreOptions*ropt=AH->public.ropt;
28612861

2862-
/* Disable statement_timeout since restore is probably slow */
2862+
/*
2863+
* Disable timeouts to allow for slow commands, idle parallel workers, etc
2864+
*/
28632865
ahprintf(AH,"SET statement_timeout = 0;\n");
2864-
2865-
/* Likewise for lock_timeout */
28662866
ahprintf(AH,"SET lock_timeout = 0;\n");
2867+
ahprintf(AH,"SET idle_in_transaction_session_timeout = 0;\n");
28672868

28682869
/* Select the correct character set encoding */
28692870
ahprintf(AH,"SET client_encoding = '%s';\n",

‎src/bin/pg_dump/pg_dump.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,8 @@ setup_connection(Archive *AH, const char *dumpencoding,
10221022
ExecuteSqlStatement(AH, "SET statement_timeout = 0");
10231023
if (AH->remoteVersion >= 90300)
10241024
ExecuteSqlStatement(AH, "SET lock_timeout = 0");
1025+
if (AH->remoteVersion >= 90600)
1026+
ExecuteSqlStatement(AH, "SET idle_in_transaction_session_timeout = 0");
10251027

10261028
/*
10271029
* Quote all identifiers, if requested.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp