We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3d6ccc6 + 3dbc4fa commit 71d4a97Copy full SHA for 71d4a97
engine.c
@@ -394,7 +394,17 @@ ptrackCheckpoint(void)
394
*
395
* Write both magic and varsion_num at once.
396
*/
397
- ptrack_write_chunk(ptrack_tmp_fd, &crc, (char *) &ptrack_map->magic,
+
398
+ /*
399
+ * Previously we read from the field magic, now we read from the beginning
400
+ * of the structure PtrackMapHdr. Make sure nothing has changed since then.
401
+ */
402
+ StaticAssertStmt(
403
+ offsetof(PtrackMapHdr, magic) == 0,
404
+ "old write format for PtrackMapHdr.magic and PtrackMapHdr.version_num "
405
+ "is not upward-compatible");
406
407
+ ptrack_write_chunk(ptrack_tmp_fd, &crc, (char *) ptrack_map,
408
offsetof(PtrackMapHdr, init_lsn));
409
410
init_lsn = pg_atomic_read_u64(&ptrack_map->init_lsn);
0 commit comments