Add a hint to the "WAL summaries are required" errors

Поиск
Список
Период
Сортировка
Искать

Add a hint to the "WAL summaries are required" errors

От:
Raja Sai pranav <rajasaipranav0@gmail.com>
Дата:
Вложения:

Hi hackers,


When an incremental backup can't be taken because the WAL summaries for the

required range are missing or incomplete, the server reports:


  ERROR:  WAL summaries are required on timeline 1 from 0/02000028 to

  0/05000028, but the summaries for that timeline and LSN range are incomplete

  DETAIL:  The first unsummarized LSN in this range is 0/02000028.


That says what is wrong but not what to do. By the time these two errors are

raised in PrepareForIncrementalBackup(), the server has already waited for

WAL summarization to catch up (a summarizer that is stuck gets its own error),

so the summaries are not going to appear: summarization was off for part of

the range -- commonly because summarize_wal was enabled only after the full

backup was taken -- or the summaries were removed after wal_summary_keep_time.

In those cases the only way forward is a new full backup. I hit this while

testing incremental backups on PG 18, and several blog posts explain exactly

this error and fix to users.


The attached patch adds the same hint to both errors:


  HINT:  Take a new full backup if WAL summarization was not enabled for this

  whole range or the required summaries have been removed.


One question on wording: the error can also come from WAL generated with

wal_level=minimal (src/bin/pg_combinebackup/t/007_wal_level_minimal.pl). The

remedy is the same, but the hint does not name that case. Would a shorter

"Take a new full backup." be preferable?


I checked it on master by turning summarize_wal off for part of the range,

which now reports the hint after the DETAIL line. The existing TAP test

(007_wal_level_minimal.pl) matches only the main message, so it is

unaffected.


Regards,

Sai Pranav

Re: Add a hint to the "WAL summaries are required" errors

От:
Chao Li <li.evan.chao@gmail.com>
Дата:


> On Oct 8, 2026, at 16:18, Raja Sai pranav  wrote:
> 
> Hi hackers,
> 
> When an incremental backup can't be taken because the WAL summaries for the
> required range are missing or incomplete, the server reports:
> 
>   ERROR:  WAL summaries are required on timeline 1 from 0/02000028 to
>   0/05000028, but the summaries for that timeline and LSN range are incomplete
>   DETAIL:  The first unsummarized LSN in this range is 0/02000028.
> 
> That says what is wrong but not what to do. By the time these two errors are
> raised in PrepareForIncrementalBackup(), the server has already waited for
> WAL summarization to catch up (a summarizer that is stuck gets its own error),
> so the summaries are not going to appear: summarization was off for part of
> the range -- commonly because summarize_wal was enabled only after the full
> backup was taken -- or the summaries were removed after wal_summary_keep_time.
> In those cases the only way forward is a new full backup. I hit this while
> testing incremental backups on PG 18, and several blog posts explain exactly
> this error and fix to users.
> 
> The attached patch adds the same hint to both errors:
> 
>   HINT:  Take a new full backup if WAL summarization was not enabled for this
>   whole range or the required summaries have been removed.
> 
> One question on wording: the error can also come from WAL generated with
> wal_level=minimal (src/bin/pg_combinebackup/t/007_wal_level_minimal.pl). The
> remedy is the same, but the hint does not name that case. Would a shorter
> "Take a new full backup." be preferable?
> 
> I checked it on master by turning summarize_wal off for part of the range,
> which now reports the hint after the DETAIL line. The existing TAP test
> (007_wal_level_minimal.pl) matches only the main message, so it is
> unaffected.
> 
> Regards,
> Sai Pranav
> 
> 

I agree that a shorter, more general hint would be preferable. I'm not sure it's helpful to make the advice conditional on users determining whether WAL summarization was disabled or summary files were removed. As you mentioned, wal_level=minimal can also cause the error. How about:
```
Consider taking a new full backup to use as the basis for future incremental backups.
```

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Re: Add a hint to the "WAL summaries are required" errors

От:
Manu <manuelreyesbravo@gmail.com>
Дата:
Hi Sai,

I tried the patch on master (v1 applies cleanly, and 007 still passes
3/3) and reproduced the error on several paths, including the
wal_level=minimal case via 007. The hint shows up in all of them.

> Would a shorter "Take a new full backup." be preferable?

I think there is a case for it. On the minimal path the hint still
fires, but its two causes do not really fit: summarize_wal is off there
only because minimal requires it -- the actual reason is that the
summarizer reaches that WAL and skips it on purpose (fast_forward) --
and nothing was removed. And even in the main case the first cause is
more a symptom than the condition: with the WAL still on disk, enabling
summarize_wal after the full backup does not error, since the summarizer
backfills from the oldest WAL present; it only fails once that WAL has
been recycled before summarization caught up.

