Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vq5Xw-0006gw-IQ for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Dec 2013 18:27:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vq5Xv-0002o2-Ep for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Dec 2013 18:27:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vq5Xu-0002nm-QN for pgsql-bugs@postgresql.org; Mon, 09 Dec 2013 18:27:06 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vq5Xr-000783-8x for pgsql-bugs@postgresql.org; Mon, 09 Dec 2013 18:27:06 +0000 Received: from anarazel.de (p5DDC4D15.dip0.t-ipconnect.de [93.220.77.21]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0M6lu8-1Vc18E1M28-00wpnQ; Mon, 09 Dec 2013 19:27:02 +0100 Received: by anarazel.de (Postfix, from userid 1000) id B220F100BC9; Mon, 9 Dec 2013 19:27:01 +0100 (CET) Date: Mon, 9 Dec 2013 19:27:01 +0100 From: Andres Freund To: Serge Negodyuck Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #8673: Could not open file "pg_multixact/members/xxxx" on slave during hot_standby Message-ID: <20131209182701.GD9519@awork2.anarazel.de> References: <20131209142525.GA1123@awork2.anarazel.de> <20131209150345.GB1123@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:7e4rPOaAjrCUEqPgzUhsZ8rQrpp86sFPZg4bRuvJNIn uUv3+K5f87ekO9Ou4KhD4k4zrRqj4sKr/WmB5xNrqLrLkmLJOK I2tafS7azIJVA8vZ2zTl1TgCqlB9orlEJEHL4PJO8iu9rFPlvI UjTa8vH7GKH1+34gMwqGFTNioRVWJerzRG7onByUuVnHW2vi+J j3xfcYdoT1xf+S+QNtwcz89lTOutVfWXntyuIcijpX7bJjY0F5 b63zNKEytlo/J4qmKngYhbOAsL5I+PMm7HcxzU56DAR1+QMYFb NBP6G9fx1h4d8BvBIgirWClzUDfub5NuyNpVEZ+QB3md3X1W2t Dqf/i9rh7Ftqm0g5zMrV0CeF69YC8Arlq/4CFVZez X-Pg-Spam-Score: -1.9 (-) 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 Hi, On 2013-12-09 17:49:34 +0200, Serge Negodyuck wrote: > On master there are files from 0000 to 14078 > > On slave there were absent files from A1xx to FFFF > They were the oldest ones. (October, November) Some analysis later, I am pretty sure that the origin is a longstanding problem and not connected to 9.3.[01] vs 9.3.2. The above referenced 14078 file is exactly the last page before a members wraparound: (gdb) p/x (1L<<32)/(MULTIXACT_MEMBERS_PER_PAGE * SLRU_PAGES_PER_SEGMENT) $10 = 0x14078 So, what happened is that enough multixacts where created, that the members slru wrapped around. It's not unreasonable for the members slru to wrap around faster then the offsets one - after all we create at least two entries into members for every offset entry. Also in 9.3+ there fit more xids on a offset than a members page. When truncating, we first read the offset, to know where we currently are in members, and then truncate both from their respective point. Since we've wrapped around in members we very well might remove content we actually need. I've recently remarked that I find it dangerous that we only do anti-wraparound stuff for pg_multixact/offsets, not for /members. So, here we have the proof that that's bad. This is an issue in <9.3 as well. It might, in some sense, even be worse there, because we never vacuum old multis away. But on the other hand, the growths of multis is slower there and we look into old multis less frequently. The only reason that you saw the issue on the standby first is that the truncation code is called more frequently there. Afaics it will happen, sometime in the future, on the master as well. I think problems should be preventable if you issue a systemwide VACUUM FREEZE, but please let others chime in before you execute it. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs