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
2d29f5f5
Commit
2d29f5f5
authored
Jan 21, 2010
by
Heikki Linnakangas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bogus comments.
parent
3b992cf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
27 deletions
+18
-27
src/backend/replication/walsender.c
src/backend/replication/walsender.c
+18
-27
No files found.
src/backend/replication/walsender.c
View file @
2d29f5f5
...
...
@@ -30,7 +30,7 @@
*
*
* 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)
sentPtr
.
xrecoff
==
0
)
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
();
/* Quick exit if nothing to do */
...
...
@@ -610,18 +610,10 @@ XLogSend(StringInfo outMsg)
return
true
;
/*
* Since successive pages in a segment are consecutively written,
* we can gather multiple records together by issuing just one
* read() call, and send them as one CopyData message at one time;
* 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.
* We gather multiple records together by issuing just one read() of
* a suitable size, and send them as one CopyData message. Repeat
* until we've sent everything we can.
*/
while
(
XLByteLT
(
sentPtr
,
SendRqstPtr
))
{
XLogRecPtr
startptr
;
...
...
@@ -631,31 +623,30 @@ XLogSend(StringInfo outMsg)
/*
* 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, 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
;
endptr
=
startptr
;
XLByteAdvance
(
endptr
,
MAX_SEND_SIZE
);
/*
* 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.
*/
/* round down to page boundary. */
endptr
.
xrecoff
-=
(
endptr
.
xrecoff
%
XLOG_BLCKSZ
);
/* if we went beyond SendRqstPtr, back off */
if
(
XLByteLT
(
SendRqstPtr
,
endptr
))
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
* 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.
*/
pq_sendbytes
(
outMsg
,
(
char
*
)
&
startptr
,
sizeof
(
startptr
));
...
...
@@ -671,7 +662,7 @@ XLogSend(StringInfo outMsg)
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.
*/
enlargeStringInfo
(
outMsg
,
nbytes
);
...
...
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