Skip to content

Commit 8d09e25

Browse files
Jan WieckJan Wieck
authored andcommitted
Backing out the background writer sync() option.
Jan
1 parent e66fcce commit 8d09e25

File tree

4 files changed

+5
-68
lines changed

4 files changed

+5
-68
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.154 2004/01/30 15:57:03 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.155 2004/02/04 01:24:53 wieck Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -55,7 +55,6 @@
5555
#include "storage/proc.h"
5656
#include "storage/smgr.h"
5757
#include "utils/relcache.h"
58-
#include "utils/guc.h"
5958

6059
#include "pgstat.h"
6160

@@ -66,23 +65,9 @@
6665
/* GUC variable */
6766
bool zero_damaged_pages = false;
6867

69-
#define BGWRITER_FLUSH_NONE 0
70-
#define BGWRITER_FLUSH_NONE_STR "none"
71-
#define BGWRITER_FLUSH_SYNC 1
72-
#define BGWRITER_FLUSH_SYNC_STR "sync"
73-
74-
#define BGWRITER_FLUSH_DEFAULT BGWRITER_FLUSH_NONE
75-
#define BGWRITER_FLUSH_DEFAULT_STR BGWRITER_FLUSH_NONE_STR
76-
7768
int BgWriterDelay = 200;
7869
int BgWriterPercent = 1;
7970
int BgWriterMaxpages = 100;
80-
int BgWriterFlushMethod = BGWRITER_FLUSH_NONE;
81-
char *BgWriterFlushMethod_str = NULL;
82-
const char BgWriterFlushMethod_default[] = BGWRITER_FLUSH_DEFAULT_STR;
83-
84-
const char *BgWriterAssignSyncMethod(const char *method,
85-
bool doit, GucSource source);
8671

8772
static void WaitIO(BufferDesc *buf);
8873
static void StartBufferIO(BufferDesc *buf, bool forInput);
@@ -1041,19 +1026,6 @@ BufferBackgroundWriter(void)
10411026
if (InterruptPending)
10421027
return;
10431028

1044-
/*
1045-
* Perform the configured buffer flush method
1046-
*/
1047-
switch (BgWriterFlushMethod)
1048-
{
1049-
case BGWRITER_FLUSH_NONE:
1050-
break;
1051-
1052-
case BGWRITER_FLUSH_SYNC:
1053-
smgrsync();
1054-
break;
1055-
}
1056-
10571029
/*
10581030
* Nap for the configured time or sleep for 10 seconds if
10591031
* there was nothing to do at all.
@@ -1062,27 +1034,6 @@ BufferBackgroundWriter(void)
10621034
}
10631035
}
10641036

1065-
const char *
1066-
BgWriterAssignSyncMethod(const char *method, bool doit, GucSource source)
1067-
{
1068-
int new_flush_method;
1069-
1070-
if (strcasecmp(method, BGWRITER_FLUSH_NONE_STR) == 0)
1071-
new_flush_method = BGWRITER_FLUSH_NONE;
1072-
else
1073-
if (strcasecmp(method, BGWRITER_FLUSH_SYNC_STR) == 0)
1074-
new_flush_method = BGWRITER_FLUSH_SYNC;
1075-
else
1076-
return NULL;
1077-
1078-
if (!doit)
1079-
return method;
1080-
1081-
BgWriterFlushMethod = new_flush_method;
1082-
return method;
1083-
}
1084-
1085-
10861037
/*
10871038
* Do whatever is needed to prepare for commit at the bufmgr and smgr levels
10881039
*/

src/backend/utils/misc/guc.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.184 2004/02/03 17:34:03 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.185 2004/02/04 01:24:53 wieck Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -95,8 +95,6 @@ static const char *assign_msglvl(int *var, const char *newval,
9595
static const char *assign_log_error_verbosity(const char *newval, bool doit,
9696
GucSource source);
9797
static bool assign_phony_autocommit(bool newval, bool doit, GucSource source);
98-
extern const char *BgWriterAssignSyncMethod(const char *method,
99-
bool doit, GucSource source);
10098

10199

102100
/*
@@ -1691,15 +1689,6 @@ static struct config_string ConfigureNamesString[] =
16911689
XLOG_sync_method_default, assign_xlog_sync_method, NULL
16921690
},
16931691

1694-
{
1695-
{"bgwriter_flush_method", PGC_SIGHUP, RESOURCES,
1696-
gettext_noop("Selects the method used by the bgwriter for forcing writes out to disk."),
1697-
NULL
1698-
},
1699-
&BgWriterFlushMethod_str,
1700-
BgWriterFlushMethod_default, BgWriterAssignSyncMethod, NULL
1701-
},
1702-
17031692
/* End-of-list marker */
17041693
{
17051694
{NULL, 0, 0, NULL, NULL}, NULL, NULL, NULL, NULL

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,9 @@
6161
#debug_shared_buffers = 0 # 0-600 seconds
6262

6363
# - Background writer -
64-
#debug_shared_buffers = 0 # 0-600 seconds interval (0 = off)
6564
#bgwriter_delay = 200 # 10-5000 milliseconds
6665
#bgwriter_percent = 1 # 0-100% of dirty buffers
6766
#bgwriter_maxpages = 100 # 1-1000 buffers max at once
68-
#bgwriter_flush_method = none # how the bgwriter flushes kernel buffers
69-
# one of: none or sync
7067

7168
# - Free Space Map -
7269

src/include/storage/bufmgr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.74 2004/01/24 20:00:46 wieck Exp $
10+
* $PostgreSQL: pgsql/src/include/storage/bufmgr.h,v 1.75 2004/02/04 01:24:53 wieck Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -31,8 +31,6 @@ extern bool zero_damaged_pages;
3131
extern int BgWriterDelay;
3232
extern int BgWriterPercent;
3333
extern int BgWriterMaxpages;
34-
extern char *BgWriterFlushMethod_str;
35-
extern const char BgWriterFlushMethod_default[];
3634

3735

3836
/* in buf_init.c */
@@ -182,6 +180,8 @@ extern void AbortBufferIO(void);
182180
extern void BufmgrCommit(void);
183181
extern int BufferSync(int percent, int maxpages);
184182
extern void BufferBackgroundWriter(void);
183+
extern const char *BgWriterAssignSyncMethod(const char *method,
184+
bool doid, bool interactive);
185185

186186
extern void InitLocalBuffer(void);
187187

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy