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 1lCkP4-0004Im-VD for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Feb 2021 14:35:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lCkP3-0004GT-UM for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Feb 2021 14:35:37 +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 1lCkLv-000794-50 for pgsql-hackers@lists.postgresql.org; Thu, 18 Feb 2021 14:32:23 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCkLt-0001hj-4R for pgsql-hackers@postgresql.org; Thu, 18 Feb 2021 14:32:22 +0000 Received: from hnk.local (p2710230-ipbf1703funabasi.chiba.ocn.ne.jp [123.216.93.230]) by oss.nttdata.com (Postfix) with ESMTPSA id 106D760605; Thu, 18 Feb 2021 23:32:17 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: ERROR: invalid spinlock number: 0 To: Michael Paquier Cc: Andres Freund , Thomas Munro , pgsql-hackers References: <7ef8708c-5b6b-edd3-2cf2-7783f1c7c175@oss.nttdata.com> <79698f73-7dd7-d9e3-5322-4032b4428653@oss.nttdata.com> <20210215212805.dfahbpqqpnl6lgwm@alap3.anarazel.de> <918a47fc-e1fa-0c99-15e3-59b520455fe0@oss.nttdata.com> From: Fujii Masao Message-ID: Date: Thu, 18 Feb 2021 23:32:16 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: 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: Precedence: bulk On 2021/02/17 13:52, Michael Paquier wrote: > On Tue, Feb 16, 2021 at 11:47:52PM +0900, Fujii Masao wrote: >> On 2021/02/16 15:50, Michael Paquier wrote: >>> + /* >>> + * Read "writtenUpto" without holding a spinlock. So it may not be >>> + * consistent with other WAL receiver's shared variables protected by a >>> + * spinlock. This is OK because that variable is used only for >>> + * informational purpose and should not be used for data integrity checks. >>> + */ >>> What about the following? >>> "Read "writtenUpto" without holding a spinlock. Note that it may not >>> be consistent with the other shared variables of the WAL receiver >>> protected by a spinlock, but this should not be used for data >>> integrity checks." >> >> Sounds good. Attached is the updated version of the patch. > > Thanks, looks good to me. Pushed. Thanks! > >>> I agree that what has been done with MyProc->waitStart in 46d6e5f is >>> not safe, and that initialization should happen once at postmaster >>> startup, with a write(0) when starting the backend. There are two of >>> them in proc.c, one in twophase.c. Do you mind if I add an open item >>> for this one? >> >> Yeah, please feel free to do that! BTW, I already posted the patch >> addressing that issue, at [1]. > > Okay, item added with a link to the original thread. Thanks! Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION