Re: XLByte* usage

Lists: pgsql-hackers
From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: XLByte* usage
Date: 2012-12-16 14:16:25
Message-ID: 20121216141624.GC4683@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Now that XLRecPtr's are plain 64bit integers what are we supposed to use
in code comparing and manipulating them? There already is plenty example
of both, but I would like new code to go into one direction not two...

I personally find direct comparisons/manipulations far easier to read
than the XLByte* equivalents.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 08:30:18
Message-ID: 50CED81A.3080400@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 16.12.2012 16:16, Andres Freund wrote:
> Now that XLRecPtr's are plain 64bit integers what are we supposed to use
> in code comparing and manipulating them? There already is plenty example
> of both, but I would like new code to go into one direction not two...
>
> I personally find direct comparisons/manipulations far easier to read
> than the XLByte* equivalents.

I've still used XLByte* macros, but I agree that plain < = > are easier
to read. +1 for using < = > in new code.

- Heikki


From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 09:04:41
Message-ID: CABOikdNDCzyXE=oS=gThHr7A_YcSeyYm9TGN46WSSp3PnEp07w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Dec 17, 2012 at 2:00 PM, Heikki Linnakangas
<hlinnakangas(at)vmware(dot)com> wrote:
> On 16.12.2012 16:16, Andres Freund wrote:
>>
>> Now that XLRecPtr's are plain 64bit integers what are we supposed to use
>> in code comparing and manipulating them? There already is plenty example
>> of both, but I would like new code to go into one direction not two...
>>
>> I personally find direct comparisons/manipulations far easier to read
>> than the XLByte* equivalents.
>
>
> I've still used XLByte* macros, but I agree that plain < = > are easier to
> read. +1 for using < = > in new code.
>

Do we ever see us changing this from 64-bit integers to something else
? If so, a macro would be much better.

Thanks,
Pavan

--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee


From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 09:43:34
Message-ID: 50CEE946.4070403@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 17.12.2012 11:04, Pavan Deolasee wrote:
> On Mon, Dec 17, 2012 at 2:00 PM, Heikki Linnakangas
> <hlinnakangas(at)vmware(dot)com> wrote:
>> On 16.12.2012 16:16, Andres Freund wrote:
>>>
>>> Now that XLRecPtr's are plain 64bit integers what are we supposed to use
>>> in code comparing and manipulating them? There already is plenty example
>>> of both, but I would like new code to go into one direction not two...
>>>
>>> I personally find direct comparisons/manipulations far easier to read
>>> than the XLByte* equivalents.
>>
>> I've still used XLByte* macros, but I agree that plain< => are easier to
>> read. +1 for using< => in new code.
>
> Do we ever see us changing this from 64-bit integers to something else
> ? If so, a macro would be much better.

I don't see us changing it again any time soon. Maybe in 20 years time
people will start overflowing 2^64 bytes of WAL generated in the
lifetime of a database, but I don't think we need to start preparing for
that yet.

- Heikki


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 17:47:41
Message-ID: 27767.1355766461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> writes:
> On 17.12.2012 11:04, Pavan Deolasee wrote:
>> On Mon, Dec 17, 2012 at 2:00 PM, Heikki Linnakangas
>> <hlinnakangas(at)vmware(dot)com> wrote:
>>> I've still used XLByte* macros, but I agree that plain <=> are easier to
>>> read. +1 for using <=> in new code.

>> Do we ever see us changing this from 64-bit integers to something else
>> ? If so, a macro would be much better.

> I don't see us changing it again any time soon. Maybe in 20 years time
> people will start overflowing 2^64 bytes of WAL generated in the
> lifetime of a database, but I don't think we need to start preparing for
> that yet.

Note that to get to 2^64 in twenty years, an installation would have had
to have generated an average of 29GB of WAL per second, 24x7 for the
entire twenty years, with never a dump-and-reload. We're still a few
orders of magnitude away from needing to think about this.

But, if the day ever comes when 64 bits doesn't seem like enough, I bet
we'd move to 128-bit integers, which will surely be available on all
platforms by then. So +1 for using plain comparisons --- in fact, I'd
vote for running around and ripping out the macros altogether. I had
already been thinking of fixing the places that are still using memset
to initialize XLRecPtrs to "invalid".

