Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awIJ6-0004tN-59 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Apr 2016 23:58:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1awIJ5-0002Z6-7m for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Apr 2016 23:58:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1awIJ3-0002YD-PJ for pgsql-hackers@postgresql.org; Fri, 29 Apr 2016 23:58:45 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1awIIz-0003PQ-CP for pgsql-hackers@postgresql.org; Fri, 29 Apr 2016 23:58:44 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 78D5720A89 for ; Fri, 29 Apr 2016 19:58:39 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Fri, 29 Apr 2016 19:58:39 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=c6LIdL3D0ESX2dxZy0xYriDIvUg=; b=RqYnt tFSCp2kgF4zLpHsSZeXd86mh1GphajRlddMwXNwJUsAwGgzzOLxWxMGpfHHlxLVe Tvx+/+vm2MhxkYNCiqqDsVAWtk2I+FvadH/Lvaa6r15kzDSNkD1xrrJUz7aZn+x1 /lxjUtw8R2LI8c+Jk4Fwp/GcjnIRbPMpu9xlI8= X-Sasl-enc: deghb35rq2MVliHhsUwfzhagOOMy7uIhnLTOuXK67Fu0 1461974319 Received: from intern.anarazel.de (unknown [162.217.75.74]) by mail.messagingengine.com (Postfix) with ESMTPA id 1FA20C00012; Fri, 29 Apr 2016 19:58:39 -0400 (EDT) Date: Fri, 29 Apr 2016 16:58:37 -0700 From: Andres Freund To: Thom Brown Cc: Robert Haas , Abhijit Menon-Sen , Michael Paquier , Haribabu Kommi , Fabien COELHO , "pgsql-hackers@postgresql.org" Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions Message-ID: <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de> References: <20160425155627.e4yk72bm2naisesz@alap3.anarazel.de> <20160425180521.2g6o4tgpkc3jneyj@alap3.anarazel.de> <20160425205720.i2ldnkwj6a2ldz7g@alap3.anarazel.de> <20160426213207.j3xi2amneejm3ed6@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2016-04-28 17:41:29 +0100, Thom Brown wrote: > I've noticed another breakage, which I can reproduce consistently. > 2016-04-28 17:36:08 BST [18108]: [47-1] user=,db=,client= DEBUG: could not > fsync file "base/24581/24594.1" but retrying: No such file or directory > 2016-04-28 17:36:08 BST [18108]: [48-1] user=,db=,client= ERROR: could not > fsync file "base/24581/24594.1": No such file or directory > 2016-04-28 17:36:08 BST [18605]: [17-1] > user=thom,db=postgres,client=[local] ERROR: checkpoint request failed > 2016-04-28 17:36:08 BST [18605]: [18-1] > user=thom,db=postgres,client=[local] HINT: Consult recent messages in the > server log for details. Yuck. md.c is so crummy :( Basically the reason for the problem is that mdsync() needs to access "formally non-existant segments" (as in ones where previous segments are < RELSEG_SIZE), because we queue (and the might be preexistant) fsync requests via register_dirty_segment() in mdtruncate(). I'm a bit of a loss of how to reconcile that view with the original issue in this thread. The best I can come up with this moment is doing a _mdfd_openseg() in mdsync() to open the truncated segment if _mdfd_getseg() returned NULL. We don't want to normally use that in either function because it'll imply a separate open() etc, which is pretty expensive - but doing in the fallback case would be kind of ok. Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers