Re: Streaming Replication patch for CommitFest 2009-09 - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Streaming Replication patch for CommitFest 2009-09
Date
Msg-id 3f0b79eb0910060145ref434ecwa3cbdc78b8403b89@mail.gmail.com
Whole thread Raw
In response to Re: Streaming Replication patch for CommitFest 2009-09  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Hi,

On Mon, Sep 21, 2009 at 4:51 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> I've pushed that to 'replication-orig' branch in my git
> repository, attached is the same as a diff against your SR_0914.patch.

The following changes about crossing a xlogid boundary seem wrong,
which would break the management of some XLOG positions.

> !         /* Update state for read */
> !         tmp = recptr.xrecoff + byteswritten;
> !         if (tmp < recptr.xrecoff)
> !             recptr.xlogid++; /* overflow */
> !         recptr.xrecoff = tmp;

> !         endptr.xrecoff += MAX_SEND_SIZE;
> !         if(endptr.xrecoff < startptr.xrecoff)
> !             endptr.xlogid++; /* xrecoff overflowed */

> !         if (endptr.xlogid != startptr.xlogid)
>           {
> !             Assert(endptr.xlogid == startptr.xlogid + 1);
> !             nbytes = (0xffffffff - endptr.xrecoff) + startptr.xrecoff;
> !         }

The size of a logical XLOG file is 0xff000000. So, even if xrecoff has
not been overflowed yet, we might need to cross a xlogid boundary.
The xrecoff should be compared with XLogFileSize, I think. Can I fix those?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: KaiGai Kohei
Date:
Subject: Re: Privileges and inheritance
Next
From: Roger Leigh
Date:
Subject: Re: Unicode UTF-8 table formatting for psql text output