summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/procarray.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/ipc/procarray.c')
-rw-r--r--src/backend/storage/ipc/procarray.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 5798c12a44a..d739812f230 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -804,8 +804,13 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
/*
* Sort the array so that we can add them safely into
* KnownAssignedXids.
+ *
+ * We have to sort them logically, because in KnownAssignedXidsAdd we
+ * call TransactionIdFollowsOrEquals and so on. But we know these XIDs
+ * come from RUNNING_XACTS, which means there are only normal XIDs from
+ * the same epoch, so this is safe.
*/
- qsort(xids, nxids, sizeof(TransactionId), xidComparator);
+ qsort(xids, nxids, sizeof(TransactionId), xidLogicalComparator);
/*
* Add the sorted snapshot into KnownAssignedXids. The running-xacts