Re: Confusing comment in xlog.c or am I missing something? - Mailing list pgsql-hackers

From Amit Langote
Subject Re: Confusing comment in xlog.c or am I missing something?
Date
Msg-id CA+HiwqG39yY6ir287J21fFXrc8H-sD2Dbdy40hkMi6X8UZdFEw@mail.gmail.com
Whole thread Raw
In response to Re: Confusing comment in xlog.c or am I missing something?  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Confusing comment in xlog.c or am I missing something?  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
<div class="shrinkable-quote">> > /* Check for crossing of xlog segment boundary */ <br />> > if
(RecPtr->xrecoff>=XLogFileSize) <br />> > { <br />> >          (RecPtr->xlogid)++; <br />> >
        RecPtr->xrecoff = 0; <br />> > } <br />> > <br />> > Is that xlog "file" boundary or am I
missingsomething? <br />> <br />> The WAL space is divided into 4GB "log files", which are not physical <br
/>>files but purely logical constructs. The XLogRecPtr.xlogid field <br />> indicates the logical log file, and
xrecoffis the offset within the <br />> file. Each logical log file is divided into "log segments", which are <br
/>>the physical files you see in pg_xlog. See also the comment above the <br />> definition of XLogRecPtr. <br
/>><br />> This split was necessary to deal with more than 4 GB of WAL, using only <br />> 32-bit integers. In
9.3,that's changed, and XLogRecPtr is a 64-bit <br />> integer. The whole concept of "logical log files" is gone, so
it'sa lot <br />> less confusing now. <br />> <br />> - Heikki </div><br /><br />I see. However, although in
9.3XLogRecPtr is a 64bit integer, in 9.2 <br />branch, it is <br />still a struct with xlogid and xrecoff (both uint32)
asits members. <br /><br />In that case, should the comment be "/* Check for crossing of xlog <br />file boundary */"
<br/>instead of  /* Check for crossing of xlog segment boundary */, since <br />( RecPtr->xrecoff >= XLogFileSize
)<br />would mean crossing the xlog "file" (not segment) boundary, right? <br />Am I still missing something as in 9.2?
<br/><br />Amit Langote <br /><br /><hr align="left" width="300" /> View this message in context: <a
href="http://postgresql.1045698.n5.nabble.com/Confusing-comment-in-xlog-c-or-am-I-missing-something-tp5754010p5754014.html">Re:
Confusingcomment in xlog.c or am I missing something?</a><br /> Sent from the <a
href="http://postgresql.1045698.n5.nabble.com/PostgreSQL-hackers-f1928748.html">PostgreSQL- hackers mailing list
archive</a>at Nabble.com.<br /> 

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Confusing long option in pg_receivexlog/basebackup/dumpall
Next
From: Heikki Linnakangas
Date:
Subject: Re: Confusing comment in xlog.c or am I missing something?