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 1vy4G9-00HOSY-0u for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2026 08:40:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vy4G7-00Gcl6-2W for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2026 08:40:40 +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 1vy4G7-00Gcky-1Y for pgsql-hackers@lists.postgresql.org; Thu, 05 Mar 2026 08:40:39 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vy4G5-00000000VYc-43XK for pgsql-hackers@postgresql.org; Thu, 05 Mar 2026 08:40:38 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-7986e538decso78212117b3.1 for ; Thu, 05 Mar 2026 00:40:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772700037; cv=none; d=google.com; s=arc-20240605; b=gnW5xQms2/90JPYvUOTF0UJU48esIgwWNceDpeNpRlijLIw88U8eHALznC0AkeP1eK TTntZ1qadwVlBl3NDPLdAvj1p3eA4dBcb43tUG/cRUueAlH0mMZxXhaVHmQmWp3Lzh7n MXQ/tuptegrzkrUykU0lmeuwVvlTqMr7eTw+JExmFmwh2JcZNyw9uhtKUNUEaOrscwJO hjHPgZqZCjKwsOdLwoh4FQwPbpBKx8jGSNFGnA86qd4HILDxP/L3JVU6le1oyZUjkv5Z yFWmF9W+JKOX3LdjRMpdsUlKPie5r5tI82o+HUC1q1LfOYGIqEP5onCh7eqPSpTghlFO 3tWg== 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=iFxTgb7RKRBjVkj2WF3q1Dv2zW9fEhuqL8gQ+jG6sVo=; fh=oKbJOEgAahvcbTW2UtFGEafCWR/Y8gySSgedSQKbvKM=; b=IRf/YABFss4PyiUk/ONG3kidtaT+xSbThZnINCPy/k832/3mQaQlA215CRaqyRyI7p GCzoiI6II66VRETaPR6STSMVQoUOKGMZra5I0AJTlhadamIH1p7Vqcv2tSkurL9++/3W C4LLJgp73MKVGZaVfPgEAAGQ0ntphfZ5UzREkoCmZL9ByBV5j2z/p5N+fBXctv0Odjhn TkDAsVCUqAavluQTihtpB99H1uN80d8elaY6Jk8UKuh9dTc0CQWC7oFoeNUMms20opwk Gm8aUGiXE/FRi20b2vsoUOEa3NATfhQtL/zw1/747S8PoJGybqIBURwyKgwRcpsCY0gS c3YQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; t=1772700037; x=1773304837; 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=iFxTgb7RKRBjVkj2WF3q1Dv2zW9fEhuqL8gQ+jG6sVo=; b=YU9j8v2xdG5jbbg3+EzNLke3MuhVyojGbmRIJwjSyMDNVh/Kd3PZaPeaqPEvvE7zgS d6SHGxZGt2YL6GtzBGKOZqTPdpY2/EKGDrFpU4cgxn6w9ltLRaBFUdAqiazP3HX4y8rx Oy6VMpWfq1okYM6PReu5p2Z3pef1GWpUtc4yU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772700037; x=1773304837; 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=iFxTgb7RKRBjVkj2WF3q1Dv2zW9fEhuqL8gQ+jG6sVo=; b=bNAnTGT+Sot5HPtH7gAC4JM5elPG5kg48ycq87CzRyHCZSGXh8XEmCDp5UkFYGwOVW s48EuvPeQtpH0iMctYJP9HxgzIh0+8g8/5uF7wSujDFWUNWFbDHxrwf3Dn2epFgHSIPb cZeFXF9t7ju8xza9CAKq2w8zAKO3PW5mPZzWTnqj9Gy+x8Q9+Ga8KMkkXc6klXnECL8U G1g0sh10WdLu5Q2oCs0TnRLXitlozwSbnKh7/XH3LQSpepxKzOF7tXARMMGoG3JWGcPw 2jCWzAsR+alyw6M8POPJTbf2VD7Qt+iE6vL3fPoq+JPSPHuGe3WemotMS7P5PWKtM3wB kfdQ== X-Forwarded-Encrypted: i=1; AJvYcCWS8lLO7mGzisiwx2euw4B6ZAophJPQp2cGfhfjWsU8UDTnczaBZ2kCo4HQwlPAqkkmWwNC3xZRPmbTivAK@postgresql.org X-Gm-Message-State: AOJu0YzXGpxm7K/uDBsgkkDCONoBRR2AIVuvdYpUEqqjTSH9NHoEXRSF 9OhuWWTd4Gq2sMq6C2DAepY5XOEPKR7jDv+RAHXyvd0/U0qnoZy+wehMQjcgF6+LxnPPyfYJYAL BjOmopL3qF2ymxf3eG1m/s0QStQnwrQZ3K/JfftfSLA== X-Gm-Gg: ATEYQzyIXzzHtUNaHeFIQLgSaOzFmDxUbZG/uF9ys8P/KNPzQFFF0QiP+QpSj5F3S4b 1/bns4aK38SpQ7eGRbLwHY/PiMemwKUAVerbbkFaI1+3WKmz5GyT0j/rpij8UY6e7ZiOUlclLne 7usd/UyqAsoVu0kedD+vpcglp+OvVLPejA2X0Wxh/9/mTcn0AityL5XTN1yE/vY0rppzP9LK4x1 Isn7s60Ermv4nHlVIJk5hnnvPSsYRrQKHYvYtQIrYwDS3IeR5Ou6ge6QH70ezwTdfnJFfg0vUkm PB16D1elLLLaDdm36w== X-Received: by 2002:a05:690c:ec5:b0:796:3dce:d098 with SMTP id 00721157ae682-798c6bde352mr43879947b3.17.1772700036124; Thu, 05 Mar 2026 00:40:36 -0800 (PST) MIME-Version: 1.0 References: <2631a3c3-5e60-4a1a-9e20-377024322602@gmail.com> In-Reply-To: <2631a3c3-5e60-4a1a-9e20-377024322602@gmail.com> From: Anthonin Bonnefoy Date: Thu, 5 Mar 2026 09:40:25 +0100 X-Gm-Features: AaiRm51EvX2paLmgDXkjYj1ovKpRebAW-gZZXWzXk4uzLwSShK3kC6AK1RN0vyI Message-ID: Subject: Re: Shutdown indefinitely stuck due to unflushed FPI_FOR_HINT record To: Alexander Lakhin Cc: Fujii Masao , 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 Hi Alexander, On Thu, Mar 5, 2026 at 7:30=E2=80=AFAM Alexander Lakhin wrote: > Hello Anthonin and Masao-san, > Thank you for working on this! > > It looks like the same issue was discovered and discussed before, but tha= t > time without a final fix: [1]. I tried v5 patch with my > 099_walsender_stop.pl test and it executed 100 internal iterations > successfully, while without the patch it failed for me on iterations 6, 8= , 5. > > [1] https://www.postgresql.org/message-id/flat/f15d665f-4cd1-4894-037c-af= dbe369287e%40gmail.com Thanks for the tests and the additional context. Looking at the the thread, the latest patch provided a similar solution usi= ng: + XLogFlush(GetInsertRecPtr()); So it was relying on GetInsertRecPtr() instead of GetXLogInsertRecPtr(). As mentioned in the thread, GetInsertRecPtr() only returns the position of the last full xlog page, meaning it doesn't fix the issue we have where the last partial page contains a continuation record. Testing the XLogFlush(GetInsertRecPtr()) patch with my script, I still get the shutdown stuck issue. Using GetXLogInsertRecPtr() is required to make sure the last partial page is correctly flushed. Regards, Anthonin Bonnefoy