Thread: pgsql: Prevent CLUSTER from decreasing a relation's relfrozenxid.

pgsql: Prevent CLUSTER from decreasing a relation's relfrozenxid.

From
tgl@postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Prevent CLUSTER from decreasing a relation's relfrozenxid.  Bug
introduced in rewrite to make CLUSTER MVCC-safe.

Modified Files:
--------------
    pgsql/src/backend/commands:
        cluster.c (r1.167 -> r1.168)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/cluster.c?r1=1.167&r2=1.168)

Re: pgsql: Prevent CLUSTER from decreasing a relation's relfrozenxid.

From
Alvaro Herrera
Date:
Tom Lane wrote:
> Log Message:
> -----------
> Prevent CLUSTER from decreasing a relation's relfrozenxid.  Bug
> introduced in rewrite to make CLUSTER MVCC-safe.

Actually the bug is all mine, not Heikki's -- I changed this code so
that CLUSTER would be able to advance the relation's relfrozenxid.

Thanks for fixing it.

I don't think it explains the reported bug, though; this is all new in
8.3.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: pgsql: Prevent CLUSTER from decreasing a relation's relfrozenxid.

From
Tom Lane
Date:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> I don't think it explains the reported bug, though; this is all new in
> 8.3.

No, it certainly doesn't explain the problem JD reported --- not only is
it new code in 8.3, but the symptom is backwards from what was reported
(main table's relfrozenxid older than toast table's, instead of newer).

It's barely possible that the symptom is actually the same and there was
a wraparound issue in there too, but I suspect that what JD really had
there was some kind of PITR tracking problem.  Can't think what though.
When we first got the report I went trolling for places that might fail
to WAL-log a relfrozenxid update, but I couldn't find anything.

            regards, tom lane