Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oY3q5-0003hn-VD for pgsql-admin@arkaria.postgresql.org; Tue, 13 Sep 2022 11:12:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oY3p6-00043M-EK for pgsql-admin@arkaria.postgresql.org; Tue, 13 Sep 2022 11:11:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oY3p5-00043C-BU for pgsql-admin@lists.postgresql.org; Tue, 13 Sep 2022 11:11:24 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oY3p1-0002wx-Vj for pgsql-admin@lists.postgresql.org; Tue, 13 Sep 2022 11:11:22 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C334E5C00DF; Tue, 13 Sep 2022 07:11:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 13 Sep 2022 07:11:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1663067477; x=1663153877; bh=0 V5RsHnh39NQTCyPTtWvRko4EtsS56BUYgUZnaL7Zq8=; b=fqqlAT0yYLscbWw98 9ME6p7YEE2BgnC8V9QXCOPojsqMltYJRpdYoEvnWvkntYAOTTLaXqi1/8CCYm8NR jkeObSkXXXRg8CrqxrqWNo7jbb3fJ0iwT07nevYE25xwUUtqTUQ/nuqDUEp35iss fBwBKtV2mjXT4F0hENrgCQrhf4MO7APAlalYoeKEwVT1ht0PcFVPb5kYQ8NcB9MF RD+KxlSMDXWzoPItAMIscg7AseaiBWnFPwi+glwlXRB0GatpKckHbWedB4LQFBZ5 bMev1lHE5cM//48X4WuJf/rLcTHH3DO4W8hGWAJWV+OnqNoD2+VNP/Zs6VFoNTlb Sd8Dg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedugedgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Sep 2022 07:11:16 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id EC33538C; Tue, 13 Sep 2022 13:11:14 +0200 (CEST) Date: Tue, 13 Sep 2022 13:11:14 +0200 From: Alvaro Herrera To: Leandro Bugalho Cc: pgsql-admin@lists.postgresql.org Subject: Re: Error when execute insert/update Message-ID: <20220913111114.h6ksiclfj6e2nnrf@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Sep-11, Leandro Bugalho wrote: > Hi guys, I have a PostgreSQL 9.5 server, which started showing the > following message in the log: > > ,ERROR,54000,"multixact ""members"" limit exceeded","This command > would create a multixact with 2 members, but the remaining space is > only enough for 0 members.","Run a database-wide VACUUM in database > with OID 139059 with reduced vacuum_multixact_freeze_min_age and > vacuum_multixact_freeze_table_age settings.",,,"SQL statement ""SELECT > 1 FROM ONLY ""public"".""alf_server"" x WHERE ""id"" > OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x""","insert into > > I started the vacuum in the database , but the same for the size ,I > believe it will take a long time. Is there any way to increase this > limit member while the vacuum is running to free up the application? Sorry I'm late to the party. I hope you're already out of this hole. So this reply is for the archives' sake. There's no configuration parameter you can change that will help you in this case. One way out of this that's perhaps a tad quicker than vacuuming the entire database, is vacuuming just the table(s) that have the oldest multixacts. If you're lucky, it's just a not-so-big table that can be dealt with quicker than the entire database. You're looking for the table(s) with the highest values of mxid_age(pg_class.relminmxid). Have VACUUM process them successfully and their relminmxid will advance to a current value, and that will enable VACUUM to move the global minmxid limit forward and delete the oldest multixact data, giving some extra room for new multixacts to be created. Now, it is suprising that autovacuum didn't already did this by itself. It definitely should have. However, there are some problem cases: Sometimes, this is caused by tables that have corrupted data; those cause vacuum to terminate with an error without advancing the limit, so your database as a whole is stuck in old-multixactid land. If you can fix the corruption and let vacuum complete, that will work. If you cannot, you could just DROP the table. If it has valuable data, maybe you can CREATE TABLE AS SELECT FROM corrupt_table, with enough smarts to avoid falling over due to the corruption. Another cause we've seen is leftover temp tables: autovacuum cannot process them because temp tables cannot be read/written by sessions other than the one that created them. What you can do in this case is just drop those temp tables. We added some additional protections for this case in Postgres 10, but 9.5 still had some holes. This is particularly problematic if the server crashes and there is some session that is using temp tables, and afterwards the session ID is not reused. Those temp tables would be dropped at startup by another session that uses the same ID, but if --say-- the ID is very high and you don't have that many sessions again afterwards, they won't. (If you do DROP any tables, you will need to vacuum some other table afterwards, to let the code that advances the minimum have a chance to run.) -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Cómo ponemos nuestros dedos en la arcilla del otro. Eso es la amistad; jugar al alfarero y ver qué formas se pueden sacar del otro" (C. Halloway en La Feria de las Tinieblas, R. Bradbury)