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 1sZm4R-003fOp-9g for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Aug 2024 06:47:23 +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 1sZm4O-00Fc6j-Ce for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Aug 2024 06:47:20 +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.94.2) (envelope-from ) id 1sZm4N-00Fc6b-VU for pgsql-hackers@lists.postgresql.org; Fri, 02 Aug 2024 06:47:20 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sZm4L-002fgo-3Z for pgsql-hackers@lists.postgresql.org; Fri, 02 Aug 2024 06:47:18 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a7abf92f57bso1013801366b.2 for ; Thu, 01 Aug 2024 23:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataegret-com.20230601.gappssmtp.com; s=20230601; t=1722581235; x=1723186035; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=SRNTO+7kOo8rUNdaQ8q3e0ETb73iHLbspoXM3uWzpUY=; b=IGBT/WWeVcWhpuSTCqp/eZcNPUtiAKEomhRXd/9WnDJfv0blxRsqo/3R5XYq4N9auS nbAY3mqnCdpbquSw3RMrFSKQuE2IIAOGeNB0pGoH2atQQHQkRONzT7YjeQLvg6P+PDWY CdsVV3lt2RnxECCxkSEZh/Misrhy/QectzresAtEHxcr/BWf97tVY1m44xc4Jby2YIVk 6cPXG2VvsSrWXJXBTHl7gHoo9HRf9qOpqsmQsSyqniPB9KZvtaJDFNXN4eEmLoYMEdMP 9E8IpuB6eeRkma/Ms02NU1T0/km7XMwSFyYPw7ri5sO0OjvsFsnG3gft2qth3WXXeufA YYww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722581235; x=1723186035; h=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=SRNTO+7kOo8rUNdaQ8q3e0ETb73iHLbspoXM3uWzpUY=; b=hAxNAIhSpZDQyukRmiVGUgRYdWnUguerRjuqWPtgrvF+sSNZoeLt8ZKoyGCA57IPQS Wy+ckf59GDq2bAtjZwJ6IchKmIZZpFqFavo523mb4a0pMFTkWrI2l6q5oR6YBmIMAnQi yw6cfmXpMooCpCdKMBLaTaARwmDUnNuHjT2GST/BQ5IYDMJS712JABtKuUmWtNJIW64c ddjabOxRfogD7ncaUq4dpJrZpld+9X7PCLTvRVNnrNtafxs9W8YhFd1woLrCJ/vz34zk qkfx28MXvE2vTWNWzE/h2G3xlD5CJ1kaC6SrLYh1XgrNYNAl1LBlh7efZkKNrgjdQYgg Tq+Q== X-Gm-Message-State: AOJu0Yzz5N/PT9BOpYOWEr+U+bYGmCREa4dBVGUGslnfR52iZlq+/OFX zMkZv+9hrK/2rVSrG1T3+RzWBCpXjYZKmVINL4Ydt/IQxIpUkdZBUkXQn92sWilXuuE+Xu73AZy OMGoxeZXgFAgg14eE4rpHPFN/GJ4agP9nVdVNMs1eJdRV7WdjwOlmqg== X-Google-Smtp-Source: AGHT+IG3x97dWnyF+YvfSwpNIxzzAda2ozkC5lB9HUPtAOhl8wU6GzIvpXV9YfKu5rmLO9v99tE8Io4G7QTg7r3Y62Q= X-Received: by 2002:a17:907:3f17:b0:a7a:b561:3564 with SMTP id a640c23a62f3a-a7dc51045d7mr191223566b.61.1722581234453; Thu, 01 Aug 2024 23:47:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Stefan Fercot Date: Fri, 2 Aug 2024 08:47:02 +0200 Message-ID: Subject: Re: Recovery of .partial WAL segments To: "pgsql-hackers@lists.postgresql.org" Content-Type: multipart/alternative; boundary="00000000000093a61c061eadb22b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000093a61c061eadb22b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I've added a CF entry for this patch: https://commitfest.postgresql.org/49/5148/ Not sure why CFbot CI fails on macOS/Windows while it works with the Github CI on my fork ( https://cirrus-ci.com/github/pgstef/postgres/partial-walseg-recovery). Many thanks in advance for your feedback and thoughts about this patch, Kind Regards, -- Stefan FERCOT Data Egret (https://dataegret.com) On Thu, Aug 1, 2024 at 10:23=E2=80=AFPM Stefan Fercot wrote: > Dear hackers, > > Generating a ".partial" WAL segment is pretty common nowadays (using > pg_receivewal or during standby promotion). > However, we currently don't do anything with it unless the user manually > removes that ".partial" extension. > > The 028_pitr_timelines tests are highlighting that fact: with test data > being being in 000000020000000000000003 and > 000000010000000000000003.partial, a recovery following the latest timelin= e > (2) will succeed but fail if we follow the current timeline (1). > > By simply trying to fetch the ".partial" file in XLogFileRead, we can > easily recover more data and also cover that (current timeline) recovery > case. > > So, this proposed patch makes XLogFileRead try to restore ".partial" WAL > archives and adds a test to 028_pitr_timelines using current > recovery_target_timeline. > > As far as I've seen, the current pg_receivewal tests only seem to cover > the archives generation but not actually trying to recover using it. I > wasn't sure it was interesting to add such tests right now, so I didn't > considered it for this patch. > > Many thanks in advance for your feedback and thoughts about this, > Kind Regards, > -- > Stefan FERCOT > Data Egret (https://dataegret.com) --00000000000093a61c061eadb22b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I'v= e added a CF entry for this patch: https://commitfest.postgresql.org/49/5148/
Not sure why CFbot CI fails on macOS/Windows while it works wit= h the Github CI on my fork (https://cirrus-ci.com/github/pgstef/postg= res/partial-walseg-recovery).

Many thanks in a= dvance for your feedback and thoughts about this patch,
Kind Regards,
--
Stefan FERCOT
Data Egret (https://dataegret.com)

On Thu, Aug 1, 2024 at 10:23=E2=80= =AFPM Stefan Fercot <ste= fan.fercot@protonmail.com> wrote:
Dear hackers,

Generating a ".partial" WAL segment is pretty common nowadays (us= ing pg_receivewal or during standby promotion).
However, we currently don't do anything with it unless the user manuall= y removes that ".partial" extension.

The 028_pitr_timelines tests are highlighting that fact: with test data bei= ng being in 000000020000000000000003 and 000000010000000000000003.partial, = a recovery following the latest timeline (2) will succeed but fail if we fo= llow the current timeline (1).

By simply trying to fetch the ".partial" file in XLogFileRead, we= can easily recover more data and also cover that (current timeline) recove= ry case.

So, this proposed patch makes XLogFileRead try to restore ".partial&qu= ot; WAL archives and adds a test to 028_pitr_timelines using current recove= ry_target_timeline.

As far as I've seen, the current pg_receivewal tests only seem to cover= the archives generation but not actually trying to recover using it. I was= n't sure it was interesting to add such tests right now, so I didn'= t considered it for this patch.

Many thanks in advance for your feedback and thoughts about this,
Kind Regards,
--
Stefan FERCOT
Data Egret (https://dataegret.com)
--00000000000093a61c061eadb22b--