mirror of
https://github.com/postgres/postgres.git
synced 2025-08-11 04:22:52 +03:00
@@ -2076,6 +2076,14 @@ SerializeSnapshot(Snapshot snapshot, char *start_address)
|
|||||||
serialized_snapshot.whenTaken = snapshot->whenTaken;
|
serialized_snapshot.whenTaken = snapshot->whenTaken;
|
||||||
serialized_snapshot.lsn = snapshot->lsn;
|
serialized_snapshot.lsn = snapshot->lsn;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ignore the SubXID array if it has overflowed, unless the snapshot was
|
||||||
|
* taken during recovey - in that case, top-level XIDs are in subxip as
|
||||||
|
* well, and we mustn't lose them.
|
||||||
|
*/
|
||||||
|
if (serialized_snapshot.suboverflowed && !snapshot->takenDuringRecovery)
|
||||||
|
serialized_snapshot.subxcnt = 0;
|
||||||
|
|
||||||
/* Copy struct to possibly-unaligned buffer */
|
/* Copy struct to possibly-unaligned buffer */
|
||||||
memcpy(start_address,
|
memcpy(start_address,
|
||||||
&serialized_snapshot, sizeof(SerializedSnapshotData));
|
&serialized_snapshot, sizeof(SerializedSnapshotData));
|
||||||
@@ -2092,9 +2100,6 @@ SerializeSnapshot(Snapshot snapshot, char *start_address)
|
|||||||
* snapshot taken during recovery; all the top-level XIDs are in subxip as
|
* snapshot taken during recovery; all the top-level XIDs are in subxip as
|
||||||
* well in that case, so we mustn't lose them.
|
* well in that case, so we mustn't lose them.
|
||||||
*/
|
*/
|
||||||
if (serialized_snapshot.suboverflowed && !snapshot->takenDuringRecovery)
|
|
||||||
serialized_snapshot.subxcnt = 0;
|
|
||||||
|
|
||||||
if (serialized_snapshot.subxcnt > 0)
|
if (serialized_snapshot.subxcnt > 0)
|
||||||
{
|
{
|
||||||
Size subxipoff = sizeof(SerializedSnapshotData) +
|
Size subxipoff = sizeof(SerializedSnapshotData) +
|
||||||
|
Reference in New Issue
Block a user