So the remedy-only form you suggested reads correctly in all of them.
If you would rather keep naming the minimal case, there is existing
wording to mirror at xlog.c:6037:

  Use a backup taken after setting "wal_level" to higher than "minimal".

Happy to share the repro script if it helps.

Regards,
Manu


Re: Add a hint to the "WAL summaries are required" errors

От:
Raja Sai pranav <rajasaipranav0@gmail.com>
Дата:
Вложения:
Hi Chao, Manu,

Thanks both , that's a good correction. I didn't realize the summarizer backfills from the oldest WAL still on disk, so "summarization was not enabled" isn't really the trigger; it's WAL being recycled before summarization catches up. Dropping the conditional causes entirely also sidesteps the wal_level=minimal case not fitting them, as Manu pointed out.

v2 attached, using Chao's wording:

  HINT:  Consider taking a new full backup to use as the basis for future incremental backups.

Re-verified the summaries-removed path on master with the new wording. Manu, thanks also for independently confirming it on wal_level=minimal and that 007 still passes  saves me chasing that path myself.

Regards,
Sai Pranav

On Thu, Oct 8, 2026 at 3:04 PM Manu <manuelreyesbravo@gmail.com> wrote:
Hi Sai,

I tried the patch on master (v1 applies cleanly, and 007 still passes
3/3) and reproduced the error on several paths, including the
wal_level=minimal case via 007. The hint shows up in all of them.

> Would a shorter "Take a new full backup." be preferable?

I think there is a case for it. On the minimal path the hint still
fires, but its two causes do not really fit: summarize_wal is off there
only because minimal requires it -- the actual reason is that the
summarizer reaches that WAL and skips it on purpose (fast_forward) --
and nothing was removed. And even in the main case the first cause is
more a symptom than the condition: with the WAL still on disk, enabling
summarize_wal after the full backup does not error, since the summarizer
backfills from the oldest WAL present; it only fails once that WAL has
been recycled before summarization caught up.

So the remedy-only form you suggested reads correctly in all of them.
If you would rather keep naming the minimal case, there is existing
wording to mirror at xlog.c:6037:

  Use a backup taken after setting "wal_level" to higher than "minimal".

Happy to share the repro script if it helps.

Regards,
Manu

Re: Re: Add a hint to the "WAL summaries are required" errors

От:
Raja Sai pranav <rajasaipranav0@gmail.com>
Дата:
Hi Chao, Manu,

This is registered as https://www.google.com/url?q=https://commitfest.postgresql.org/patch/7475/&source=gmail&ust=1793900846549000&sa=E for the current CommitFest. v2 uses Chao's wording and still applies to master (73a28d2733a). If it looks ready to you, could one of you add yourself as reviewer there and mark it Ready for Committer?

Regards,
Sai Pranav

On Thu, Oct 08, 2026 07:39 PM, Raja Sai pranav <rajasaipranav0@gmail.com> wrote:
Hi Chao, Manu,

Thanks both , that's a good correction. I didn't realize the summarizer backfills from the oldest WAL still on disk, so "summarization was not enabled" isn't really the trigger; it's WAL being recycled before summarization catches up. Dropping the conditional causes entirely also sidesteps the wal_level=minimal case not fitting them, as Manu pointed out.

v2 attached, using Chao's wording:

  HINT:  Consider taking a new full backup to use as the basis for future incremental backups.

Re-verified the summaries-removed path on master with the new wording. Manu, thanks also for independently confirming it on wal_level=minimal and that 007 still passes  saves me chasing that path myself.

Regards,
Sai Pranav

On Thu, Oct 8, 2026 at 3:04 PM Manu <manuelreyesbravo@gmail.com> wrote:
Hi Sai,

I tried the patch on master (v1 applies cleanly, and 007 still passes
3/3) and reproduced the error on several paths, including the
wal_level=minimal case via 007. The hint shows up in all of them.

> Would a shorter "Take a new full backup." be preferable?

I think there is a case for it. On the minimal path the hint still
fires, but its two causes do not really fit: summarize_wal is off there
only because minimal requires it -- the actual reason is that the
summarizer reaches that WAL and skips it on purpose (fast_forward) --
and nothing was removed. And even in the main case the first cause is
more a symptom than the condition: with the WAL still on disk, enabling
summarize_wal after the full backup does not error, since the summarizer
backfills from the oldest WAL present; it only fails once that WAL has
been recycled before summarization caught up.

So the remedy-only form you suggested reads correctly in all of them.
If you would rather keep naming the minimal case, there is existing
wording to mirror at xlog.c:6037:

  Use a backup taken after setting "wal_level" to higher than "minimal".

