Re: Recovery inconsistencies, standby much larger than primary

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)2ndquadrant(dot)com>
Subject: Re: Recovery inconsistencies, standby much larger than primary
Date: 2014-02-12 17:38:01
Message-ID: 30389.1392226681@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <stark(at)mit(dot)edu> writes:
> So I think I've come up with a scenario that could cause this. I don't
> think it's exactly what happened here but maybe something analogous
> happened with our base backup restore.

I agree it seems like a good idea for XLogReadBufferExtended to defend
itself against successive P_NEW calls possibly not returning consecutive
pages. However, unless you had an operating-system-level crash on the
master, this isn't sufficient to explain the problem. We'd need also a
plausible theory about how a base backup could've left us with short
segments in a large relation.

> (Or maybe the hot backup
> process could just catch the files in this state if a table is rapidly
> growing and it doesn't take care to avoid picking up new files that
> appear after it starts?)

That's a possible explanation I guess, but it doesn't seem terribly
probable from a timing standpoint. Also, you should be able to gauge
the probability of this theory from knowledge of the application ---
are the bloated relations all ones that would've been growing *very*
rapidly during the base backup?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2014-02-12 17:47:09 Re: Terminating pg_basebackup background streamer
Previous Message Tom Lane 2014-02-12 17:29:23 Re: Recovery inconsistencies, standby much larger than primary