regards, tom lane


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 17:56:04
Message-ID: 20121217175604.GA16554@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2012-12-17 12:47:41 -0500, Tom Lane wrote:
> Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> writes:
> > On 17.12.2012 11:04, Pavan Deolasee wrote:
> >> On Mon, Dec 17, 2012 at 2:00 PM, Heikki Linnakangas
> >> <hlinnakangas(at)vmware(dot)com> wrote:
> >>> I've still used XLByte* macros, but I agree that plain <=> are easier to
> >>> read. +1 for using <=> in new code.
>
> >> Do we ever see us changing this from 64-bit integers to something else
> >> ? If so, a macro would be much better.
>
> > I don't see us changing it again any time soon. Maybe in 20 years time
> > people will start overflowing 2^64 bytes of WAL generated in the
> > lifetime of a database, but I don't think we need to start preparing for
> > that yet.
>
> Note that to get to 2^64 in twenty years, an installation would have had
> to have generated an average of 29GB of WAL per second, 24x7 for the
> entire twenty years, with never a dump-and-reload. We're still a few
> orders of magnitude away from needing to think about this.

Agreed. And it seems achieving such rates would require architectural
changes that would make manually changing all those comparisons the
tiniest problem.

> But, if the day ever comes when 64 bits doesn't seem like enough, I bet
> we'd move to 128-bit integers, which will surely be available on all
> platforms by then. So +1 for using plain comparisons --- in fact, I'd
> vote for running around and ripping out the macros altogether. I had
> already been thinking of fixing the places that are still using memset
> to initialize XLRecPtrs to "invalid".

I thought about that and had guessed you would be against it because it
would cause useless diversion of the branches? Otherwise I am all for
it.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 17:56:21
Message-ID: CABOikdO5bNLTyJoJU_eRUD-9fP7+NXxHJ5X=XTzEoXgA0dLHKw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Dec 17, 2012 at 11:17 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> writes:
>> On 17.12.2012 11:04, Pavan Deolasee wrote:
>>> On Mon, Dec 17, 2012 at 2:00 PM, Heikki Linnakangas
>>> <hlinnakangas(at)vmware(dot)com> wrote:
>>>> I've still used XLByte* macros, but I agree that plain <=> are easier to
>>>> read. +1 for using <=> in new code.
>
>>> Do we ever see us changing this from 64-bit integers to something else
>>> ? If so, a macro would be much better.
>
>> I don't see us changing it again any time soon. Maybe in 20 years time
>> people will start overflowing 2^64 bytes of WAL generated in the
>> lifetime of a database, but I don't think we need to start preparing for
>> that yet.
>
> Note that to get to 2^64 in twenty years, an installation would have had
> to have generated an average of 29GB of WAL per second, 24x7 for the
> entire twenty years, with never a dump-and-reload. We're still a few
> orders of magnitude away from needing to think about this.
>

I probably did not mean increasing that to beyond 64-bit. OTOH I
wondered if we would ever want to steal a few bits from the LSN field,
given the numbers you just put out. But it was more of a question than
objection.

Thanks,
Pavan

--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee


From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 18:15:51
Message-ID: CABOikdNEehTw5q-sXg8-yaoKE6fSM49NWGS5f-aKR5a+VxPK0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Dec 17, 2012 at 11:26 PM, Pavan Deolasee
<pavan(dot)deolasee(at)gmail(dot)com> wrote:

>>
>
> I probably did not mean increasing that to beyond 64-bit. OTOH I
> wondered if we would ever want to steal a few bits from the LSN field,
> given the numbers you just put out. But it was more of a question than
> objection.
>

BTW, now that XLogRecPtr is uint64, can't we change the pd_lsn field
to use the same type ? At least the following comment in bufpage.h
looks outdated or at the minimum needs some explanation as why LSN in
the page header needs to split into two 32-bit values.

123 /* for historical reasons, the LSN is stored as two 32-bit values. */
124 typedef struct
125 {
126 uint32 xlogid; /* high bits */
127 uint32 xrecoff; /* low bits */
128 } PageXLogRecPtr;

Thanks,
Pavan

