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 1kaIfh-0001IY-Ns for pgsql-committers@arkaria.postgresql.org; Wed, 04 Nov 2020 13:17:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kaIfg-00041d-IX for pgsql-committers@arkaria.postgresql.org; Wed, 04 Nov 2020 13:17:52 +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 1kaIfg-00041W-9N for pgsql-committers@lists.postgresql.org; Wed, 04 Nov 2020 13:17:52 +0000 Received: from meesny.iki.fi ([2001:67c:2b0:1c1::201]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kaIfc-0007sS-9P for pgsql-committers@lists.postgresql.org; Wed, 04 Nov 2020 13:17:51 +0000 Received: from [192.168.1.113] (dsl-hkibng22-54faa4-119.dhcp.inet.fi [84.250.164.119]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id E3DC7202C5; Wed, 4 Nov 2020 15:17:41 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1604495862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yJdEpr7VfYDOuWHDd5+3zcsChHkKsZBeH665d32KhZM=; b=LKLQDeF4EkJfbjIo1+k0FcPUkvfyEu+YF1a7wCGDmuKsF3KkGkwdojsO8IFMrozTVsi4co AJEpwG2C2fML9bvZS/HrfL/y+Z++d7NOj5iaiy/FcqvlqqlEy9hBpJFNe8sWEkCvqQeEOi HpRagdjj5l5tAu/g7Krf0J4WGtAc92M= Subject: Re: pgsql: Get rid of the dedicated latch for signaling the startup process To: Fujii Masao , Fujii Masao , pgsql-committers@lists.postgresql.org References: <5c1f8a85-747c-7bf9-241e-dd467d8a3586@iki.fi> From: Heikki Linnakangas Message-ID: Date: Wed, 4 Nov 2020 15:17:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1604495861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yJdEpr7VfYDOuWHDd5+3zcsChHkKsZBeH665d32KhZM=; b=EbYsACCFF5G9CUHvsnC420LtTYDwOkBd7BVdY7TSpKRuyw9GDKksWxEThiyE8yXyqlx5Gv nSQQYETBslMMC/ZI+KXnLCTeMoHlfb6/3gRedH7B9pznRVimENzOQdh/GEsZWEOn9VJGjs oiI9k1TxUyNvNJZfGx6XbVyGAoEvlvQ= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1604495862; a=rsa-sha256; cv=none; b=ApQM1P2u08dlzR4GqWCUnqYQDAUC4ZIOAqB7yGOR1K18huPk+1k8+WrCD2C0QKRxWz9JHC 5XaC623RVTOUhXIFuAbh2Ef+LUbA/aOoyagUmxviZcxCSXg8YgsYHqKnNJlZEbSFL7VVGD lrKQZHtwygUpAK9GaFaAWN3/tGS9a60= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/11/2020 14:03, Fujii Masao wrote: >> I'm thinking to remove the following code to fix this issue. Thought? >> >>     /* >>      * We don't need the latch anymore. It's not strictly necessary to reset >>      * it to NULL, but let's do it for the sake of tidiness. >>      */ >>     if (ArchiveRecoveryRequested) >>         XLogCtl->recoveryWakeupLatch = NULL; That should work, but it seems a bit sloppy to leave it pointing to a latch that belongs to a random process though. > Or ISTM that WakeupRecovery() should set the latch only when the latch > has not been reset to NULL yet. Got to be careful with race conditions, if the latch is set to NULL at the same time that WakeupRecovery() is called. - Heikki