Ignore files left after interrupted unlogged build when comparing pgdir

This commit is contained in:
Konstantin Knizhnik
2024-06-06 10:02:13 +03:00
parent 6d694f2983
commit dd28d82558

View File

@@ -4303,23 +4303,22 @@ def check_restored_datadir_content(
restored_files = list_files_to_compare(restored_dir_path)
if pgdata_files != restored_files:
# filter pg_xact and multixact files which are downloaded on demand
# also filter files with zero size which can remain after aborted unlogged build
pgdata_files = [
f
for f in pgdata_files
if f in restored_files
or (
not f.startswith("pg_xact")
and not f.startswith("pg_multixact")
and f != "./pg_dynshmem"
and (
not Path(os.path.join(endpoint.pgdata_dir, f)).exists()
or os.path.getsize(os.path.join(endpoint.pgdata_dir, f)) != 0
)
# filter pg_xact and multixact files which are downloaded on demand
# also filter files with zero size which can remain after aborted unlogged build
pgdata_files = [
f
for f in pgdata_files
if f in restored_files
or (
not f.startswith("pg_xact")
and not f.startswith("pg_multixact")
and f != "./pg_dynshmem"
and (
not Path(os.path.join(endpoint.pgdata_dir, f)).exists()
or os.path.getsize(os.path.join(endpoint.pgdata_dir, f)) != 0
)
]
)
]
if ignored_files:
pgdata_files = [f for f in pgdata_files if f not in ignored_files]