summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2014-06-27 14:43:46 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2014-06-27 14:43:46 -0400
commit9eecc8a7cafa2be356a859f74c5db5961e190579 (patch)
tree69b547d848d7c4840f9065eb029a5c49515cf18d
parent4c888a6290add7ab86078c8759f0de1bd74c7377 (diff)
Don't allow relminmxid to go backwards during VACUUM FULL
We were allowing a table's pg_class.relminmxid value to move backwards when heaps were swapped by VACUUM FULL or CLUSTER. There is a similar protection against relfrozenxid going backwards, which we neglected to clone when the multixact stuff was rejiggered by commit 0ac5ad5134f276. Backpatch to 9.3, where relminmxid was introduced. As reported by Heikki in http://www.postgresql.org/message-id/52401AEA.9000608@vmware.com
-rw-r--r--src/backend/commands/cluster.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index 54a27531825..b1c411a0b96 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -861,6 +861,12 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex, bool verbose,
if (TransactionIdPrecedes(FreezeXid, OldHeap->rd_rel->relfrozenxid))
FreezeXid = OldHeap->rd_rel->relfrozenxid;
+ /*
+ * MultiXactCutoff, similarly, shouldn't go backwards either.
+ */
+ if (MultiXactIdPrecedes(MultiXactCutoff, OldHeap->rd_rel->relminmxid))
+ MultiXactCutoff = OldHeap->rd_rel->relminmxid;
+
/* return selected values to caller */
*pFreezeXid = FreezeXid;
*pCutoffMulti = MultiXactCutoff;