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 1ps9T2-0002oM-9b for pgsql-bugs@arkaria.postgresql.org; Thu, 27 Apr 2023 21:47:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ps9T0-00084E-Rf for pgsql-bugs@arkaria.postgresql.org; Thu, 27 Apr 2023 21:47:54 +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 1ps9T0-000845-JW for pgsql-bugs@lists.postgresql.org; Thu, 27 Apr 2023 21:47:54 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ps9Sx-005SBx-H9 for pgsql-bugs@lists.postgresql.org; Thu, 27 Apr 2023 21:47:54 +0000 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-63b50a02bffso7326521b3a.2 for ; Thu, 27 Apr 2023 14:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682632069; x=1685224069; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CdSScbn+CFmQp1ePMgz+rs7HZ8b0JD+acpYWd97/SFA=; b=Cj/rRrt3704z5jOGxshJFyuc5/gtCV+p/d+Cv5YD2BJdmX4Ye5vpRHldQ6GnirSup8 wElBCaqAn/oAGo6rA6zQOyw1eeCilHryZhohMh6f8H6IdbtNI9rBiwoBEQDtR1QkRaoR ukr3A+rKgB6D6jtUyMwrmGB5yZxVqunJ0oGK4gGK8N7wEs1++qK6sctC9ZjvpF3R8fCQ xSPOvBhYqUM/ZjtyrhgFp5hS04cmaX+s3mgc0TFda0rcQ4OutsSzwQKiGZdnZo/YEA6m iyB+OfHl/l6wdFLX/C90TA85Wv5drXRIuyRCURblITMJhJExHr6bzY3v51nzGEi6W+1H L2nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682632069; x=1685224069; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CdSScbn+CFmQp1ePMgz+rs7HZ8b0JD+acpYWd97/SFA=; b=dWqasBOVdAGuYoMU29S8c88FJcMcRYCw1wG99K3Ixd7G/H/mxMdaxt/OtiP9dvPg3S iaFOOQM/aAvTAXUNpEibD7WMNXHQdF20Y3o1Os/2Qxx/ovSn/mubqpmE+niPskpi3u7w EQkeTMljRjTXzvlfqcs17l3VMdkf5lpOcA8eP85s9QgN6p6/VWTx5+Pf193P9o6gzxmj YDdplVGud8NxCNb6bIUscTtKSQi826V4XSIKhKPCzEvYPh8qMUNtk6ucM3Fvij8qMjj2 rzdvcY6M7hPM2m7wWIC9iVpHNw7Qk0lEIQrBpePc81XtYzBVApAHQG1rL/jRKG2Tn2va tG+A== X-Gm-Message-State: AC+VfDwj6PbySvyKWzNbNl+vjbB/N+uXdOi6/hP9gqSNjF/Qo+mNkBip fC1qzpFXGNMPp+o3ccTNbuQ= X-Google-Smtp-Source: ACHHUZ6cLywEqiM5nPucHwn1OW3FVzE/Ca/UQmmBMgSLqQwHChv1omYiAuvbKJ5rAsi5ft7jA0QukA== X-Received: by 2002:a05:6a00:248c:b0:623:c117:f20e with SMTP id c12-20020a056a00248c00b00623c117f20emr4554990pfv.19.1682632068969; Thu, 27 Apr 2023 14:47:48 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id p2-20020a62b802000000b0063b8d21be5asm12607110pfe.147.2023.04.27.14.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 14:47:48 -0700 (PDT) Date: Thu, 27 Apr 2023 14:47:46 -0700 From: Nathan Bossart To: Kyotaro Horiguchi Cc: zhjwpku@gmail.com, xu.xw2008@163.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17903: There is a bug in the KeepLogSeg() Message-ID: <20230427214746.GA1986346@nathanxps13> References: <20230421.104231.1594652765237022266.horikyota.ntt@gmail.com> <20230421214347.GA1441786@nathanxps13> <20230424191452.GA1698829@nathanxps13> <20230425.131452.517547289278432754.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230425.131452.517547289278432754.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 25, 2023 at 01:14:52PM +0900, Kyotaro Horiguchi wrote: > At Mon, 24 Apr 2023 12:14:52 -0700, Nathan Bossart wrote in >> When determining the oldest segment that must be kept for >> replication slots, KeepLogSeg() might calculate a segment number >> ahead of the one for the LSN given to the function. This causes > > Maybe the KeepLogSeg() is a mistake of > XLogGetReplicationSlotMinimumLSN()? I adjusted the commit message to call out that function explicitly. Also, I decided to go with the "keep < recptr" approach since there's no reason to do anything in that block otherwise. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com