diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2017-06-24 13:03:55 +0100 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2017-06-24 13:03:55 +0100 |
commit | 829f12e2690c0442e156069092b05f1edc78b08a (patch) | |
tree | 056f33b2ec603113cede3792ae61177aa894c5e7 /src | |
parent | d1fcc622987c1a5b490b956d89f36ac9fed8f9d1 (diff) | |
download | postgresql-829f12e2690c0442e156069092b05f1edc78b08a.tar.gz postgresql-829f12e2690c0442e156069092b05f1edc78b08a.zip |
Revert 1f30295eab65eddaa88528876ab66e7095f4bb65
Reported-by: Tom Lane
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/time/snapmgr.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 6369be78a31..6bf3a94f057 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -2076,6 +2076,14 @@ SerializeSnapshot(Snapshot snapshot, char *start_address) serialized_snapshot.whenTaken = snapshot->whenTaken; 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 */ memcpy(start_address, &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 * 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) { Size subxipoff = sizeof(SerializedSnapshotData) + |