Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVvWO-0001oW-RX for pgsql-general@arkaria.postgresql.org; Tue, 05 May 2020 11:13:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jVvVr-0005Tm-V6 for pgsql-general@arkaria.postgresql.org; Tue, 05 May 2020 11:13:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVvVr-0005Tf-NV for pgsql-general@lists.postgresql.org; Tue, 05 May 2020 11:13:23 +0000 Received: from uucp.dinoex.org ([2a0b:f840::12]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVvVo-0003qW-S8 for pgsql-general@lists.postgresql.org; Tue, 05 May 2020 11:13:23 +0000 Received: from uucp.dinoex.sub.de (uucp.dinoex.org [185.220.148.12]) by uucp.dinoex.org (8.16.0.45/8.16.0.41) with ESMTPS id 045BD4iQ051961 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 5 May 2020 13:13:05 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) X-Authentication-Warning: uucp.dinoex.sub.de: Host uucp.dinoex.org [185.220.148.12] claimed to be uucp.dinoex.sub.de Received: (from uucp@localhost) by uucp.dinoex.sub.de (8.16.0.45/8.16.0.41/Submit) with UUCP id 045BD46K051960; Tue, 5 May 2020 13:13:04 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by citylink.dinoex.sub.de (8.15.2/8.15.2) with ESMTP id 045AjDsh034583; Tue, 5 May 2020 12:45:13 +0200 (CEST) (envelope-from peter@gate.oper.dinoex.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by gate.oper.dinoex.org (8.15.2/8.15.2) with ESMTP id 045Aj7CX034555; Tue, 5 May 2020 12:45:08 +0200 (CEST) (envelope-from peter@gate.oper.dinoex.org) Received: (from peter@localhost) by gate.oper.dinoex.org (8.15.2/8.15.2/Submit) id 045Aj7F5034554; Tue, 5 May 2020 12:45:07 +0200 (CEST) (envelope-from peter) Date: Tue, 5 May 2020 12:45:07 +0200 From: Peter To: Thomas Munro Cc: Adrian Klaver , "pgsql-generallists.postgresql.org" Subject: Re: 12.2: Howto check memory-leak in worker? Message-ID: <20200505104507.GA32455@gate.oper.dinoex.org> References: <20200504115649.GA77072@gate.oper.dinoex.org> <639a25fc-772e-1694-b249-12d686192a85@aklaver.com> <20200504220132.GA67933@gate.oper.dinoex.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Milter: Spamilter (Reciever: uucp.dinoex.sub.de; Sender-ip: 185.220.148.12; Sender-helo: uucp.dinoex.sub.de;) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (uucp.dinoex.org [185.220.148.12]); Tue, 05 May 2020 13:13:08 +0200 (CEST) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, May 05, 2020 at 10:57:04AM +1200, Thomas Munro wrote: ! On Tue, May 5, 2020 at 10:13 AM Peter wrote: ! > BTW, I would greatly appreciate if we would reconsider the need for ! > the server to read the postmaster.pid file every few seconds (probably ! > needed for something, I don't know). ! > That makes it necessary to set atime=off to get a spindown, and I ! > usually prefer to have atime=on so I can see what my stuff is ! > currently doing. ! ! That'd be this: ! ! /* ! * Once a minute, verify that postmaster.pid hasn't been removed or ! * overwritten. If it has, we force a shutdown. This avoids having ! * postmasters and child processes hanging around after their database ! * is gone, and maybe causing problems if a new database cluster is ! * created in the same place. It also provides some protection ! * against a DBA foolishly removing postmaster.pid and manually ! * starting a new postmaster. Data corruption is likely to ensue from ! * that anyway, but we can minimize the damage by aborting ASAP. ! */ ! if (now - last_lockfile_recheck_time >= 1 * SECS_PER_MINUTE) ! { ! if (!RecheckDataDirLockFile()) Ah. Yes. Thanks for identifying this issue. It is really hard to comment on this in a way that might not be considered offensive, so lets put it that way: You all have seen the Apollo-13 movie, so You know that a need to power-down as much as possible may appear en-route, and in a situation where you have lots of other issues, so what you need the least is things like this getting in your way. I usually take this a bit further and consider only two relevant quality levels for software: interplanetary and interstellar - where i.p. is the kind of stuff on which we will trust our lives during the manned Jupiter mission. PG might well qualify for this, except with things like the quoted; so I think such should be tagged with appropriate compile-time switches. Now concerning the memory leak: That one was introduced with the work done on the GSSAPI encryption; it goes away when setting 'hostnogssenc' in pg_hba. (And, whoever has editor rights, there is also a little fixup needed for that switch in pg_hba.conf; it should probably be "eleven formats".) cheerio, PMc