Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
2d29f5f5
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,发现更多精彩内容 >>
提交
2d29f5f5
编写于
1月 21, 2010
作者:
H
Heikki Linnakangas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bogus comments.
上级
3b992cf5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
27 deletion
+18
-27
src/backend/replication/walsender.c
src/backend/replication/walsender.c
+18
-27
未找到文件。
src/backend/replication/walsender.c
浏览文件 @
2d29f5f5
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.
2 2010/01/15 11:47:15
heikki Exp $
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.
3 2010/01/21 08:19:57
heikki Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -602,7 +602,7 @@ XLogSend(StringInfo outMsg)
...
@@ -602,7 +602,7 @@ XLogSend(StringInfo outMsg)
sentPtr
.
xrecoff
==
0
)
sentPtr
.
xrecoff
==
0
)
return
true
;
return
true
;
/* Attempt to send all
the records which were written to the disk
*/
/* Attempt to send all
records flushed to the disk already
*/
SendRqstPtr
=
GetWriteRecPtr
();
SendRqstPtr
=
GetWriteRecPtr
();
/* Quick exit if nothing to do */
/* Quick exit if nothing to do */
...
@@ -610,18 +610,10 @@ XLogSend(StringInfo outMsg)
...
@@ -610,18 +610,10 @@ XLogSend(StringInfo outMsg)
return
true
;
return
true
;
/*
/*
* Since successive pages in a segment are consecutively written,
* We gather multiple records together by issuing just one read() of
* we can gather multiple records together by issuing just one
* a suitable size, and send them as one CopyData message. Repeat
* read() call, and send them as one CopyData message at one time;
* until we've sent everything we can.
* nmsgs is the number of CopyData messages sent in this XLogSend;
* npages is the number of pages we have determined can be read and
* sent together; startpos is the starting position of reading and
* sending in the first page, startoff is the file offset at which
* it should go and endpos is the end position of reading and
* sending in the last page. We must initialize all of them to
* keep the compiler quiet.
*/
*/
while
(
XLByteLT
(
sentPtr
,
SendRqstPtr
))
while
(
XLByteLT
(
sentPtr
,
SendRqstPtr
))
{
{
XLogRecPtr
startptr
;
XLogRecPtr
startptr
;
...
@@ -631,31 +623,30 @@ XLogSend(StringInfo outMsg)
...
@@ -631,31 +623,30 @@ XLogSend(StringInfo outMsg)
/*
/*
* Figure out how much to send in one message. If there's less than
* Figure out how much to send in one message. If there's less than
* MAX_SEND_SIZE bytes to send, send everything. Otherwise send
* MAX_SEND_SIZE bytes to send, send everything. Otherwise send
* MAX_SEND_SIZE bytes, but round to page boundary for efficiency.
* MAX_SEND_SIZE bytes, but round to page boundary.
*
* The rounding is not only for performance reasons. Walreceiver
* relies on the fact that we never split a WAL record across two
* messages. Since a long WAL record is split at page boundary into
* continuation records, page boundary is alwayssafe cut-off point.
* We also assume that SendRqstPtr never points in the middle of a
* WAL record.
*/
*/
startptr
=
sentPtr
;
startptr
=
sentPtr
;
endptr
=
startptr
;
endptr
=
startptr
;
XLByteAdvance
(
endptr
,
MAX_SEND_SIZE
);
XLByteAdvance
(
endptr
,
MAX_SEND_SIZE
);
/* round down to page boundary. */
/*
* Round down to page boundary. This is not only for performance
* reasons, walreceiver relies on the fact that we never split a WAL
* record across two messages. Since a long WAL record is split at
* page boundary into continuation records, page boundary is always
* safe cut-off point. We also assume that SendRqstPtr never points
* in the middle of a WAL record.
*/
endptr
.
xrecoff
-=
(
endptr
.
xrecoff
%
XLOG_BLCKSZ
);
endptr
.
xrecoff
-=
(
endptr
.
xrecoff
%
XLOG_BLCKSZ
);
/* if we went beyond SendRqstPtr, back off */
if
(
XLByteLT
(
SendRqstPtr
,
endptr
))
if
(
XLByteLT
(
SendRqstPtr
,
endptr
))
endptr
=
SendRqstPtr
;
endptr
=
SendRqstPtr
;
/*
/*
* OK to read and send the
log
.
* OK to read and send the
slice
.
*
*
* We don't need to convert the xlogid/xrecoff from host byte order
* We don't need to convert the xlogid/xrecoff from host byte order
* to network byte order because the both server can be expected to
* to network byte order because the both server can be expected to
* have the same byte order. If they have
the different
order, we
* have the same byte order. If they have
different byte
order, we
* don't reach here.
* don't reach here.
*/
*/
pq_sendbytes
(
outMsg
,
(
char
*
)
&
startptr
,
sizeof
(
startptr
));
pq_sendbytes
(
outMsg
,
(
char
*
)
&
startptr
,
sizeof
(
startptr
));
...
@@ -671,7 +662,7 @@ XLogSend(StringInfo outMsg)
...
@@ -671,7 +662,7 @@ XLogSend(StringInfo outMsg)
sentPtr
=
endptr
;
sentPtr
=
endptr
;
/*
/*
* Read the log
into the output buffer directly
to prevent
* Read the log
directly into the output buffer
to prevent
* extra memcpy calls.
* extra memcpy calls.
*/
*/
enlargeStringInfo
(
outMsg
,
nbytes
);
enlargeStringInfo
(
outMsg
,
nbytes
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录