Skip to content

Commit

Permalink
Rename swaptempxid to fronzenxid, add minmxid
Browse files Browse the repository at this point in the history
  • Loading branch information
za-arthur committed May 20, 2024
1 parent 1b5daa9 commit 3792bad
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,6 @@ swap_heap_or_index_files(Oid r1, Oid r2)
Form_pg_class relform1,
relform2;
Oid swaptemp;
TransactionId swaptempxid;
CatalogIndexState indstate;

/* We need writable copies of both pg_class tuples. */
Expand Down Expand Up @@ -1231,13 +1230,16 @@ swap_heap_or_index_files(Oid r1, Oid r2)
*/
if (relform1->relkind != RELKIND_INDEX)
{
swaptempxid = relform1->relfrozenxid;
TransactionId frozenxid;
MultiXactId minmxid;

frozenxid = relform1->relfrozenxid;
relform1->relfrozenxid = relform2->relfrozenxid;
relform2->relfrozenxid = swaptempxid;
relform2->relfrozenxid = frozenxid;

swaptempxid = relform1->relminmxid;
minmxid = relform1->relminmxid;
relform1->relminmxid = relform2->relminmxid;
relform2->relminmxid = swaptempxid;
relform2->relminmxid = minmxid;
}

/* swap size statistics too, since new rel has freshly-updated stats */
Expand Down

0 comments on commit 3792bad

Please sign in to comment.