Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axK17-0006oM-C2 for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2016 20:00:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1axK16-0006us-Uf for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2016 20:00:28 +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 1axK16-0006um-JO for pgsql-hackers@postgresql.org; Mon, 02 May 2016 20:00:28 +0000 Received: from jiboia.ensmp.fr ([194.214.158.137]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axK13-0002Qt-0X for pgsql-hackers@postgresql.org; Mon, 02 May 2016 20:00:28 +0000 Received: from cri.ensmp.fr (152.200.219.88.rev.sfr.net [88.219.200.152]) (authenticated bits=0) by jiboia.ensmp.fr (8.15.2/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id u42K0FDm019205 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 May 2016 22:00:15 +0200 Date: Mon, 2 May 2016 22:00:14 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@sto To: Andres Freund cc: Robert Haas , Thom Brown , Abhijit Menon-Sen , Michael Paquier , Haribabu Kommi , "pgsql-hackers@postgresql.org" Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions In-Reply-To: <20160502165438.yu6inlsyv4babyie@alap3.anarazel.de> Message-ID: References: <20160425180521.2g6o4tgpkc3jneyj@alap3.anarazel.de> <20160425205720.i2ldnkwj6a2ldz7g@alap3.anarazel.de> <20160426213207.j3xi2amneejm3ed6@alap3.anarazel.de> <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de> <20160502164111.cpupbbkab6ik7wwd@alap3.anarazel.de> <20160502165438.yu6inlsyv4babyie@alap3.anarazel.de> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at jiboia.ensmp.fr with ID 5727B1CF.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 5727B1CF.000 from 152.200.219.88.rev.sfr.net/152.200.219.88.rev.sfr.net/88.219.200.152/cri.ensmp.fr/ X-Pg-Spam-Score: -2.9 (--) 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 Hello Andres, > Sure, attached. For what it is worth, it works for me on head. I'm wondering that if _mdfd_openseg may return NULL, then ISTM that "opened_directly" should logically be false, because it was not opened? If so, maybe consider something like: opened_directy = (seg != NULL); Now it does not change the result because the later code seems garded against a NULL seg, but it does not look right to have a boolean to say that a segment was opened if it was not indeed the case. Given the comments, I understand that the truncation implementation is a shortcut with a sting, as a lot of functions must then take into account that something unusual may have happen somewhere and deal with it... Also, I do not understand why this issue is raised by the flushing patch, it seems rather independent. > I'm not sure this is the best way to go about this. I can see valid > arguments for *always* using _mdfd_openseg() in mdsync(); and I'm > wondering whether we shouldn't make EXTENSION_* into a bitmask > (extend,extend_recovery,return_null,open_deleted). I thought about that when I looked at the previous fix, but it seemed that not all combinations made sense. -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers