Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YplSi-0004O6-Iw for pgsql-bugs@arkaria.postgresql.org; Tue, 05 May 2015 22:37:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YplSg-0006aV-AH for pgsql-bugs@arkaria.postgresql.org; Tue, 05 May 2015 22:37:10 +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 1YplSe-0006aO-Pt for pgsql-bugs@postgresql.org; Tue, 05 May 2015 22:37:09 +0000 Received: from nm13-vm3.bullet.mail.ne1.yahoo.com ([98.138.91.143]) by makus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YplSb-00027X-Ed for pgsql-bugs@postgresql.org; Tue, 05 May 2015 22:37:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1430865423; bh=t63QvBWFyZDaiu4LnBV69wzB4e+mZZZTR59+GwkHbJw=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=cA/bFCBqJuumHfIiv8y7sDTx+bm2ag4MqYhPasgHhitqc67RYbzhmnHqlc/KKfS0HZTlj+xT2pe7Gn1IiKAGCEqMfFwzNHjuzZ3QWYKYLlYndSp/FPf3bTtp12NBjFNq/jFzWcjuXHRjq6O+pykI9GHxGImSV4djHO06uBqxwe/hAJgNvLqfIq80eTJqHI8H0Pwc1Wbak1MHr5/9Sc7RXc44/NPqd+JoHKuijo1lYDv0DeoBuYoXmJ13dxaQcCtu/NG6bttvN9S3vGI9SAU669lMLXeC0FidzFumGQrMafYZX/qPm7B7rHIYFM+5MOAOjgw4lB/PJGR9HwuP1pQuEQ== Received: from [98.138.226.177] by nm13.bullet.mail.ne1.yahoo.com with NNFMP; 05 May 2015 22:37:03 -0000 Received: from [98.138.87.10] by tm12.bullet.mail.ne1.yahoo.com with NNFMP; 05 May 2015 22:36:19 -0000 Received: from [127.0.0.1] by omp1010.mail.ne1.yahoo.com with NNFMP; 05 May 2015 22:36:19 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 258075.93218.bm@omp1010.mail.ne1.yahoo.com X-YMail-OSG: CEAZSOUVM1lV87LHGaYRQyPk9lWy8lecdlpyjUShTWlog8l_QwYuqrhD0.qIjdF xpxQib1EF1vYX5qhLROAy.uDAzCc827de1laS0O7J4kFWZ9EAiVGUP82qmIgB2rztEAtdj0bfXoV 1rJwJH7SWXCZ5CIS1hRzzJ6qJPIJkCVVWEE0fTVrOAyhyIHfjhAC.XROnkat7hTwo2xui9.61lJ6 pJnH0cldn3FLob8rph1alB39zXI8fHpWpaTvtpuv62odY80woeuk9a6X.OAsGeJEYiWld_L_pcsv lFk60wR1NnwuNYpIsiU355.D0dcE6NUSADQffg89jgZTYf1x8Cw4vixUTRMa1BnojyntrNMcFXiH U.OlD3rCnAU5WCIPaMSpAGC7TbMhTFESAX4SH8WWKPzFQutUufw0lUHvdQwQHgWZjZuFkffnUnvu 4NLhxFpoRHuoqM4V3dH3WSObnJkvXeAEDRiQbYvWuC751r.z.W6B9hrgNfj4JlDPUzZj6ekyjiOf xx2w7cON1nAi1mEADOFxSgw-- Received: by 98.138.105.210; Tue, 05 May 2015 22:36:18 +0000 Date: Tue, 5 May 2015 22:36:18 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: Thomas Munro , Robert Haas Cc: Amit Kapila , Alvaro Herrera , Timothy Garnett , PostgreSQL Bugs Message-ID: <824444825.729337.1430865378314.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: References: Subject: Re: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 3473 X-Pg-Spam-Score: -2.0 (--) 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 Thomas Munro wrote: > On Wed, May 6, 2015 at 9:26 AM, Robert Haas wrote: >> On Tue, May 5, 2015 at 3:58 AM, Thomas Munro wrote: >>> Ok, so if you have autovacuum_freeze_max_age = 400 million multixacts >>> before wraparound vacuum, which is ~10% of 2^32, we would interpret >>> that to mean 400 million multixacts OR ~10% * some_constant of member >>> space, in other worlds autovacuum_freeze_max_age * some_constant >>> members, whichever comes first. But what should some_constant be? >> >> some_constant should be all the member space there is. So we trigger >> autovac if we've used more than ~10% of the offsets OR more than ~10% >> of the members. Why is autovacuum_multixact_freeze_max_age >> configurable in the place? It's configurable so that you can set it >> low enough that wraparound scans complete and advance the minmxid >> before you hit the wall, but high enough to avoid excessive scanning. >> The only problem is that it only lets you configure the amount of >> headroom you need for offsets, not members. If you squint at what I'm >> proposing the right way, it's essentially that that GUC should control >> both of those things. > > But member space *always* grows at least twice as fast as offset space > (aka active multixact IDs), because multixacts always have at least 2 > members (except in some rare cases IIUC), don't they? So if we do > what you just said, then we'll trigger wraparound vacuums twice as > soon as we do now for everybody, even people who don't have any > problem with member space management. We don't want this patch to > change anything for most people, let alone everyone. That, I think, is what has been driving this patch away from just considering the *_multixact_* settings as applying to both the members SLRU and the offsets SLRU; that would effectively simply change the monitored resource from one to the other. (We would probably want to actually use the max of the two, just to be safe, but that offsets might never actually be the trigger.) As Thomas says, that would be a big change for everyone, and not everyone necessarily *wants* their existing settings to have new and different meanings. > So I think that > some_constant should be at least 2, if we try to do it this way, in > other words if you set the GUC for 10% of offset space, we also start > triggering wraparounds at 20% of member space. But what if they configure it to start at 80% (which I *have* seen people do)? The early patches were a heuristic to attempt to allow current behavior for those not getting into trouble, and gradually ramp up aggressiveness as needed to prevent hitting the hard ERROR that now prevents wraparound. Perhaps, rather than reducing the threshold gradually, as the members SLRU approaches wraparound we could gradually shift from using offsets to members as the number we compare the thresholds to. Up to 25% of maximum members, or if offset is somehow larger, we just use offsets; else above 75% maximum members we use members; else we use a weighted average based on how far we are between 25% and 75%. It's kinda weird, but I think it gives us a reasonable way to ramp up up vacuum aggressiveness from what we currently do toward what Robert proposed based on whether the workload is causing things to head for trouble. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs