Confusing comment in xlog.c or am I missing something?

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Confusing comment in xlog.c or am I missing something?
Date: 2013-05-02 04:12:48
Message-ID: 1367467968259-5754003.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was just going through the xlog.c and I came across following which
confused me:

Given,

src/include/access/xlogdefs.h

#define XLogSegsPerFile (((uint32) 0xffffffff) / XLogSegSize)
#define XLogFileSize (XLogSegsPerFile * XLogSegSize)

Also,
typedef struct XLogRecPtr
{
uint32 xlogid; /* log file #, 0 based */
uint32 xrecoff; /* byte offset of location
in log file */
} XLogRecPtr;

Check for crossing of xlog "segment" boundary?

src/include/access/trasam/xlog.c

/* Check for crossing of xlog segment boundary */
if (RecPtr->xrecoff >= XLogFileSize)
{
(RecPtr->xlogid)++;
RecPtr->xrecoff = 0;
}

Is that xlog "file" boundary or am I missing something?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Confusing-comment-in-xlog-c-or-am-I-missing-something-tp5754003.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Hastie 2013-05-02 09:41:52 Re: zLinux Load Testing Experience
Previous Message Yang Zhang 2013-05-02 02:40:56 Re: Basic question on recovery and disk snapshotting