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.96) (envelope-from ) id 1vxqJS-00HBew-1Q for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Mar 2026 17:47:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxqJO-00DnlC-2f for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Mar 2026 17:47:07 +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.96) (envelope-from ) id 1vxqJO-00Dnl3-1a for pgsql-hackers@lists.postgresql.org; Wed, 04 Mar 2026 17:47:07 +0000 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vxqJM-00000000ZVy-1gzi for pgsql-hackers@postgresql.org; Wed, 04 Mar 2026 17:47:06 +0000 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-40974bf7781so1547786fac.0 for ; Wed, 04 Mar 2026 09:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772646422; cv=none; d=google.com; s=arc-20240605; b=UcoE1l+QsjFLmGXcj07B8nAmf3GdO77ayEvpi9pm96aZZIbX2UVfXCAPoR3t+WP4U5 eKdp3mQbYwy5NOGz5l2K5+K9BMsG1z3AcRGD7Wj3md5eMXIh9xo1Wh+MjCafkRTsaDPv 6xPAPeRaW6bP2RVqt/sxxbMftl+KuPABBBEtEYATjACYr+NpMMJql16psOBj7NHQASDo hlV2eXYWqNxt7mrE2HUldSNbiJFL4MUJNUGeECOQJ1JQMOyjMotNu5fmBx6FNBSBqZfS o5Au7SOAorDagh+SWsgLRAWXMDSuHXGeM3VHfOG9NJjtm7AqBCw5WfrXfJYCS86czU47 hREw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HwfkQF5O+23ZrqFLbXAeO5JiUmTpKzfv4N/MkoyTFXU=; fh=hFSd27pZZP9j+6/iWOCgUsnN/QC7v2q9PbPGLaEfbyk=; b=XZ4nDUtNG3KMsxS1E8ED8ovRyj15SRrTRCaVu7LsgP9L5TxHp3juWuS8hB84mm3wax L/i2iF67boAu6PUsOtqMBfEgbCTthRsJ6Z1RH6TlOGUkVJFSRga6A33aUacugwZjHOik pHn3aCZ32j2T9rR+YIfXdYeZfAXH/+K4HU5zdw6aAZ0DOFdnDicGyxlT9c/J9UdvPdNp /sm8Jd50wv28ZSBoYw3vJAniQreiijU+KK09sd7fqJaT/nzVKyOR42xKV+xjQLQSWP57 sjYddf+YtG48Wt0tDiXycKkfiqnCxb3ph17xBcg1KG3eSa9Hc1JkgrX00rJ+oE32a3Ba MIaA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772646422; x=1773251222; darn=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=HwfkQF5O+23ZrqFLbXAeO5JiUmTpKzfv4N/MkoyTFXU=; b=Ot+49Xmvy6PsuTNYsLmevm+0Xx34hWNfUvcPVkHk22uky/DkELSlLe+SHSiTM/7qAP nC1wly1s/PK8mfrFBzU2IeC2nXcgUD6370/WP3B+4uhCecvbXnAXOvVCFTFmThb1t5QS TTWqrg1h5aEt6brJe9QVBKGSw9ijJolN3Z8GgFTwooozTEYwlD9oPLwySHyY1rDHj6OK GyP5yKj65Kg1juBYYP6/iQ0JwgvH2u1xXltcToyYcEp+TylxWBMU/ZdWcJyE7rjXqaOb e1MKiE7M7Fp6oZxttMuPWgyS/pOpBR3y11bS9/9T/D9IounZ8gbAN/gow2FZfV1wncMD wBRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772646422; x=1773251222; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HwfkQF5O+23ZrqFLbXAeO5JiUmTpKzfv4N/MkoyTFXU=; b=UWxIu8tDzGjy8+FC5508SRhxg3tHBVm/lK6E1viE9KTH1fUW+IzAAepaqoT3GlbOQ5 pRNyhWPpFt4hVf4H9OlUXj3HqVhBsCO6oFPJRnbW2ppwHfpRK4l/D4fT4T37F54QSuci 15HhtNpwtrsWaqOiKcmblGF0BPYbmlXghu3RfBa/OfVtUQnarUeVq0Ke7le4Qkqj3s4q 04ZsgWBJK36wFxihgtYnsnHclYKZQ/94xRCe+WD56xgwEOLyHIOOsatNPvAtNbWMtsql 2am2YZIYysl71Ic7s27CLUjOPHtgt6HYjim5+bjHBO0QZgiktgqKkYHCt+IbI0Rc/jOl UlVw== X-Gm-Message-State: AOJu0YwVX3BTKzcT+kDRETvWss9OM3zaOoNGNjuXkEOFj7U3Ie5k/dZ9 vxlzV4JIxImSRyc9PKvigvvdM3C5K79S0EJjDy1HfB4kH3pE1MuVUvLmBJrh3iMcXKxFMZzFV/r UI0aye0bhwhin2yPdpthahOdC75zV2Sc6TxRe X-Gm-Gg: ATEYQzwdTCsQVK94SDT+v//nrvDFDLJ4YcMGjN0bP95Y/WS5ErmoFtImkEvqIRg+7fU QXCHGCEg5qcdZbD1iIc3aa+q85HtFHRFilVBcMecWL8GFywQ8z5OR/ahOLzcgG4l6WBksB5ALhQ IINXuaxzxCYslX3F4cdXMIzZf7eHdCbWVPkU4diKxWLuTOzWidDZM6UQXFdMOe9ITG4AdPssbfQ d++MK54GLSmDjZBj16H+OfvJc54Tc0SpjscSptcA2Qq5jirfEQGgx5co5blZ+jX42T8H0rLZNp+ nT8Lw2FmskwTfZTuMTdHFUGPzcbysOpS7PkbETqHJQ== X-Received: by 2002:a05:6820:998:b0:675:9d7e:4da6 with SMTP id 006d021491bc7-67a1daf556dmr4145245eaf.34.1772646422448; Wed, 04 Mar 2026 09:47:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Fujii Masao Date: Thu, 5 Mar 2026 02:46:50 +0900 X-Gm-Features: AaiRm52J0gNxbeuqk1SV1uuc3YJKmhccUTpkBmRTJJrMaoMPNxMJCLWs9yjWa84 Message-ID: Subject: Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record To: Anthonin Bonnefoy Cc: PostgreSQL Hackers 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 Wed, Mar 4, 2026 at 5:52=E2=80=AFPM Anthonin Bonnefoy wrote: > > On Tue, Mar 3, 2026 at 6:29=E2=80=AFPM Fujii Masao wrote: > > The approach of calling XLogSetAsyncXactLSN() in RecordTransactionAbort= () seems > > more like an improvement than a bug fix. Since it changes > > RecordTransactionAbort(), it could have unintended impact on the system= . > > > > It may be a reasonable idea (though I'm not certain yet), but for a bug= fix > > I believe we should first apply the minimal change necessary to resolve > > the issue. If needed, this approach could then be proposed later separa= tely as > > an improvement for the next major version. > > Agreed, that's definitely a change that can have a large impact. I > will open a separate thread later. > > > As a simpler alternative, would it make sense for walsender to call > > XLogFlush(GetXLogInsertRecPtr()) instead of XLogBackgroundFlush() durin= g > > shutdown? I'm not sure why walsender currently uses XLogBackgroundFlush= (). > > If there isn't a clear reason for that choice, directly calling XLogFlu= sh() > > might be the simpler solution. Thought? > > That sounds like a good solution. I've tried it and it fixes the > issue. And this only changes the shutdown behaviour in the walsender. > > The use of XLogBackgroundFlush() has been introduced with > c6c333436491, but there's no mention why it was specifically used. I > guess the assumption was that a change would either be flushed with a > commit, or tracked by async LSN through rollback, so > XLogBackgroundFlush() would always write pending records. But this > turns out to be false in the case of this bug. > > I've updated the patch with this approach. Thanks for updating the patch! Barring any objections, I will commit the patch and backpatch it to all supported branches. Regards, --=20 Fujii Masao