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 1lKb36-00081V-1U for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Mar 2021 06:13:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lKb34-0001hA-Tg for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Mar 2021 06:13:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKb34-0001eI-MI for pgsql-hackers@lists.postgresql.org; Fri, 12 Mar 2021 06:13:22 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKb32-000533-FQ for pgsql-hackers@lists.postgresql.org; Fri, 12 Mar 2021 06:13:21 +0000 Received: from hnk.local (p1439104-ipngn8101funabasi.chiba.ocn.ne.jp [180.0.143.104]) by oss.nttdata.com (Postfix) with ESMTPSA id 06BB462600; Fri, 12 Mar 2021 15:13:15 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: shared-memory based stats collector To: Kyotaro Horiguchi Cc: andres@anarazel.de, gkokolatos@protonmail.com, pgsql-hackers@lists.postgresql.org References: <20210312.092312.2023783779833776888.horikyota.ntt@gmail.com> <20210312.103800.78346667971630881.horikyota.ntt@gmail.com> <20210312.134906.647243209921851496.horikyota.ntt@gmail.com> From: Fujii Masao Message-ID: <7e633694-5702-e982-6c3f-0226189c8b41@oss.nttdata.com> Date: Fri, 12 Mar 2021 15:13:15 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210312.134906.647243209921851496.horikyota.ntt@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/03/12 13:49, Kyotaro Horiguchi wrote: > At Fri, 12 Mar 2021 10:38:00 +0900 (JST), Kyotaro Horiguchi wrote in >> At Fri, 12 Mar 2021 10:03:31 +0900, Fujii Masao wrote in >>>> I moved archiver from the current location to next to "walsenders" >>>> that is to be terminated along with archiver. >>>> The attached the only 0003 of the new version based on the last one >>>> from Fujii-san. >>> >>> Thanks for updating the patch! But you forgot to add the changes >>> related to pgprocno into the patch? >> >> Although I intentinally didn't do that because "it really doesn't >> matter", please wait for a while for the new version. I'm going to >> make PgArchData have only one member procno instead of replacing the >> struct with a single variable. > > I noticed that I accidentally removed the launch-suppression feature > that is to avoid frequent relaunching. That mechanism is needed on > the postmaster side. I added PgArchIsSuppressed() to do the same check > with the old pgarch_start() and make it called as a part of > PgArchStartupAllowed(). You're right! At least for me the function name PgArchIsSuppressed() sounds not good to me. What about something like PgArchCanRestart()? This is not fault of this patch. But last_pgarch_start_time should be initialized with zero? + if ((curtime - last_pgarch_start_time) < PGARCH_RESTART_INTERVAL) + return true; Why did you remove the cast to unsigned int there? + /* + * Advertise our latch that backends can use to wake us up while we're + * sleeping. + */ + PgArch->pgprocno = MyProc->pgprocno; The comment should be updated? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION