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 1vxTZ2-00GBVz-09 for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2026 17:29:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxTZ0-0081kI-0e for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2026 17:29:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxTYz-0081k6-2y for pgsql-hackers@lists.postgresql.org; Tue, 03 Mar 2026 17:29:42 +0000 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vxTYy-00000000DP6-03T7 for pgsql-hackers@postgresql.org; Tue, 03 Mar 2026 17:29:41 +0000 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-409de4132b5so750798fac.1 for ; Tue, 03 Mar 2026 09:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772558979; cv=none; d=google.com; s=arc-20240605; b=icRCH6WBXKaJaz6jYm3w68s/T/Fjh3grPP2hXDhRxOt6JSoF7GsDDunHF/BDjjSjGp t85+cMBhSuHL7kICD1hXx/gJRrFHNN/h0fs/iZpjr8MbfKfkuPncQ3QW6J6ptzh4QR74 Yi5kTk1hEi9N7L7NXcYMCIKxugW0Vdb+j7+Eq8bj33kTW2rv0Q1lG9HqEerGtUmnmhac RAI5B5Be/Vww6DDhdLIsZgLBHLD7KFaRwcFOJPYBnatqe5VBb5xy6KrJEf7yrXtvolrw IGrnSrDcvNowLEbzOlfpYIuXBroBFxi9Yt/izeFE3pLaLarIrTiszOexMNM8zMc4e8x4 oosA== 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=TRxl/gHuYlocuu9E06KaDv7Ld8gsPfoxhkBKHInk+Lw=; fh=hFSd27pZZP9j+6/iWOCgUsnN/QC7v2q9PbPGLaEfbyk=; b=gqspDHr+Q2Vq0S+vN3o6pwvc/Q8Ula2nPEuiOR2nTeKRoUJASQlPIDf0ACffiMwYC0 4VQMDHeeuF8xwHri5QwPNQGIciEjFbtO3iuXt8qevSi/q6nauzYOTu+QunH+IDoWxWq8 MsrN1qDY/zyQk51m4onqWICMIKnw+SgXPgaWcGEmPE3D9GO/QctslbKwcJV9kfPU8KXn ZjRzSKNynnYMQDwPB08ycrTOMV21bzy8/ekt9dQk0cEIFIcvLSCLGU9NcA3pjRCalovj j3OebT+ESKIIq4b+utCqSk37nRCVNxDOzNjokrUJQQgy1FA073dADcGL5k7Z39Swsqw+ 6Thw==; 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=1772558979; x=1773163779; 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=TRxl/gHuYlocuu9E06KaDv7Ld8gsPfoxhkBKHInk+Lw=; b=T/0vQbYcRhd90zGTbs6+8jvfGZLNcLp1m1wbNEuncX7g5jIy9h0HuaTAH0ii+mhk3s 2vzr2RGBghIBIGGbrtwW7nAH0dnWB2RME5aQLPcd/NGGgN8U48AB1kJiGQQtBQ5jPUkS 8yxQPcYQZ7QQqn5XnBqBB0yP6hX5K7Gq+P9f3QkyptY1tn6ggFNLxVaL1qslUd70qC8c ADsERxBmGiF5NKEyS5zTIYW7FrjCGES+Qw/EW99W29USsUTUUXDN1bBykvX4fKaOiPGg p0gxlW5iryerKRNt8y+bzRLtcFRhG98S92CO/YqxNW70N5msTvifwV9wlVpxvpl7FQCK AcDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772558979; x=1773163779; 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=TRxl/gHuYlocuu9E06KaDv7Ld8gsPfoxhkBKHInk+Lw=; b=DNI1loleu36wedlg0XmrGXHdKakEEbOLzd51VfuQ/HzyNWTH5ZoYv78tuWuAX9J/S1 dohHOezAO6QK859VoXbzEqddn2NiL+57HzI/M8uYzp5XM9n0pMOD8oWYUyxpu+Htej7P 7kmurmDi8BzayH02x7W2VAGxIIHCZUZD9+9xdC9KjPE1Wg0yUEP4KTaJBRZAFVC+S9/C vDB/QRjcD7CvV78pSFq3tcRMe6226a5TWh0ogWDFjUE6/bbCFQApMNAKUUbaR+FhfojI rMSkFIRbKBQr42qjV/fbRnI7LrND1myhrbD3UP8xe/kCA3zJ9V40KqQzsfAizrhId//o LwVA== X-Gm-Message-State: AOJu0Yzjp3nEwd2ToVrGx7Kd37PYTtJJoQvNdIRENn+hTr1R8mqV6DBE xCWezFXBZ4XY+2f8lJpD3O1IbjtPKwu1o4t9Lh01yzPs6E/z6sycgydJkeRnY8H6NvuCLmZs+5D vDiudSn6qgDGgUU0YyUAc6Jj5ywK1PVQqVh3qCbI= X-Gm-Gg: ATEYQzxJNl6x9WhGUcab6/RAh9BTRNoLcFYczIaWlW6EXQ9o2wd8JHVL0QIXgj81fFu yVx4HIw+UwQhRmjekpkjuCMoDlcOgAHbkiJOfFBNBgYAaIjtUVYGWTvxRFKOAyuolg6QaPR0jbF vxi5lVP0FfUDm8dpfs5KKez3XvqentWnevTK30He9ZPFax8iOXhIvQPJRb3UvGCtw/DFpjN7kgw EaMD8kmZssNwgGxyE1n299WKMPCu6XSYLeCrZ5RRw0GI2uQcdfBj0pD4dvgKJpzmanLeVAvxPcA 7RFiWVbNCsdnS545/HAbziyfJ181OVE7SpxBeEc3PA== X-Received: by 2002:a05:6820:4c0a:b0:679:7d2b:4362 with SMTP id 006d021491bc7-679faf3a8d4mr9830824eaf.48.1772558979348; Tue, 03 Mar 2026 09:29:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Fujii Masao Date: Wed, 4 Mar 2026 02:29:27 +0900 X-Gm-Features: AaiRm52TT_1v1arQvZGM9Mu56ee8HxYxgerzcyfY_HG4GAEB6Md9fXE6yymLSFE 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 2:11=E2=80=AFAM Anthonin Bonnefoy wrote: > > Here's a small updated version of the patch, with the 2 different approac= hes. Thanks for the patches! > - 0001: This is the XLogSetAsyncXactLSN call in RecordTransactionAbort > approach. The small difference with v3 is that the 'XactLastRecEnd !=3D > 0' condition is now merged with !isSubXact: > +if (!isSubXact && XactLastRecEnd !=3D 0) > +{ > + XLogSetAsyncXactLSN(XactLastRecEnd); > XactLastRecEnd =3D 0; > +} The approach of calling XLogSetAsyncXactLSN() in RecordTransactionAbort() s= eems 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 separately= as an improvement for the next major version. > - 0002: This is the ShutdownXLOG approach. I've used > XLogFlush(WriteRqstPtr) instead of updating the async LSN. It feels > like if we're going to stop the walsenders, we may as well flush > everything and get the WAL in a good state. > The spinlock to access XLogCtl->LogwrtRqst.Write is probably > unnecessary since we're at a point where no additional WAL records > should be written, but it doesn't hurt to keep consistency. As a simpler alternative, would it make sense for walsender to call XLogFlush(GetXLogInsertRecPtr()) instead of XLogBackgroundFlush() during shutdown? I'm not sure why walsender currently uses XLogBackgroundFlush(). If there isn't a clear reason for that choice, directly calling XLogFlush() might be the simpler solution. Thought? Regards, --=20 Fujii Masao