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

Appearance settings

Commit f181f9e

Browse filesBrowse files
committed
Make sure that open hash table scans are cleaned up when bgwriter tries to
recover from elog(ERROR). Problem was created by introduction of hash seq search tracking awhile back, and affects all branches that have bgwriter; in HEAD the disease has snuck into autovacuum and walwriter too. (Not sure that the latter two use hash_seq_search at the moment, but surely they might someday.) Per report from Sergey Koposov.
1 parent 5cf785a commit f181f9e
Copy full SHA for f181f9e

File tree

Expand file treeCollapse file tree

3 files changed

+9
-3
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-3
lines changed

‎src/backend/postmaster/autovacuum.c

Copy file name to clipboardExpand all lines: src/backend/postmaster/autovacuum.c
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
*
5656
*
5757
* IDENTIFICATION
58-
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.56 2007/08/02 23:39:44 adunstan Exp $
58+
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.57 2007/09/11 17:15:33 tgl Exp $
5959
*
6060
*-------------------------------------------------------------------------
6161
*/
@@ -472,6 +472,7 @@ AutoVacLauncherMain(int argc, char *argv[])
472472
*/
473473
LWLockReleaseAll();
474474
AtEOXact_Files();
475+
AtEOXact_HashTables(false);
475476

476477
/*
477478
* Now return to normal top-level context and clear ErrorContext for

‎src/backend/postmaster/bgwriter.c

Copy file name to clipboardExpand all lines: src/backend/postmaster/bgwriter.c
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.41 2007/07/03 14:51:24 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.42 2007/09/11 17:15:33 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -295,6 +295,7 @@ BackgroundWriterMain(void)
295295
/* we needn't bother with the other ResourceOwnerRelease phases */
296296
AtEOXact_Buffers(false);
297297
AtEOXact_Files();
298+
AtEOXact_HashTables(false);
298299

299300
/* Warn any waiting backends that the checkpoint failed. */
300301
if (ckpt_active)

‎src/backend/postmaster/walwriter.c

Copy file name to clipboardExpand all lines: src/backend/postmaster/walwriter.c
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
*
3636
* IDENTIFICATION
37-
* $PostgreSQL: pgsql/src/backend/postmaster/walwriter.c,v 1.1 2007/07/24 04:54:09 tgl Exp $
37+
* $PostgreSQL: pgsql/src/backend/postmaster/walwriter.c,v 1.2 2007/09/11 17:15:33 tgl Exp $
3838
*
3939
*-------------------------------------------------------------------------
4040
*/
@@ -50,11 +50,13 @@
5050
#include "miscadmin.h"
5151
#include "postmaster/walwriter.h"
5252
#include "storage/bufmgr.h"
53+
#include "storage/fd.h"
5354
#include "storage/ipc.h"
5455
#include "storage/lwlock.h"
5556
#include "storage/pmsignal.h"
5657
#include "storage/smgr.h"
5758
#include "utils/guc.h"
59+
#include "utils/hsearch.h"
5860
#include "utils/memutils.h"
5961
#include "utils/resowner.h"
6062

@@ -179,6 +181,8 @@ WalWriterMain(void)
179181
false, true);
180182
/* we needn't bother with the other ResourceOwnerRelease phases */
181183
AtEOXact_Buffers(false);
184+
AtEOXact_Files();
185+
AtEOXact_HashTables(false);
182186

183187
/*
184188
* Now return to normal top-level context and clear ErrorContext for

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.