pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Kevin Grittner <kgrittn@ymail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Timothy Garnett <tgarnett@panjiva.com>
Cc: PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)
Date: Thu, 7 May 2015 19:58:11 -0400
Message-ID: <D8A99261-9E17-436B-B08C-BDCDBB07239D@gmail.com> (raw)
In-Reply-To: <CAEepm=12OoYdLSCXAN3dT2eCFpVfUcc9WRZ59ROrFDGhevtW7g@mail.gmail.com>
References: <CA+TgmoaR67gP-QBOhfWRod_E-7YKudSEo84-Z=_0PycnetgBuw@mail.gmail.com>
	<20150506143418.GT2523@alvh.no-ip.org>
	<CA+TgmoZH5yBwa98oeuipxUN0m_U2+Yd9kdRY+CcZtT9Q=R8MZA@mail.gmail.com>
	<CAEepm=10MwoFjdDgTeGUh6QO0QG89OE3c7tkbenRYLXF2t0OkA@mail.gmail.com>
	<26622F69-38AB-479C-9155-8CAE65DBF9B6@gmail.com>
	<CAEepm=3OPzjcqdM3vm4dM0VFYW9RjMcW8u+7LFKMWArQ7=mS=A@mail.gmail.com>
	<CA+TgmoYtFwG2n61WAiSKcgEqFSXWkUr6oSyzeGD_KtUn7CvNKQ@mail.gmail.com>
	<20150507151849.GE2523@alvh.no-ip.org>
	<CA+TgmoZ1POPQNfYFL8Wv9_tT=MMmSZf5GEAqj4ieWHk+H5iRMA@mail.gmail.com>
	<CA+TgmobbaQpE6sNqT30+rz4UMH5aPraq20gko5xd2ZGajz1-Jg@mail.gmail.com>
	<20150507180045.GG2523@alvh.no-ip.org>
	<CAEepm=12OoYdLSCXAN3dT2eCFpVfUcc9WRZ59ROrFDGhevtW7g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On May 7, 2015, at 6:21 PM, Thomas Munro <thomas.munro@enterprisedb.com> wrote:
> I may have the details wrong there, but in general I can't see how you
> can delete just the right segment files while the head and tail
> pointers of this circular buffer are both moving, unless you hold the
> lock to stop that while you make the decision and unlink the file
> (which I assume is out of the question), or say 'well if we keep the
> head and tail pointers at least 20 pages apart, that's unlikely to
> happen' (which I assume is also out of the question).  

That is exactly the sort of thing I was worried about, but I couldn't put my finger on it. I think your analysis is right.

> Now I
> understand the suggestion that the checkpoint code could be in charge
> of advancing the oldest multixact + offset.

Yeah. I think we need to pursue that angle unless somebody has a better idea.  It would also address another issue I am concerned about: the current system seems to advance the oldest multixact information in shared memory differently on the primary and the standby. I'm not sure the logic actually works on the standby at all at this point, but even if it does, it seems unlikely be right to rely on redo to do on the standby what is being done by a completely different, not-WAL-logged operation on the master.  Making the checkpoint do it in both cases would fix that.

> But if we did that, our new autovacuum code would get confused and
> keep trying to vacuum stuff that it's already dealt with, until the
> next checkpoint... so maybe we'd need to track both (1) the offset of
> the oldest multixact: the one that we use to trigger autovacuums, even
> though there might be even older segments still on disk, and (2)
> offset_of_start_of_oldest_segment_on_disk (suitably compressed): the
> one that we use to block wraparound in GetNewMultiXactId, so that we
> never write into a file that checkpoint might decide to delete.

That sounds plausible.


...Robert

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (113+ messages)  latest in thread

Message-ID: <D8A99261-9E17-436B-B08C-BDCDBB07239D@gmail.com>
Permalink:  ../D8A99261-9E17-436B-B08C-BDCDBB07239D@gmail.com/
Also on:    postgresql.org/message-id/D8A99261-9E17-436B-B08C-BDCDBB07239D@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: robertmhaas@gmail.com, thomas.munro@enterprisedb.com, alvherre@2ndquadrant.com, kgrittn@ymail.com, amit.kapila16@gmail.com, tgarnett@panjiva.com
  Subject: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)
  In-Reply-To: <D8A99261-9E17-436B-B08C-BDCDBB07239D@gmail.com>
  References: <CA+TgmoaR67gP-QBOhfWRod_E-7YKudSEo84-Z=_0PycnetgBuw@mail.gmail.com> <20150506143418.GT2523@alvh.no-ip.org> <CA+TgmoZH5yBwa98oeuipxUN0m_U2+Yd9kdRY+CcZtT9Q=R8MZA@mail.gmail.com> <CAEepm=10MwoFjdDgTeGUh6QO0QG89OE3c7tkbenRYLXF2t0OkA@mail.gmail.com> <26622F69-38AB-479C-9155-8CAE65DBF9B6@gmail.com> <CAEepm=3OPzjcqdM3vm4dM0VFYW9RjMcW8u+7LFKMWArQ7=mS=A@mail.gmail.com> <CA+TgmoYtFwG2n61WAiSKcgEqFSXWkUr6oSyzeGD_KtUn7CvNKQ@mail.gmail.com> <20150507151849.GE2523@alvh.no-ip.org> <CA+TgmoZ1POPQNfYFL8Wv9_tT=MMmSZf5GEAqj4ieWHk+H5iRMA@mail.gmail.com> <CA+TgmobbaQpE6sNqT30+rz4UMH5aPraq20gko5xd2ZGajz1-Jg@mail.gmail.com> <20150507180045.GG2523@alvh.no-ip.org> <CAEepm=12OoYdLSCXAN3dT2eCFpVfUcc9WRZ59ROrFDGhevtW7g@mail.gmail.com> <D8A99261-9E17-436B-B08C-BDCDBB07239D@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox