Fix bug in including AUX files in basebacklup

This commit is contained in:
Konstantin Knizhnik
2024-06-25 19:07:39 +03:00
parent 45dcc66bf4
commit dc780c9e1e
2 changed files with 10 additions and 0 deletions

View File

@@ -345,6 +345,7 @@ impl AuxFileV2 {
AuxFileV2::Recognized("pg_logical/replorigin_checkpoint", hash)
}
(2, 1) => AuxFileV2::Recognized("pg_replslot/", hash),
(3, 1) => AuxFileV2::Recognized("pg_stat/pgstat.stat", hash),
(1, 0xff) => AuxFileV2::OtherWithPrefix("pg_logical/", hash),
(0xff, 0xff) => AuxFileV2::Other(hash),
_ => return None,

View File

@@ -634,6 +634,15 @@ async fn import_file(
// TODO Backups exported from neon won't have pg_tblspc, but we will need
// this to import arbitrary postgres databases.
bail!("Importing pg_tblspc is not implemented");
} else if file_path.starts_with("pg_logical/")
|| file_path.starts_with("pg_replslot/")
|| file_path.starts_with("pg_stat/")
{
let bytes = read_all_bytes(reader).await?;
modification
.put_file(&file_path.to_str().unwrap(), &bytes, ctx)
.await?;
debug!("imported aux file \"{}\"", file_path.display());
} else {
debug!(
"ignoring unrecognized file \"{}\" in tar archive",