Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
326a7a07
Commit
326a7a07
authored
Jul 05, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GUC full_page_writes to control writing full pages to WAL.
parent
c19aa704
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
5 deletions
+55
-5
doc/src/sgml/runtime.sgml
doc/src/sgml/runtime.sgml
+35
-2
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+5
-2
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+14
-1
src/backend/utils/misc/postgresql.conf.sample
src/backend/utils/misc/postgresql.conf.sample
+1
-0
No files found.
doc/src/sgml/runtime.sgml
View file @
326a7a07
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.33
5 2005/07/02 19:16:36
momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.33
6 2005/07/05 23:18:09
momjian Exp $
-->
-->
<chapter Id="runtime">
<chapter Id="runtime">
...
@@ -1660,7 +1660,9 @@ SET ENABLE_SEQSCAN TO OFF;
...
@@ -1660,7 +1660,9 @@ SET ENABLE_SEQSCAN TO OFF;
<para>
<para>
This option can only be set at server start or in the
This option can only be set at server start or in the
<filename>postgresql.conf</filename> file.
<filename>postgresql.conf</filename> file. If this option
is <literal>off</>, consider also turning off
<varname>guc-full-page-writes</>.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -1687,6 +1689,37 @@ SET ENABLE_SEQSCAN TO OFF;
...
@@ -1687,6 +1689,37 @@ SET ENABLE_SEQSCAN TO OFF;
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry id="guc-full-page-writes" xreflabel="full_page_writes">
<indexterm>
<primary><varname>full_page_writes</> configuration parameter</primary>
</indexterm>
<term><varname>full_page_writes</varname> (<type>boolean</type>)</term>
<listitem>
<para>
A page write in process during an operating system crash might
be only partially written to disk, leading to an on-disk page
that contains a mix of old and new data. During recovery, the
row changes stored in WAL are not enough to completely restore
the page.
</para>
<para>
When this option is on, the <productname>PostgreSQL</> server
writes full pages to WAL when they first modified after a checkpoint
so full recovery is possible. Turning this option off might lead
to a corrupt system after an operating system crash because
uncorrected partial pages might contain inconsistent or corrupt
data. The risks are less but similar to <varname>fsync</>.
</para>
<para>
This option can only be set at server start or in the
<filename>postgresql.conf</filename> file. The default is
<literal>on</>.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-wal-buffers" xreflabel="wal_buffers">
<varlistentry id="guc-wal-buffers" xreflabel="wal_buffers">
<term><varname>wal_buffers</varname> (<type>integer</type>)</term>
<term><varname>wal_buffers</varname> (<type>integer</type>)</term>
<indexterm>
<indexterm>
...
...
src/backend/access/transam/xlog.c
View file @
326a7a07
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.20
6 2005/07/04 04:51:44 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.20
7 2005/07/05 23:18:09 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -103,6 +103,7 @@ int XLOGbuffers = 8;
...
@@ -103,6 +103,7 @@ int XLOGbuffers = 8;
char
*
XLogArchiveCommand
=
NULL
;
char
*
XLogArchiveCommand
=
NULL
;
char
*
XLOG_sync_method
=
NULL
;
char
*
XLOG_sync_method
=
NULL
;
const
char
XLOG_sync_method_default
[]
=
DEFAULT_SYNC_METHOD_STR
;
const
char
XLOG_sync_method_default
[]
=
DEFAULT_SYNC_METHOD_STR
;
bool
fullPageWrites
=
true
;
#ifdef WAL_DEBUG
#ifdef WAL_DEBUG
bool
XLOG_DEBUG
=
false
;
bool
XLOG_DEBUG
=
false
;
...
@@ -594,7 +595,9 @@ begin:;
...
@@ -594,7 +595,9 @@ begin:;
{
{
/* OK, put it in this slot */
/* OK, put it in this slot */
dtbuf
[
i
]
=
rdt
->
buffer
;
dtbuf
[
i
]
=
rdt
->
buffer
;
if
(
XLogCheckBuffer
(
rdt
,
&
(
dtbuf_lsn
[
i
]),
&
(
dtbuf_xlg
[
i
])))
/* If fsync is off, no need to backup pages. */
if
(
fullPageWrites
&&
XLogCheckBuffer
(
rdt
,
&
(
dtbuf_lsn
[
i
]),
&
(
dtbuf_xlg
[
i
])))
{
{
dtbuf_bkp
[
i
]
=
true
;
dtbuf_bkp
[
i
]
=
true
;
rdt
->
data
=
NULL
;
rdt
->
data
=
NULL
;
...
...
src/backend/utils/misc/guc.c
View file @
326a7a07
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.27
2 2005/07/04 04:51:51 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.27
3 2005/07/05 23:18:10 momjian
Exp $
*
*
*--------------------------------------------------------------------
*--------------------------------------------------------------------
*/
*/
...
@@ -83,6 +83,7 @@ extern DLLIMPORT bool check_function_bodies;
...
@@ -83,6 +83,7 @@ extern DLLIMPORT bool check_function_bodies;
extern
int
CommitDelay
;
extern
int
CommitDelay
;
extern
int
CommitSiblings
;
extern
int
CommitSiblings
;
extern
char
*
default_tablespace
;
extern
char
*
default_tablespace
;
extern
bool
fullPageWrites
;
static
const
char
*
assign_log_destination
(
const
char
*
value
,
static
const
char
*
assign_log_destination
(
const
char
*
value
,
bool
doit
,
GucSource
source
);
bool
doit
,
GucSource
source
);
...
@@ -482,6 +483,18 @@ static struct config_bool ConfigureNamesBool[] =
...
@@ -482,6 +483,18 @@ static struct config_bool ConfigureNamesBool[] =
&
zero_damaged_pages
,
&
zero_damaged_pages
,
false
,
NULL
,
NULL
false
,
NULL
,
NULL
},
},
{
{
"full_page_writes"
,
PGC_SIGHUP
,
WAL_SETTINGS
,
gettext_noop
(
"Writes full pages to WAL when first modified after a checkpoint."
),
gettext_noop
(
"A page write in process during an operating system crash might be "
"only partially written to disk. During recovery, the row changes"
"stored in WAL are not enough to recover. This option writes "
"pages when first modified after a checkpoint to WAL so full recovery "
"is possible."
)
},
&
fullPageWrites
,
true
,
NULL
,
NULL
},
{
{
{
"silent_mode"
,
PGC_POSTMASTER
,
LOGGING_WHEN
,
{
"silent_mode"
,
PGC_POSTMASTER
,
LOGGING_WHEN
,
gettext_noop
(
"Runs the server silently."
),
gettext_noop
(
"Runs the server silently."
),
...
...
src/backend/utils/misc/postgresql.conf.sample
View file @
326a7a07
...
@@ -121,6 +121,7 @@
...
@@ -121,6 +121,7 @@
#wal_sync_method = fsync # the default varies across platforms:
#wal_sync_method = fsync # the default varies across platforms:
# fsync, fdatasync, fsync_writethrough,
# fsync, fdatasync, fsync_writethrough,
# open_sync, open_datasync
# open_sync, open_datasync
#full_page_writes = on # recover from partial page writes
#wal_buffers = 8 # min 4, 8KB each
#wal_buffers = 8 # min 4, 8KB each
#commit_delay = 0 # range 0-100000, in microseconds
#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000
#commit_siblings = 5 # range 1-1000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment