Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YqBnl-0007Jq-0Z for pgsql-bugs@arkaria.postgresql.org; Thu, 07 May 2015 02:44:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YqBnk-0002he-8R for pgsql-bugs@arkaria.postgresql.org; Thu, 07 May 2015 02:44:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YqBnj-0002hY-D8 for pgsql-bugs@postgresql.org; Thu, 07 May 2015 02:44:39 +0000 Received: from mail-qc0-x22c.google.com ([2607:f8b0:400d:c01::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YqBnf-0000UV-Bo for pgsql-bugs@postgresql.org; Thu, 07 May 2015 02:44:38 +0000 Received: by qcyk17 with SMTP id k17so14923430qcy.1 for ; Wed, 06 May 2015 19:44:34 -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=hHoavamKkXcxXSMzUgo5O2YNl8mdwW1Li+yD60KU+d8=; b=Eax3B/9wyV+i00Q1LRDlZcst/6IHjLkIMvf+iezEjy1emV3BZ0WS8Zir/qvOyuHOqT J9bOcCFN29rcMbCfdTtpZmo3Srqvrs7gdzx4TifFGvqx4eDAUHF2ZIq45i+FArTYTZOw 4aDDpqtsIs5zHPfhPacuKlCcb1Q/Gb+xutIbt8r32SdWGMsP5iebtXUsabovuM1DpB19 SPxRuDszlYnJjTQK2mFZIxZKMqGtou0shbCoKJuaG+fzPI/SWPAa8+kst3YsxDkjBSlm FyWlpWgrWlml2Q0w4NJdoZjkdFdeWOQdha95ewadLJ60YxxKO7CXB9OCqCXMl1O7RahI Y/OA== X-Received: by 10.229.102.73 with SMTP id f9mr2394315qco.19.1430966674153; Wed, 06 May 2015 19:44:34 -0700 (PDT) Received: from [192.168.1.7] (pool-108-24-155-230.cmdnnj.fios.verizon.net. [108.24.155.230]) by mx.google.com with ESMTPSA id 139sm533416qhb.26.2015.05.06.19.44.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 May 2015 19:44:32 -0700 (PDT) References: <789650107.1373029.1430772107036.JavaMail.yahoo@mail.yahoo.com> <20150506143418.GT2523@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: <26622F69-38AB-479C-9155-8CAE65DBF9B6@gmail.com> 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: Wed, 6 May 2015 22:44:31 -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 6, 2015, at 9:48 PM, Thomas Munro wr= ote: >> On Thu, May 7, 2015 at 4:23 AM, Robert Haas wrot= e: >> On Wed, May 6, 2015 at 10:34 AM, Alvaro Herrera wrote: >>>> 2. Doesn't the code that sets MultiXactState->multiVacLimit also need >>>> to use what I'm now calling MultiXactMemberFreezeThreshold() - or some >>>> similar logic? Otherwise, a user with autovacuum=3Doff won't get >>>> emergency autovacuums for member exhaustion, even though they will get >>>> them for offset exhaustion. >>>=20 >>> Yeah, it looks like it does. >>=20 >> OK, I'm not clear how to do that correctly, exactly, but hopefully one >> of us can figure that out. >=20 > MultiXactState->multiVacLimit holds the multixact IDs at which an age > thresholds will be crossed, so that GetNewMultiXactId can check it > cheaply. But we can't predict the future multixact IDs at which our > member usage threshold will be crossed. We could try to estimate it > based on past multixact sizes, but (as I think we already covered > somewhere else) we shouldn't be trying to do that because it wouldn't > handle the situation where your member space consumption rate suddenly > went up, among other problems. >=20 > How about this: we add oldestOffset to MultiXactState, to be set by > DetermineSafeOldestOffset, and then at the place where > GetNewMultiXactId checks if (!MultiXactIdPrecedes(result, > MultiXactState->multiVacLimit) it could also check whether (nextOffset > - MultiXactState->oldestOffset > MULTIXACT_MEMBER_SAFE_THRESHOLD). > ReadMultiXactCounts should also use the oldestOffset value directly > from shmem instead of calling find_multixact_start. That sounds pretty good. ...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