Re: lcr v5 - introduction of InvalidCommandId

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: lcr v5 - introduction of InvalidCommandId
Date: 2013-09-05 16:44:18
Message-ID: CA+TgmoYzXVD1TgohfeL5oUfGoT+otimSgQyXv11wkwPvcCw_HA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 4, 2013 at 12:07 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2013-09-03 11:40:57 -0400, Robert Haas wrote:
>> > 0002 wal_decoding: Introduce InvalidCommandId and declare that to be the new maximum for CommandCounterIncrement
>>
>> I'm still unconvinced we want this.
>
> Ok, so the reason for the existance of this patch is that currently
> there is no way to represent a "unset" CommandId. This is a problem for
> the following patches because we need to log the cmin, cmax of catalog
> rows and obviously there can be rows where cmax is unset.

For heap tuples, we solve this problem by using flag bits. Why not
adopt the same approach?

> The reason I chose to change the definition of CommandIds is that the
> other ondisk types we use like TransactionIds, XLogRecPtrs and such have
> an "invalid" type, CommandIds don't. Changing their definition to have 0
> - analogous to the previous examples - as their invalid value is not a
> problem because CommandIds from pg_upgraded clusters may never be used
> for anything. Going from 2^32 to 2^32-1 possible CommandIds doesn't seem
> like a problem to me. Imo the CommandIds should have been defined that
> way from the start.
>
> Makes some sense?

I don't have a problem with this if other people think it's a good
idea. But I think it needs a few +1s and not too many -1s first, and
so far (AFAIK) no one else has weighed in with an opinion.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2013-09-05 16:46:14 Re: Where can I find the code for extern OidFunctionCall7?
Previous Message Josh Berkus 2013-09-05 16:42:17 Re: get rid of SQL_ASCII?