Commit 1f30295e authored by Simon Riggs's avatar Simon Riggs

Remove poorly worded and duplicated comment

Move line of code to avoid need for duplicated comment

Brought to attention by Masahiko Sawada
parent 27dae036
...@@ -2039,14 +2039,6 @@ SerializeSnapshot(Snapshot snapshot, char *start_address) ...@@ -2039,14 +2039,6 @@ 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));
...@@ -2063,6 +2055,9 @@ SerializeSnapshot(Snapshot snapshot, char *start_address) ...@@ -2063,6 +2055,9 @@ 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) +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment