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.98.2) (envelope-from ) id 1x7vQj-00000000oBd-353x for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Sep 2026 13:48:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x7vQj-000000050Wt-054D for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Sep 2026 13:48:37 +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.98.2) (envelope-from ) id 1x7vQi-000000050Wl-2vLw for pgsql-hackers@lists.postgresql.org; Sat, 19 Sep 2026 13:48:36 +0000 Received: from mail-wm2-x11.google.com ([2a00:1450:4864:31::11]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x7vQf-00000000CaA-2NF3 for pgsql-hackers@lists.postgresql.org; Sat, 19 Sep 2026 13:48:35 +0000 Received: by mail-wm2-x11.google.com with SMTP id 5b1f17b1804b1-49b912df756so11578905e9.3 for ; Sat, 19 Sep 2026 06:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1789825712; x=1790430512; darn=lists.postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Us2kvfTI3n+7W2XTB+tCFjz4ycWWu0HdejEGgZJ3U6M=; b=Lh0FukPS1TcAaP+rKkoyEJymI/qzPc/ZStxUxEBycshe0T8Hs7fNr7OEWYHgo7wTjo gq7zX3bsTJSHyyIkqyARAlXKtRR/3C93X39Ubo79yIWI8Pam/L759UisrAg5pJ6zz5m+ hHqktwFLIUVhzMemuGLjdBKhB/WtZRBVxojcry1tSVtLsKtmE9uM9uyB4+xfdsJ9wy4/ osZfDjugzxRhc+JTaxbCnCzPzHtr5VFSMwp8Ywt2KI2hBE9BVeLe+nJKY6xL7wrgG7xO hOz7Ibjgv43vwDtBjJLt9VTGEiWUaLIYciT8SGk8mCv68/c4hgMvy8CpF2rqIBYFMSB3 HnnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789825712; x=1790430512; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Us2kvfTI3n+7W2XTB+tCFjz4ycWWu0HdejEGgZJ3U6M=; b=li7uNaQ1uOjHmH/hzHPH7fsRTpLHS8iYG7bfMZ1ZS9pVNy7bXDCj98dJ9zsHNrvr// HSjYMfbDCsNXRmY7zoTcpAu5OiBiv1Ko08n3ZXsubGzXgCTAOMcyqE0zE+Qi1nKlts6X /5BId70rZSL6A2sfBHsVbu9Ry41Acz4arBklRrtopp81VX+kJDHWxL+Iw9uwdEhEhoik /VkH53MXaJiSyVpsVMRUjrSPyV/8Q455Tknqdi9CJp7qaPVYTTCMNyppfBAxOj5zm2jZ aHd3zZDOcgblPtOfrD0q3tqmpGNOIXUO9V5xYgXf1nMneVzgadC1S1M5b8T8+KoYhFQ2 hWkw== X-Forwarded-Encrypted: i=1; AKwUvBwWqGVjUIXGFTasUjR6LraY8YCi7TpM+mgWKR/7It9kU3h93Hju3nUjigjp7/ifr1Kh4eeY98bc0+232SVk@lists.postgresql.org X-Gm-Message-State: AFuF++m+FnGjxaZe30YaRxAHA/hmJPQpj0hgN1pFbi6pciINsgqClaTz 9e0GJu+7jONV2kNfweUVVDul8HIh72B9pm7B7iVdFKjiFGkDDf/pZTGcyilc4hU0Bw58eUyZ3Ap O2qiCIw== X-Gm-Gg: AYBFou2AcXgB0Ds0CmK2br320DfpB8sfluBniLLtkVpGZozrIgQg331XFyC2muQ5Q8z 4z5mDvn/GcjYOw8frju+cRgWT79YMjtkEqxGCI352BCaOwouNaTZk0TK6Mbv51Qsm3IsAx5WFZR hSwkR5kejIU/W/HsCNXXLhawwDdM5mD86p7rGgpgH7sTiAlRSs0WSUaTPWEcFKjih3eRl5Rx9Pw guTC2Hqi5YHBVQnj2xizwnabiUob4xeYAZyZRgCg5SSm4WA4yjnckQuHvphq6Yhm0JadjSFlKeb 0l7HpGUTX0a9GZDK4GEyvsWW4uV5vCAp1/Ggno2QcK38VxoKUQ7RgZRrNUtioOdLctd0UwPpkZr iR9fQXZkKhIcY9STq3AYiW9p/yzwhwRxSmX4nYBykz0N1ULuJsBVcAKdDZxoodadWOEdeY6Xalb oF39r7Sk2UoGvKZfZCmVxe1NBI8L39ZfHQ7kh+89v3lo8uFgIowRZUfieJKbLYjODNAHZGqQT45 LDuYhx8HSsGd8Vl2xB8KcdS/pftvNt+wmH6W31hDuGA4gAu8bhm0HJ2QoSNgH+bENDQh60XZrMr y/ky/M1MoRdgEWUcW8RtXrgY+g== X-Received: by 2002:a05:600c:4e89:b0:49d:10d6:fd55 with SMTP id 5b1f17b1804b1-49fc5681267mr79254015e9.1.1789825712455; Sat, 19 Sep 2026 06:48:32 -0700 (PDT) Received: from [192.168.88.235] ([163.116.177.180]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fcd8bf159sm62337965e9.10.2026.09.19.06.48.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Sep 2026 06:48:31 -0700 (PDT) Message-ID: Date: Sat, 19 Sep 2026 14:48:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Possible race condition in pg_basebackup To: Andrey Borodin Cc: =?UTF-8?Q?=C3=81lvaro_Herrera?= , pgsql-hackers mailing list References: <5516902D-65A5-4C61-8568-E32F111C89EF@yandex-team.ru> <99DF8255-F6B8-4B10-85A2-B6984B3DD16C@yandex-team.ru> <999caa0e-d015-42da-9b79-001087e719b8@enterprisedb.com> <0cab2102-4786-416a-ae50-b606a495d01b@enterprisedb.com> <801646A4-65A3-4DF1-84CD-7BF836E178BD@yandex-team.ru> <985de9f0-cbb6-4235-a6cd-32242f74e1f3@enterprisedb.com> <2A5B29E9-658D-4AD7-8879-C6169D1327E3@yandex-team.ru> Content-Language: en-US From: Nick Ivanov In-Reply-To: <2A5B29E9-658D-4AD7-8879-C6169D1327E3@yandex-team.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Andrey, On 15/09/2026 19:29, Andrey Borodin wrote: > Hi Nick, > > Thanks! This looks like the right scope for a backpatch. > > I adapted your v2 test for the client-side fix, checking that the slot > already reserves WAL before the server sends the startpoint. It covers > both --create-slot and the default temporary slot, and requires the > backup to succeed after the concurrent checkpoint. Without the fix, > both cases fail with the expected missing-WAL error. Thank you for updating the test, much appreciated. I should have done that myself, to be honest. > Small wording detail. Another checkpoint is enough to trigger the race. > It need not come from another basebackup. I adjusted and wrapped the > commit message accordingly. Apart from wrapping a comment, the client > code is unchanged. > > WDYT? The changes make good sense, thanks for that too. I will now proceed to validate the patch against older versions. One question in that regard: the TAP test carries the number 57 in the recovery suite in the master branch. Earlier stable versions likely have fewer tests, and if we add the new test there with #57 there will be a gap in the sequence. What is the accepted practice in such cases: renumber the newly added test in earlier versions to avoid the gap, or keep the number consistent with HEAD? Cheers Nick