--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 18:16:47
Message-ID: 28420.1355768207@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2012-12-17 12:47:41 -0500, Tom Lane wrote:
>> But, if the day ever comes when 64 bits doesn't seem like enough, I bet
>> we'd move to 128-bit integers, which will surely be available on all
>> platforms by then. So +1 for using plain comparisons --- in fact, I'd
>> vote for running around and ripping out the macros altogether. I had
>> already been thinking of fixing the places that are still using memset
>> to initialize XLRecPtrs to "invalid".

> I thought about that and had guessed you would be against it because it
> would cause useless diversion of the branches? Otherwise I am all for
> it.

That's the only argument I can see against doing it --- but Heikki's
patch was already pretty invasive in the same areas this would touch,
so I'm thinking this won't make back-patching much worse. The
notational simplification seems worth it.

regards, tom lane


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 18:30:10
Message-ID: 20121217183010.GA26826@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2012-12-17 23:45:51 +0530, Pavan Deolasee wrote:
> On Mon, Dec 17, 2012 at 11:26 PM, Pavan Deolasee
> <pavan(dot)deolasee(at)gmail(dot)com> wrote:
>
> >>
> >
> > I probably did not mean increasing that to beyond 64-bit. OTOH I
> > wondered if we would ever want to steal a few bits from the LSN field,
> > given the numbers you just put out. But it was more of a question than
> > objection.
> >
>
> BTW, now that XLogRecPtr is uint64, can't we change the pd_lsn field
> to use the same type ? At least the following comment in bufpage.h
> looks outdated or at the minimum needs some explanation as why LSN in
> the page header needs to split into two 32-bit values.
>
> 123 /* for historical reasons, the LSN is stored as two 32-bit values. */
> 124 typedef struct
> 125 {
> 126 uint32 xlogid; /* high bits */
> 127 uint32 xrecoff; /* low bits */
> 128 } PageXLogRecPtr;

pg_upgrade'ability. The individual bytes aren't necessarily laid out the
same with two such uint32s as with one uint64.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 18:39:17
Message-ID: 28838.1355769557@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com> writes:
> BTW, now that XLogRecPtr is uint64, can't we change the pd_lsn field
> to use the same type ?

No, at least not without breaking on-disk compatibility on little-endian
machines.

regards, tom lane


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-17 22:55:11
Message-ID: 20121217225511.GA8342@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2012-12-17 13:16:47 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > On 2012-12-17 12:47:41 -0500, Tom Lane wrote:
> >> But, if the day ever comes when 64 bits doesn't seem like enough, I bet
> >> we'd move to 128-bit integers, which will surely be available on all
> >> platforms by then. So +1 for using plain comparisons --- in fact, I'd
> >> vote for running around and ripping out the macros altogether. I had
> >> already been thinking of fixing the places that are still using memset
> >> to initialize XLRecPtrs to "invalid".
>
> > I thought about that and had guessed you would be against it because it
> > would cause useless diversion of the branches? Otherwise I am all for
> > it.
>
> That's the only argument I can see against doing it --- but Heikki's
> patch was already pretty invasive in the same areas this would touch,
> so I'm thinking this won't make back-patching much worse.

I thought a while about this for while and decided its worth trying to
this before the next review round of xlogreader. Even if it causes some
breakage there. Doing it this way round seems less likely to introduce
bugs, especially if somebody else would go round and do this after the
next xlogreader review round but before committing it.

Attached is
1) removal of MemSet(&ptr, 0, sizeof(XLogRecPtr)
2) removal of XLByte(EQ|LT|LE|Advance)
3) removal of the dead NextLogPage I noticed along the way

In 2) unfortunately one has to make decision in which way to simplify
negated XLByte(LT|LE) expressions. I tried to make that choice very
careful and when over every change several times after that, so I hope
there aren't any bad changes, but more eyeballs are needed.

> The notational simplification seems worth it.

After doing this: Definitely. Imo some of the conditions are way much
easier to read now. Perhaps I am just bad in reading negations though...

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-Use-InvalidXLogRecPtr-instead-of-MemSet-ptr-0-sizeof.patch text/x-patch 2.3 KB
0002-Remove-XLByte-LT-LE-EQ-and-XLByteAdvance-macros-they.patch text/x-patch 53.7 KB
0003-Remove-unused-NextLogPage-macro-in-xlog_inernal.h.patch text/x-patch 1.1 KB

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-18 12:14:10
Message-ID: m2vcbztv59.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> In 2) unfortunately one has to make decision in which way to simplify
> negated XLByte(LT|LE) expressions. I tried to make that choice very
> careful and when over every change several times after that, so I hope
> there aren't any bad changes, but more eyeballs are needed.

