Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtJGg-0006W0-6V for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Sep 2017 20:00:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dtJGf-00054F-L9 for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Sep 2017 20:00:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dtJF6-0002BR-9E for pgsql-hackers@postgresql.org; Sat, 16 Sep 2017 19:59:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dtJF3-0001Dv-GA for pgsql-hackers@postgresql.org; Sat, 16 Sep 2017 19:59:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v8GJx1bi027205; Sat, 16 Sep 2017 15:59:02 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org Subject: Re: Re: [COMMITTERS] pgsql: Perform only one ReadControlFile() during startup. In-reply-to: <20170916183849.kgqlyi3q2oy4qjkx@alap3.anarazel.de> References: <14134.1505572349@sss.pgh.pa.us> <20170916182634.blb7upixw7hosdhu@alap3.anarazel.de> <23456.1505586621@sss.pgh.pa.us> <20170916183849.kgqlyi3q2oy4qjkx@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sat, 16 Sep 2017 11:38:49 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27203.1505591941.1@sss.pgh.pa.us> Date: Sat, 16 Sep 2017 15:59:01 -0400 Message-ID: <27204.1505591941@sss.pgh.pa.us> 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 Andres Freund writes: > On 2017-09-16 14:30:21 -0400, Tom Lane wrote: >> I wonder whether we shouldn't just revert this patch altogether. > The problem is that the patch that makes the segment size configurable > also adds a bunch more ordering constraints due to the fact that the > contents of the control file influence how much shared buffers are > needed (via wal_buffers = -1, which requires the segment size, which is > read from the control file). Reading things in the wrong order leads to > bad results too. Maybe we could redefine wal_buffers to avoid that. Or read the control file at the time where we need it. This does not seem like a problem that justifies a system-wide change that's much more delicate than you thought. >> I'm now quite worried about whether we aren't introducing >> hazards of using stale values from the file; if a system crash isn't >> enough to get it to flush its cache, then what is? > I don't think the problem here is stale values, it's "just" a stale > pointer pointing into shared memory that gets reiniitalized? The code that's crashing is attempting to install some pre-existing copy of pg_control into shared memory. Even if there were good reason to think the copy were up to date, I'm not sure we should trust it in a crash recovery context. I'd rather see this hunk of code just playing dumb and reading the file (which, I'm pretty sure, is what it did up till this week). regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers