1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Read segment size from WAL headers.

This allows validation of the WAL segment size for PostgreSQL versions <= 10.
This commit is contained in:
David Steele
2020-07-09 17:32:36 -04:00
parent 2f7823c627
commit d5df3974b5
8 changed files with 65 additions and 26 deletions

View File

@ -191,6 +191,7 @@ Read the version specific WAL header into a general data structure
return (PgWal) \
{ \
.systemId = ((XLogLongPageHeaderData *)walFile)->xlp_sysid, \
.size = ((XLogLongPageHeaderData *)walFile)->xlp_seg_size, \
}; \
}
@ -210,6 +211,7 @@ Create a WAL file file for testing
((XLogLongPageHeaderData *)buffer)->std.xlp_magic = XLOG_PAGE_MAGIC; \
((XLogLongPageHeaderData *)buffer)->std.xlp_info = XLP_LONG_HEADER; \
((XLogLongPageHeaderData *)buffer)->xlp_sysid = pgWal.systemId; \
((XLogLongPageHeaderData *)buffer)->xlp_seg_size = pgWal.size; \
}
#endif