Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
326a7a07
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
326a7a07
编写于
7月 05, 2005
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add GUC full_page_writes to control writing full pages to WAL.
上级
c19aa704
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
5 deletion
+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
未找到文件。
doc/src/sgml/runtime.sgml
浏览文件 @
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">
...
...
@@ -1660,7 +1660,9 @@ SET ENABLE_SEQSCAN TO OFF;
<para>
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>
</listitem>
</varlistentry>
...
...
@@ -1687,6 +1689,37 @@ SET ENABLE_SEQSCAN TO OFF;
</listitem>
</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">
<term><varname>wal_buffers</varname> (<type>integer</type>)</term>
<indexterm>
...
...
src/backend/access/transam/xlog.c
浏览文件 @
326a7a07
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* 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;
char
*
XLogArchiveCommand
=
NULL
;
char
*
XLOG_sync_method
=
NULL
;
const
char
XLOG_sync_method_default
[]
=
DEFAULT_SYNC_METHOD_STR
;
bool
fullPageWrites
=
true
;
#ifdef WAL_DEBUG
bool
XLOG_DEBUG
=
false
;
...
...
@@ -594,7 +595,9 @@ begin:;
{
/* OK, put it in this slot */
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
;
rdt
->
data
=
NULL
;
...
...
src/backend/utils/misc/guc.c
浏览文件 @
326a7a07
...
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* 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;
extern
int
CommitDelay
;
extern
int
CommitSiblings
;
extern
char
*
default_tablespace
;
extern
bool
fullPageWrites
;
static
const
char
*
assign_log_destination
(
const
char
*
value
,
bool
doit
,
GucSource
source
);
...
...
@@ -482,6 +483,18 @@ static struct config_bool ConfigureNamesBool[] =
&
zero_damaged_pages
,
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
,
gettext_noop
(
"Runs the server silently."
),
...
...
src/backend/utils/misc/postgresql.conf.sample
浏览文件 @
326a7a07
...
...
@@ -121,6 +121,7 @@
#wal_sync_method = fsync # the default varies across platforms:
# fsync, fdatasync, fsync_writethrough,
# open_sync, open_datasync
#full_page_writes = on # recover from partial page writes
#wal_buffers = 8 # min 4, 8KB each
#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录