Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uZ6uS-00GG42-Pv for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Jul 2025 11:54:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uZ6uQ-007OBp-Rz for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Jul 2025 11:54:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uZ6uQ-007OBg-IT for pgsql-hackers@lists.postgresql.org; Tue, 08 Jul 2025 11:54:51 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uZ6uP-006Rl1-0r for pgsql-hackers@lists.postgresql.org; Tue, 08 Jul 2025 11:54:50 +0000 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-74b52bf417cso2718761b3a.0 for ; Tue, 08 Jul 2025 04:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751975687; x=1752580487; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0B8hqCc0meXo31WWeNmFKoZ69AQVWl51uRDyDqTvaak=; b=Hj28QJxp9G60zMERCoBKS21X8gGgI3hqE29OavxSRJl9QWiSB+D9EBCed7+PuF5DZD g7J+ifuYGOWe195XE0J2vyt1VLjryeOyjE7caVV7WWoT3nypy2cZIHSwuvf6JL9J4y1I x15Lek9SoM+WUlEqDQQKrkUYxzgV6A9iHMjqXFlNV3IIw48B03c0QUYLFNxdNKVEXN3U RC0tXRsuXWmIuc7Fbe8POJsK7iCPwCEu8LyyJA9MlVCjtmBXm/pTjED1TychfHarwp1U 5au01HmJ8W4T+Mjk26mzeV2ewBsGaoYy6efpMvcDLHNo8A+0AmPh1+2X6XtsCymfHA1O n6GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751975687; x=1752580487; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0B8hqCc0meXo31WWeNmFKoZ69AQVWl51uRDyDqTvaak=; b=abczHv+kkLuaoiGZnmSDyQoBtDNiMlXYqrim+ClORi/sKYbx15IbywxZSMVvKgpkqA 20z3TsQgl0l2GBlGU8+cPk5Gc25uqdnUBbMwk2SAWjMoY5OUtXBZRlci9CBsO5hFvVqx tz5cSZxjTk0b/R+yx7vg6vmKEw/Vg73/0v17zK1bYbENlq050vwLpcX6FjJ1vMp8c8LY JMnnI+rQ43npN0wKIjzEXKjFMy/70Czb1+07Ef66NUoyMsMtbudtkrYc7Eyadi0ZpIU9 hULF4rpE0GMSzm9ZrBdFHloTF0ddGaXSnbiZFJ004uQdLu+lharWa8wnOL+3ql79/Bws pIpQ== X-Forwarded-Encrypted: i=1; AJvYcCW+5pIFaA6rZYw5i2oMputYg9XZ3PbgRZaSXNGInu6y1R7lUv8MF/a35CB8mxrttDo3JUVZU2zYMg7JCaGz@lists.postgresql.org X-Gm-Message-State: AOJu0YwBB0wx/+W/2KsWfqhhmVibVoLnKZLC2jkVLhOkpGm9KSDe5m9i hRgv+9aCa3C4sIKPDtmnob705kMW/jycFTpT4zsyzwMozS2IVVdr/KqFjVv+avlHsOg2iJFSXsE 6g3x1mCimRA3HPPTPtMfg6T14IFDBIrM= X-Gm-Gg: ASbGncvJ1nMxtz+S9KF9xijhnYdAqdmkFyPCY+Zx4H03pjH13lZajnDxLPLSlRzcC9q 2mOcwEYWVxOnIj2Img+UVOH2JxhnURt4eMs+MvJcM0PvUn/3OFGl7R4k0JGZrGCD16k8N3z1L+0 WoWqMAYsg8X+nrULUgvJh9q6X7em0S+V/QI2ksz/Q1LrSSIA== X-Google-Smtp-Source: AGHT+IE5IVcGNZqPxAFfxVKC03oe8UD3NF7iSCkeQz/fCV4psmAmRkxIn79tF0XpYTLiNCeblrQurOYB7J4e1OMlULc= X-Received: by 2002:a05:6a00:929e:b0:742:8d52:62f1 with SMTP id d2e1a72fcca58-74ce6419a9emr27342466b3a.8.1751975686849; Tue, 08 Jul 2025 04:54:46 -0700 (PDT) MIME-Version: 1.0 References: <20231102.115834.1012152975995247837.horikyota.ntt@gmail.com> <202311091039.of6jf7bs3cjd@alvherre.pgsql> <219561.1751826409@sss.pgh.pa.us> <436599.1751910776@sss.pgh.pa.us> In-Reply-To: From: Amit Kapila Date: Tue, 8 Jul 2025 17:24:33 +0530 X-Gm-Features: Ac12FXyx7c64QZRF9j1JHcUvvbsmbIh23zJ-kYbIUn4NlqB94kTrhtHTPVQniZc Message-ID: Subject: Re: A recent message added to pg_upgade To: Dilip Kumar Cc: Tom Lane , Alvaro Herrera , Kyotaro Horiguchi , smithpb2250@gmail.com, bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jul 8, 2025 at 4:49=E2=80=AFPM Dilip Kumar = wrote: > > On Tue, Jul 8, 2025 at 2:29=E2=80=AFPM Amit Kapila wrote: > > > > On Tue, Jul 8, 2025 at 11:32=E2=80=AFAM Dilip Kumar wrote: > > > > > > On Mon, Jul 7, 2025 at 11:22=E2=80=AFPM Tom Lane = wrote: > > > > > > > > > > > There's a bigger picture here, though. The fundamental thing that > > > > I find wrong with the current code is that knowledge of and > > > > responsibility for this max_slot_wal_keep_size hack is spread acros= s > > > > both pg_upgrade and the server. It would be better if it were on > > > > just one side. Now, unless we want to change that Assert that > > > > 8bfb231b4 put into InvalidatePossiblyObsoleteSlot(), the server sid= e > > > > is going to be aware of this decision. So I'm inclined to think > > > > that we should silently enforce max_slot_wal_keep_size =3D -1 in > > > > binary-upgrade mode in the server's GUC check hook, and then remove > > > > knowledge of it from pg_upgrade altogether. Maybe the same for > > > > idle_replication_slot_timeout, which really has got the same issue > > > > that we don't want users overriding that choice. > > > > > > Yeah this change makes sense, > > > > > > > Agreed. > > > > One other idea to achieve similar functionality is that during > > BinaryUpgrade, avoid removing WAL due to max_slot_wal_keep_size, and > > also skip InvalidateObsoleteReplicationSlots. The one advantage of > > such a change is that after this, we can remove Assert in > > InvalidatePossiblyObsoleteSlot, remove check_hook functions for GUCs > > max_slot_wal_keep_size and idle_replication_slot_timeout, and remove > > special settings for these GUCs in pg_upgrade. > > Yeah that could also be possible, not sure which one is better though, > with this idea we will have to put BinaryUpgrade check in KeepLogSeg() > as well as in InvalidateObsoleteReplicationSlots() whereas forcing the > GUC to be -1 during binary upgrade we just need check at one place. > But OTOH, as mentioned, we can remove all other codes like check_hooks and probably assert as well. --=20 With Regards, Amit Kapila.