Happy to share the repro script if it helps.

Regards,
Manu

Re: Add a hint to the "WAL summaries are required" errors

От:
Manu <manuelreyesbravo@gmail.com>
Дата:
Hi Sai,

On Wed, Nov 4, 2026, Raja Sai pranav  wrote:
> If it looks ready to you, could one of you add yourself as reviewer
> there and mark it Ready for Committer?

Done.  v2 only changes the two hint strings, so the hint fires on the
same paths I tried with v1, and Chao's wording fits all of them,
wal_level=minimal included.  It still applies to master (31f89191ff).

Regards,
Manu


Re: Add a hint to the "WAL summaries are required" errors

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Thu, Nov 5, 2026 at 11:17 AM Manu  wrote:
> Done.  v2 only changes the two hint strings, so the hint fires on the
> same paths I tried with v1, and Chao's wording fits all of them,
> wal_level=minimal included.  It still applies to master (31f89191ff).

I took a look at the patch since it's marked Ready for Committer.

+ errhint("Consider taking a new full backup to use as the basis for
future incremental backups.")));

This hint seems to leave users thinking that taking a new full backup is
their only option. No? But, the backup could fail for other reasons,
such as WAL summarization being disabled or the selected prior backup
being too old to have the required summaries available.

So, how about mentioning these alternatives as well?

HINT: Make sure WAL summarization is enabled. Consider using a more
      recent backup as the basis for this incremental backup,
      or taking a new full backup.

Regards,

-- 
Fujii Masao


Re: Add a hint to the "WAL summaries are required" errors

От:
Daniel Gustafsson <daniel@yesql.se>
Дата:
> On 9 Nov 2026, at 11:40, Fujii Masao  wrote:

> So, how about mentioning these alternatives as well?
> 
> HINT: Make sure WAL summarization is enabled. Consider using a more
>      recent backup as the basis for this incremental backup,
>      or taking a new full backup.

+1.  Adding a hint as per the original patch is a good idea and your addition
makes it even better.

--
Daniel Gustafsson



Re: Add a hint to the "WAL summaries are required" errors

От:
Manu <manuelreyesbravo@gmail.com>
Дата:
Hi Fujii,

On Mon, Nov 9, 2026 at 7:40 PM Fujii Masao 
wrote:
> HINT: Make sure WAL summarization is enabled. Consider using a more
>       recent backup as the basis for this incremental backup,
>       or taking a new full backup.

Your wording is better, and the more recent backup option works.  In
the five ways I found to hit this error, a full backup taken after the
missing summaries was a good basis: the incremental backup succeeded
and the combined cluster started with all rows, 22 of 22 runs.  A
backup from before them failed with the same error in all 22 runs that
had missing summaries, and each time the DETAIL's LSN fell between the
two backups' start LSNs.  With your hint applied to master it builds
without warnings, and pg_combinebackup's TAP test 007 passes.

One note on the first sentence: with summarize_wal off, the request
fails earlier with "incremental backups cannot be taken unless WAL
summarization is enabled" (3 of 3), so whoever sees this hint already
has it enabled and the sentence can only be about the past.

Regards,
Manu


Re: Add a hint to the "WAL summaries are required" errors

От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Wed, Nov 11, 2026 at 12:19 AM Manu  wrote:
> One note on the first sentence: with summarize_wal off, the request
> fails earlier with "incremental backups cannot be taken unless WAL
> summarization is enabled" (3 of 3), so whoever sees this hint already
> has it enabled and the sentence can only be about the past.

That seems right. So I'm ok with the following hint message for both errors.

    Consider using a more recent backup as the basis for this
incremental backup,
    or taking a new full backup.

Regards,

-- 
Fujii Masao


Re: Add a hint to the "WAL summaries are required" errors

От:
Xuneng Zhou <xunengzhou@gmail.com>
Дата:
Hi,

On Tue, Nov 10, 2026 at 11:40 PM Fujii Masao  wrote:
>
> On Wed, Nov 11, 2026 at 12:19 AM Manu  wrote:
> > One note on the first sentence: with summarize_wal off, the request
> > fails earlier with "incremental backups cannot be taken unless WAL
> > summarization is enabled" (3 of 3), so whoever sees this hint already
> > has it enabled and the sentence can only be about the past.
>
> That seems right. So I'm ok with the following hint message for both errors.
>
>     Consider using a more recent backup as the basis for this
> incremental backup,
>     or taking a new full backup.

This line looks good. I also checked the other error messages in
'basebackup_incremental.c', but found none could benefit from a
similar hint. So guess this is the one.

--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.


FAQ