mirror of
https://github.com/neondatabase/neon.git
synced 2026-06-02 13:00:37 +00:00
Fix unlogged_extend
This commit is contained in:
@@ -1396,11 +1396,14 @@ PageIsEmptyHeapPage(char *buffer)
|
||||
static void
|
||||
unlogged_extend(SMgrRelation reln, ForkNumber forknum, BlockNumber old_relsize, BlockNumber new_relsize)
|
||||
{
|
||||
if (new_relsize > old_relsize)
|
||||
{
|
||||
#if PG_MAJORVERSION_NUM < 16
|
||||
mdextend(reln, forknum, new_relsize, (char *) zero_buffer.data, true);
|
||||
mdextend(reln, forknum, new_relsize, (char *) zero_buffer.data, true);
|
||||
#else
|
||||
mdzeroextend(reln, forknum, old_relsize, new_relsize - old_relsize, true);
|
||||
mdzeroextend(reln, forknum, old_relsize, new_relsize - old_relsize, true);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4305,10 +4305,20 @@ def check_restored_datadir_content(
|
||||
|
||||
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 not f.startswith("pg_xact") and not f.startswith("pg_multixact")
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user