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 1okMBW-0001xQ-PQ for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Oct 2022 09:13:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1okMBU-0000rx-LU for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Oct 2022 09:13:20 +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 1okMBU-0000rj-Bu for pgsql-bugs@lists.postgresql.org; Mon, 17 Oct 2022 09:13:20 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1okMBO-0006fb-S6 for pgsql-bugs@postgresql.org; Mon, 17 Oct 2022 09:13:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rCApw2XN3buOz3zdKnga73arEeHuyUg4dsuin4MhM6o=; b=gqYJRMZVTe9DBg3qQD4Yr3+F/9 QK9/pv32/9bwoOLPAibw+O3jBwYdPcYVqwJVNua+UZpDaM1xbZvmesdvBdVBxCbBK9zO4WBkzq6yk GN/L8HvJfZAVl3alkWxmVPKSng0rR1MCjouyhdwYUiiwN7I27L03Fa+KPLf2eZgHb8TQ=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1okMBL-00BUYF-Qt; Mon, 17 Oct 2022 11:13:11 +0200 Date: Mon, 17 Oct 2022 11:13:11 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Amit Kapila Cc: pgsql-bugs mailing list Subject: Re: WAL segments removed from primary despite the fact that logical replication slot needs it. Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Oct 16, 2022 at 10:35:17AM +0530, Amit Kapila wrote: > > Wal file has been removed. Please note that the file was, as shown earlier, still within "restart_lsn" as visibile on pg12/bionic. > This is quite strange and I am not able to see the reason why this can > happen. The only way to debug this problem that comes to mind is to > add more LOGS around the code that removes the WAL files. For example, > we can try to print the value of minimumslotLSN (keep) and logSegNo in > KeepLogSeg(). That would require changing pg sources, I think, recompiling, and retrying? And on the pg12 side? I don't think we can do it, but I'll ask boss. > > Anyone has any idea on how to investigate/fix that? > As suggested above, I feel we need to add some LOGS to see what is > going on unless you have a reproducible testcase. The problem is that we were trying to use this approach to upgrade pg12 production db to pg14. Modifying it (pg12) will be tricky, as it would require restart. Unless there is a way to add extra logging without restart... depesz