+ if (lsn > PageGetLSN(page))
+ if (lsn >= PageGetLSN(page))
+ if (lsn <= PageGetLSN(page))
+ if (max_lsn < this_lsn)

My only comment here would be that I would like it much better that the
code always use the same operators, and as we read from left to right,
that we pick < and <=.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-18 12:25:04
Message-ID: 20121218122503.GA17127@alap2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2012-12-18 13:14:10 +0100, Dimitri Fontaine wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > In 2) unfortunately one has to make decision in which way to simplify
> > negated XLByte(LT|LE) expressions. I tried to make that choice very
> > careful and when over every change several times after that, so I hope
> > there aren't any bad changes, but more eyeballs are needed.
>
> + if (lsn > PageGetLSN(page))
> + if (lsn >= PageGetLSN(page))
> + if (lsn <= PageGetLSN(page))
> + if (max_lsn < this_lsn)
>
> My only comment here would be that I would like it much better that the
> code always use the same operators, and as we read from left to right,
> that we pick < and <=.

I did that in most places (check the xlog.c changes), but in this case
it didn't seem to be appropriate because because that would have meant
partially reversing the order of operands which would have looked
confusing as well, given this check is a common patter across nearly
every xlog replay function.
Imo its a good idea trying to choose < or <= as operator but its also
important to keep the order consistent inside a single function/similar
functions.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-28 17:59:50
Message-ID: 20121228175950.GB4150@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund escribió:
> On 2012-12-17 13:16:47 -0500, Tom Lane wrote:
> > Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > > On 2012-12-17 12:47:41 -0500, Tom Lane wrote:
> > >> But, if the day ever comes when 64 bits doesn't seem like enough, I bet
> > >> we'd move to 128-bit integers, which will surely be available on all
> > >> platforms by then. So +1 for using plain comparisons --- in fact, I'd
> > >> vote for running around and ripping out the macros altogether. I had
> > >> already been thinking of fixing the places that are still using memset
> > >> to initialize XLRecPtrs to "invalid".
> >
> > > I thought about that and had guessed you would be against it because it
> > > would cause useless diversion of the branches? Otherwise I am all for
> > > it.
> >
> > That's the only argument I can see against doing it --- but Heikki's
> > patch was already pretty invasive in the same areas this would touch,
> > so I'm thinking this won't make back-patching much worse.
>
> I thought a while about this for while and decided its worth trying to
> this before the next review round of xlogreader.

I have applied these three patches, after merging for recent changes.
Thanks.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: XLByte* usage
Date: 2012-12-28 18:45:17
Message-ID: 20121228184517.GA32345@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2012-12-28 14:59:50 -0300, Alvaro Herrera wrote:
> Andres Freund escribió:
> > On 2012-12-17 13:16:47 -0500, Tom Lane wrote:
> > > Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > > > On 2012-12-17 12:47:41 -0500, Tom Lane wrote:
> > > >> But, if the day ever comes when 64 bits doesn't seem like enough, I bet
> > > >> we'd move to 128-bit integers, which will surely be available on all
> > > >> platforms by then. So +1 for using plain comparisons --- in fact, I'd
> > > >> vote for running around and ripping out the macros altogether. I had
> > > >> already been thinking of fixing the places that are still using memset
> > > >> to initialize XLRecPtrs to "invalid".
> > >
> > > > I thought about that and had guessed you would be against it because it
> > > > would cause useless diversion of the branches? Otherwise I am all for
> > > > it.
> > >
> > > That's the only argument I can see against doing it --- but Heikki's
> > > patch was already pretty invasive in the same areas this would touch,
> > > so I'm thinking this won't make back-patching much worse.
> >
> > I thought a while about this for while and decided its worth trying to
> > this before the next review round of xlogreader.
>
> I have applied these three patches, after merging for recent changes.
> Thanks.

Thanks!

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services