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 1jr7RO-00023B-P6 for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2020 22:12:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jr7RN-0008Kx-1o for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2020 22:12:21 +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 1jr7RM-0008Kq-Fa for pgsql-hackers@lists.postgresql.org; Thu, 02 Jul 2020 22:12:20 +0000 Received: from mail.dalibo.com ([212.85.157.172]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jr7RF-0006up-S9 for pgsql-hackers@lists.postgresql.org; Thu, 02 Jul 2020 22:12:19 +0000 Received: from firost (larco.ioguix.net [82.66.0.6]) by mail.dalibo.com (Postfix) with ESMTPSA id 838C82289A; Fri, 3 Jul 2020 00:12:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1593727931; bh=fGriOv8vXac6kosc0wRKfnwbQUczacs+Mk2yj6T6v5M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RcwmN9acEL+lfKewQAwOL5PFQL5rfXjCJN1s5y8+6qDMS88FmsPyCna0r9WUcBDJd U3HvKPHbMMVYcyrgKNPhC1Ewp33k2e41Q3mUYO3nM+DCp9mrMqlNhiFF7lgShS6afF CEfiw+WKRQpI7AsLYnZgWFR0H0orjXu55oMPDVo8= Date: Fri, 3 Jul 2020 00:12:10 +0200 From: Jehan-Guillaume de Rorthais To: pgsql-hackers@lists.postgresql.org Cc: Robert Haas , Tom Lane , Andres Freund , Fujii Masao Subject: Re: [patch] demote Message-ID: <20200703001210.7897b1a9@firost> In-Reply-To: <20200625192754.3e105cfc@firost> References: <20200617174451.222078b4@firost> <20200625192754.3e105cfc@firost> Organization: Dalibo MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, Here is a small activity summary since last report. On Thu, 25 Jun 2020 19:27:54 +0200 Jehan-Guillaume de Rorthais wrote: [...] > I hadn't time to investigate Robert's concern about shared memory for snapshot > during recovery. I hadn't time to dig very far, but I suppose this might be related to the comment in ProcArrayShmemSize(). If I'm right, then it seems the space is already allocated as long as hot_standby is enabled. I realize it doesn't means we are on the safe side of the fence though. I still have to have a better understanding on this. > The patch doesn't deal with prepared xact yet. Testing > "start->demote->promote" raise an assert if some prepared xact exist. I > suppose I will rollback them during demote in next patch version. Rollback all prepared transaction on demote seems easy. However, I realized there's no point to cancel them. After the demote action, they might still be committed later on a promoted instance. I am currently trying to clean shared memory for existing prepared transaction so they are handled by the startup process during recovery. I've been able to clean TwoPhaseState and the ProcArray. I'm now in the process to clean remaining prepared xact locks. Regards,