Re: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Timothy Garnett <tgarnett(at)panjiva(dot)com>, PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)
Date: 2015-05-09 02:46:24
Message-ID: CA+Tgmob8BR-D6Zhjse3j8GA2-Sv=NhV9pZfj72hm0gDErZ_-mA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, May 8, 2015 at 9:55 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> Thomas Munro wrote:
>> I think I see why, and I think it's a bug: if you vacuum freeze all
>> your databases, MultiXactState->oldestMultiXactId finishes up equal to
>> MultiXactState->nextMXact.
>
> Uhm, that's rather silly.
>
>> But that's not actually a multixact that exists yet, so when when
>> DetermineSafeOldestOffset calls find_multixact_start, it reads a
>> garbage offset (all zeros in practice since pages start out zeroed)
>> and produces a garbage value for offsetStopLimit which might
>> incorrectly stop you from creating any more multixacts even though
>> member space is entirely empty (but it depends on where your
>> nextOffset happens to be at the time).
>
> Right.
>
>> I think the fix is something like "if nextMXact == oldestMultiXactId,
>> then there are no active multixacts, so the offsetStopLimit should be
>> set to nextOffset - (a segment's worth)".
>
> Makes sense.

Here's a patch that attempts to implement this.

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

Attachment Content-Type Size
no-multixacts-fix.patch application/x-patch 1.4 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message apolishc 2015-05-09 11:34:16 BUG #13258: pg_config shows wrong version
Previous Message Alvaro Herrera 2015-05-09 01:55:28 Re: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)