Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0Qsa-0004jH-JF for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jun 2015 08:52:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z0QsZ-0002gU-R2 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jun 2015 08:51:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z0QsZ-0002gI-0Y; Thu, 04 Jun 2015 08:51:59 +0000 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z0QsU-0002r4-U8; Thu, 04 Jun 2015 08:51:58 +0000 Received: by qkx62 with SMTP id 62so20315876qkx.3; Thu, 04 Jun 2015 01:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=a0iC+r06qNVf+2e8nZYzv6xOXPe+Ii4oetq4VmSMOK4=; b=RP7gl+gvmH/wS1FhJo0Omd9JXBg7kvyFSY5tsGYDw5g0W/3QIowxHA2BEANtKCpG46 1j67QIowY7D/qdf1TkbFpgOywBq+hXnBCxr8FulX5RlHKQTi0cvBKXiP28WqAMq6Qed4 70cmDU4jqxcZiicD1Zj7bQTWQCB04GWjepy6lau7LCl2YSF0rGRFCtHNRT16XLnDM3oo QiuYq6Jh5YeztaD1CqDLZxji+uZxnukjxV3ccmWWQEOAjzP/ydLELG3ndOiEMPdugOCV E9IwD3dyand/vU9Rf+V09ww7Y44JiJr6+vG0+uOTYN4RLp4ONmfXLl/V1zOPywLqTkkt tfUg== X-Received: by 10.55.48.18 with SMTP id w18mr23765190qkw.34.1433407913062; Thu, 04 Jun 2015 01:51:53 -0700 (PDT) Received: from [192.168.1.99] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by mx.google.com with ESMTPSA id p84sm2024137qkh.10.2015.06.04.01.51.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2015 01:51:52 -0700 (PDT) Message-ID: <557011A0.6070604@iki.fi> Date: Thu, 04 Jun 2015 11:51:44 +0300 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Andres Freund , Bruce Momjian CC: Robert Haas , Tom Lane , Stephen Frost , Magnus Hagander , "pgsql-hackers@postgresql.org" , pgsql-core Subject: Re: [CORE] postpone next week's release References: <20150529195751.GN26667@tamriel.snowman.net> <27697.1432929660@sss.pgh.pa.us> <28477.1432931820@sss.pgh.pa.us> <20150529223321.GB6535@alap3.anarazel.de> <12510.1432958887@sss.pgh.pa.us> <20150530154559.GA25053@momjian.us> <20150530204727.GJ13944@alap3.anarazel.de> In-Reply-To: <20150530204727.GJ13944@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.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 On 05/30/2015 11:47 PM, Andres Freund wrote: > I don't think it's primarily a problem of lack of review; although that > is a large problem. I think the biggest systematic problem is that the > compound complexity of postgres has increased dramatically over the > years. Features have added complexity little by little, each not > incrementally not looking that bad. But very little has been done to > manage complexity. Since 8.0 the codesize has roughly doubled, but > little has been done to manage the increased complexity. Few new > abstractions have been introduced and the structure of the code is > largely the same. > > As a somewhat extreme example, let's look at StartupXLOG(). In 8.0 it > was ~500 LOC, in master it's ~1500. The interactions in 8.0 were > complex, they have gotten much more complex since. It fullfills lots of > different roles, all in one function: > > (roughly in the order things happen, but simplified) > * Read the control file/determine whether we crashed > * recovery.conf handling > * backup label handling > * tablespace map handling (huh, I missed that this was added directly to > StartupXLOG. What a bad idea) > * Determine whether we're doing archive recovery, read the relevant > checkpoint if so > * relcache init file removal > * timeline switch handling > * Loading the checkpoint we're starting from > * Initialization of a lot of subsystems > * crash recovery/replay > * Including pgstat, unlogged table, exported snapshot handling > * iff hot standby, some more subsystems are initialized here > * hot standby state handling > * replay process intialization > * crash replay itself, including > * progress tracking > * recovery pause handling > * nextxid tracking > * timeline increase handling > * hot standby state handling > * unlogged relations handling > * archive recovery handling > * creation/initialization of the end of recovery checkpoint > * timeline increment if failover > * subsystem initialization iff !hot_standby > * end of recovery actions > > Yes. that's one routine. And, to make things even funnier, half of that > routine isn't exercised by our tests. > > You can argue that this is an outlier, but I don't think so. Heapam, the > planner, etc. have similar cases. > > And I think this, to some degree, explains a lot of the multixact > problems. While there were a few "simple bugs", most of them were > interactions between the various subsystems that are rather intricate. I think this explanation is wrong. I agree that there are many places that would be good to refactor - like StartupXLOG() - but the multixact code was not too bad in that regard. IIRC the patch included some refactoring, it added some new helper functions in heapam.c, for example. You can argue that it didn't do enough of it, but that was not the big issue. The big issue was at the architecture level. Basically, we liked vacuuming of XIDs and clog so much that we decided that it'd be nice if you had to vacuum multixids too, in order to not lose data. Many of the bugs and issues were not new - we had multixids before - but we upped the ante and turned minor locking bugs into data loss. And that had nothing to do with the code structure - we'd have similar issues if we had rewritten everything java, with the same design. So, I'm all for refactoring and adding abstractions where it makes sense, but it's not going to solve design problems. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers