Re: [HACKERS] Re: 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

From: Andres Freund <andres(at)anarazel(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Steve Kehlet <steve(dot)kehlet(at)gmail(dot)com>, Forums postgresql <pgsql-general(at)postgresql(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Re: 9.4.1 -> 9.4.2 problem: could not access status of transaction 1
Date: 2015-06-01 08:58:09
Message-ID: 20150601085809.GC30287@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 2015-05-31 07:51:59 -0400, Robert Haas wrote:
> > 1) We continue determining the oldest SlruScanDirectory(SlruScanDirCbFindEarliest)
> > on the master to find the oldest offsets segment to
> > truncate. Alternatively, if we determine it to be safe, we could use
> > oldestMulti to find that.
> > 2) SlruScanDirCbRemoveMembers is changed to return the range of members
> > to remove, instead of doing itself
> > 3) We wal log [oldest offset segment guaranteed to not be alive,
> > nextmulti) for offsets, and [oldest members segment guaranteed to not be alive,
> > nextmultioff), and redo truncations for the entire range during
> > recovery.
> >
> > I'm pretty tired right now, but this sounds doable.
>
> I'm probably biased here, but I think we should finish reviewing,
> testing, and committing my patch before we embark on designing this.

Probably, yes. I am wondering whether doing this immediately won't end
up making some things simpler and more robust though.

> So far we have no reports of trouble attributable to the lack of the
> WAL-logging support discussed here, as opposed to several reports of
> trouble from the status quo within days of release.

The lack of WAL logging actually has caused problems in the 9.3.3 (?)
era, where we didn't do any truncation during recovery...

> By the time we've reached the minimum recovery point, they will have
> been recreated by the same WAL records that created them in the first
> place.

I'm not sure that's true. I think we could end up errorneously removing
files that were included in the base backup. Anyway, let's focus on your
patch for now.

> If, in the previous
> replay, we had wrapped all the way around, some of the stuff we keep
> may actually already have been overwritten by future WAL records, but
> they'll be overwritten again. Now, that could mess up our
> determination of which members to remove, I guess, but I'm not clear
> that actually matters either: if the offsets space has wrapped around,
> the members space will certainly have wrapped around as well, so we
> can remove anything we like at this stage and we're still OK. I agree
> this is ugly the way it is, but where is the actual bug?

I'm more worried about the cases where we didn't ever actually "badly
wrap around" (i.e. overwrite needed data); but where that's not clear on
the standby because the base backup isn't in a consistent state.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2015-06-01 10:27:52 Re: Efficient sorting the results of a join, without denormalization
Previous Message Sven R. Kunze 2015-06-01 08:13:05 Re: [to_tsvector] German Compound Words

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-06-01 09:02:44 Re: problems on Solaris
Previous Message Peter Geoghegan 2015-06-01 07:29:24 Arguable RLS security bug, EvalPlanQual() paranoia