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 1kDyfq-0000f8-5W for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2020 23:29:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDyfn-0002Vu-HN for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2020 23:29:43 +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 1kDyfn-0002Vm-6e for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2020 23:29:43 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDyfi-00044H-NO for pgsql-hackers@lists.postgresql.org; Thu, 03 Sep 2020 23:29:42 +0000 Received: from [192.168.1.64] (109-252-84-101.nat.spd-mgts.ru [109.252.84.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 2BFA221C335B; Fri, 4 Sep 2020 02:29:37 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1599175777; bh=e6tO82kadmTsSQffAFqD+F+c7PO5p14GOO8BVh2xNg0=; h=Subject:To:References:From:Date:In-Reply-To; b=ZpqtvfzqaIE3eJKXIOoTJIfwUIDqQE2YKa6oLWKuE47B7+9cJT/+aQs0EbN0QSe+h cFyd27VTxKmlERc+LTEleMiCFqPMDI1ViS+ZIuNSFr7ILv0mfplKbuPa7JF9o9wcyH sYrjQclDBNXzBUNm/6s5rlZ6ouYJo7yKoXQrd1vA= Subject: Re: history file on replica and double switchover To: Grigory Smolkin , Postgres hackers References: <54b059d4-2b48-13a4-6f43-95a087c92367@postgrespro.ru> From: Anastasia Lubennikova Message-ID: Date: Fri, 4 Sep 2020 02:29:36 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <54b059d4-2b48-13a4-6f43-95a087c92367@postgrespro.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 27.08.2020 16:02, Grigory Smolkin wrote: > Hello! > > I`ve noticed, that when running switchover replica to master and back > to replica, new history file is streamed to replica, but not archived, > which is not great, because it breaks PITR if archiving is running on > replica. The fix looks trivial. > Bash script to reproduce the problem and patch are attached. > Thanks for the report. I agree that it looks like a bug. For some reason, patch failed to apply on current master, even though I don't see any difference in the code. I'll attach this thread to the next commitfest, so it doesn't get lost. -- Anastasia Lubennikova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company