You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# Copyright (c) 2022-2024, PostgreSQL Global Development Group
|
|
|
|
|
|
|
|
pg_combinebackup_sources = files(
|
|
|
|
'pg_combinebackup.c',
|
|
|
|
'backup_label.c',
|
|
|
|
'copy_file.c',
|
|
|
|
'load_manifest.c',
|
|
|
|
'reconstruct.c',
|
|
|
|
'write_manifest.c',
|
|
|
|
)
|
|
|
|
|
|
|
|
if host_system == 'windows'
|
|
|
|
pg_combinebackup_sources += rc_bin_gen.process(win32ver_rc, extra_args: [
|
|
|
|
'--NAME', 'pg_combinebackup',
|
|
|
|
'--FILEDESC', 'pg_combinebackup - combine incremental backups',])
|
|
|
|
endif
|
|
|
|
|
|
|
|
pg_combinebackup = executable('pg_combinebackup',
|
|
|
|
pg_combinebackup_sources,
|
|
|
|
dependencies: [frontend_code],
|
|
|
|
kwargs: default_bin_args,
|
|
|
|
)
|
|
|
|
bin_targets += pg_combinebackup
|
|
|
|
|
|
|
|
tests += {
|
|
|
|
'name': 'pg_combinebackup',
|
|
|
|
'sd': meson.current_source_dir(),
|
|
|
|
'bd': meson.current_build_dir(),
|
|
|
|
'tap': {
|
|
|
|
'tests': [
|
|
|
|
't/001_basic.pl',
|
|
|
|
't/002_compare_backups.pl',
|
|
|
|
't/003_timeline.pl',
|
|
|
|
't/004_manifest.pl',
|
|
|
|
't/005_integrity.pl',
|
|
|
|
't/006_db_file_copy.pl',
|
Do not summarize WAL if generated with wal_level=minimal.
To do this, we must include the wal_level in the first WAL record
covered by each summary file; so add wal_level to struct Checkpoint
and the payload of XLOG_CHECKPOINT_REDO and XLOG_END_OF_RECOVERY.
This, in turn, requires bumping XLOG_PAGE_MAGIC and, since the
Checkpoint is also stored in the control file, also
PG_CONTROL_VERSION. It's not great to do that so late in the release
cycle, but the alternative seems to ship v17 without robust
protections against this scenario, which could result in corrupted
incremental backups.
A side effect of this patch is that, when a server with
wal_level=replica is started with summarize_wal=on for the first time,
summarization will no longer begin with the oldest WAL that still
exists in pg_wal, but rather from the first checkpoint after that.
This change should be harmless, because a WAL summary for a partial
checkpoint cycle can never make an incremental backup possible when
it would otherwise not have been.
Report by Fujii Masao. Patch by me. Review and/or testing by Jakub
Wartak and Fujii Masao.
Discussion: http://postgr.es/m/6e30082e-041b-4e31-9633-95a66de76f5d@oss.nttdata.com
1 year ago
|
|
|
't/007_wal_level_minimal.pl',
|
Wait for WAL summarization to catch up before creating .partial file.
When a standby is promoted, CleanupAfterArchiveRecovery() may decide
to rename the final WAL file from the old timeline by adding ".partial"
to the name. If WAL summarization is enabled and this file is renamed
before its partial contents are summarized, WAL summarization breaks:
the summarizer gets stuck at that point in the WAL stream and just
errors out.
To fix that, first make the startup process wait for WAL summarization
to catch up before renaming the file. Generally, this should be quick,
and if it's not, the user can shut off summarize_wal and try again.
To make this fix work, also teach the WAL summarizer that after a
promotion has occurred, no more WAL can appear on the previous
timeline: previously, the WAL summarizer wouldn't switch to the new
timeline until we actually started writing WAL there, but that meant
that when the startup process was waiting for the WAL summarizer, it
was waiting for an action that the summarizer wasn't yet prepared to
take.
In the process of fixing these bugs, I realized that the logic to wait
for WAL summarization to catch up was spread out in a way that made
it difficult to reuse properly, so this code refactors things to make
it easier.
Finally, add a test case that would have caught this bug and the
previously-fixed bug that WAL summarization sometimes needs to back up
when the timeline changes.
Discussion: https://postgr.es/m/CA+TgmoZGEsZodXC4f=XZNkAeyuDmWTSkpkjCEOcF19Am0mt_OA@mail.gmail.com
1 year ago
|
|
|
't/008_promote.pl',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
subdir('po', if_found: libintl)
|