Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YqVgV-0003U1-70 for pgsql-bugs@arkaria.postgresql.org; Thu, 07 May 2015 23:58:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YqVgT-0001Iy-KM for pgsql-bugs@arkaria.postgresql.org; Thu, 07 May 2015 23:58:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YqVgS-0001Iq-KC for pgsql-bugs@postgresql.org; Thu, 07 May 2015 23:58:28 +0000 Received: from mail-qg0-x22f.google.com ([2607:f8b0:400d:c04::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YqVgL-0007ZP-5r for pgsql-bugs@postgresql.org; Thu, 07 May 2015 23:58:27 +0000 Received: by qgfi89 with SMTP id i89so29313193qgf.1 for ; Thu, 07 May 2015 16:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=Al+EGVN3erVS8WS28jeohLqsxMaDJk9uTFa44vB+YPs=; b=IpwFl5uBbOR40pQCL8tqSrX9B2ljeB79KhtxCvYrmlCA0Y496NflQByW5q7CQEgy2o o6feYl0Paw57BCQyvK3F/bV1BTPc8315yMBzX4GdMJ8CRi4m4wjpfAQcHBGhi6cLRI3H KPrfrVhYwQzR47hKj4THpKMqsfw1VdvpPu+J7/0iPLYjqcPK2qKlZ4JJDlxrWFoIL8Ij LtGv2FKSheEYGKqkerfJKbzg/S6yBE/VPszlUxcTa2fhPFf2tEyLRa9iUo89smvTCTtm hLzB9ove/xYtTmoCG5lF8aSdHdq8N7wDScRVD7rpVyn9Eko/QBtBclY6STA7R5NlM+/N rOBg== X-Received: by 10.140.144.76 with SMTP id 73mr1705989qhq.28.1431043098318; Thu, 07 May 2015 16:58:18 -0700 (PDT) Received: from [10.91.184.91] ([166.170.31.251]) by mx.google.com with ESMTPSA id 188sm2472992qhh.48.2015.05.07.16.58.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 May 2015 16:58:16 -0700 (PDT) References: <20150506143418.GT2523@alvh.no-ip.org> <26622F69-38AB-479C-9155-8CAE65DBF9B6@gmail.com> <20150507151849.GE2523@alvh.no-ip.org> <20150507180045.GG2523@alvh.no-ip.org> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: Cc: Alvaro Herrera , Kevin Grittner , Amit Kapila , Timothy Garnett , PostgreSQL Bugs X-Mailer: iPhone Mail (12B435) From: Robert Haas 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 To: Thomas Munro X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On May 7, 2015, at 6:21 PM, Thomas Munro wr= ote: > 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).=20=20 That is exactly the sort of thing I was worried about, but I couldn't put m= y 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 ide= a. It would also address another issue I am concerned about: the current s= ystem seems to advance the oldest multixact information in shared memory di= fferently on the primary and the standby. I'm not sure the logic actually w= orks on the standby at all at this point, but even if it does, it seems unl= ikely 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 --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs