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 1ovhEt-0000F3-D2 for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Nov 2022 15:55:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovhEs-0001MO-71 for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Nov 2022 15:55:42 +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 1ovhEr-0001M8-J0 for pgsql-bugs@lists.postgresql.org; Thu, 17 Nov 2022 15:55:41 +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 1ovhEo-0007ze-IN for pgsql-bugs@postgresql.org; Thu, 17 Nov 2022 15:55:40 +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=vohBZaARSBtmKDeUl7iGRplV98eem6bXorNfKKiyVGU=; b=N/s2mCJoaRZQIF9DkS4bBRPuAK Bc/IA4PLtsIq6R24LIDwdIBtqCoBiSsRbiyfFoIYnE3q0nNBOQXJCqS4leG7JikFeB48xLwsF4XsY TSZxJ076QJMLXW7Y7TDmbERdUpZ9222Ay/lu2m8ewVGnKoCSmhSTjaUFrsLGx2f2d2oc=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1ovhEk-00DINN-At; Thu, 17 Nov 2022 16:55:34 +0100 Date: Thu, 17 Nov 2022 16:55:34 +0100 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 Mon, Nov 14, 2022 at 05:08:15PM +0530, Amit Kapila wrote: > You may have the LOG for "attempting to remove WAL segments older than > log file %s", if so, please share. Also on similar lines, I think we > need to add some LOGs before calling RemoveOldXlogFiles() to know > where our computation to remove files goes off. Something, like the > attached, would be helpful but note I have added this quickly on my > working branch to show you what I have in mind. You may need small > changes based on the branch you are working on. Hi, I tried to apply it on pg12.12, both clean from https://www.postgresql.org/ftp/source/v12.12/ and one that is being built for pgdg .deb for 12.12, and in both cases it failed. Current state of xlog.c from the deb building (which is what I have to build) is available at https://depesz.com/various/xlog.c.xz I don't trust myself with modifing patches in C - any chance I could ask you to check why it doesn't apply, and possibly make new one that applies on pg12? I tried to see what is going on there, but you have in patch lines that I don't see in my version of xlog.c, so I'm not sure what to do with it. The procedure I followed to get this xlog.c in this form was: dget -x https://apt-archive.postgresql.org/pub/repos/apt/pool/main/p/postgresql-12/postgresql-12_12.1-2.pgdg100%2B1.dsc dpkg-source -x postgresql-12_12.1-2.pgdg100%2B1.dsc cd postgresql-12-12.1/ sudo apt build-dep . quilt push -a and I think that was it. Best regards, depesz