@@ -326,8 +326,8 @@ static void mXactCachePut(MultiXactId multi, int nmembers,
326
326
static char * mxstatus_to_string (MultiXactStatus status );
327
327
328
328
/* management of SLRU infrastructure */
329
- static int ZeroMultiXactOffsetPage (int pageno , bool writeXlog );
330
- static int ZeroMultiXactMemberPage (int pageno , bool writeXlog );
329
+ static int ZeroMultiXactOffsetPage (int64 pageno , bool writeXlog );
330
+ static int ZeroMultiXactMemberPage (int64 pageno , bool writeXlog );
331
331
static void ExtendMultiXactOffset (MultiXactId multi );
332
332
static void ExtendMultiXactMember (MultiXactOffset offset , int nmembers );
333
333
static bool find_multixact_start (MultiXactId multi , MultiXactOffset * result );
@@ -1674,25 +1674,45 @@ BootStrapMultiXact(void)
1674
1674
LWLockAcquire (MultiXactOffsetControlLock , LW_EXCLUSIVE );
1675
1675
1676
1676
/* Create and zero the first page of the offsets log */
1677
- slotno = ZeroMultiXactOffsetPage (multiOffsetPageno , false);
1677
+ slotno = ZeroMultiXactOffsetPage (0 , false);
1678
1678
1679
1679
/* Make sure it's written out */
1680
1680
SimpleLruWritePage (MultiXactOffsetCtl , slotno );
1681
1681
Assert (!MultiXactOffsetCtl -> shared -> page_dirty [slotno ]);
1682
1682
1683
+ if (multiOffsetPageno != 0 )
1684
+ {
1685
+ /* Create and zero the first page of the offsets log */
1686
+ slotno = ZeroMultiXactOffsetPage (multiOffsetPageno , false);
1687
+
1688
+ /* Make sure it's written out */
1689
+ SimpleLruWritePage (MultiXactOffsetCtl , slotno );
1690
+ Assert (!MultiXactOffsetCtl -> shared -> page_dirty [slotno ]);
1691
+ }
1692
+
1683
1693
LWLockRelease (MultiXactOffsetControlLock );
1684
1694
1685
1695
multiMemberPageno = MXOffsetToMemberPage (MultiXactState -> nextOffset );
1686
1696
1687
1697
LWLockAcquire (MultiXactMemberControlLock , LW_EXCLUSIVE );
1688
1698
1689
1699
/* Create and zero the first page of the members log */
1690
- slotno = ZeroMultiXactMemberPage (multiMemberPageno , false);
1700
+ slotno = ZeroMultiXactMemberPage (0 , false);
1691
1701
1692
1702
/* Make sure it's written out */
1693
1703
SimpleLruWritePage (MultiXactMemberCtl , slotno );
1694
1704
Assert (!MultiXactMemberCtl -> shared -> page_dirty [slotno ]);
1695
1705
1706
+ if (multiMemberPageno != 0 )
1707
+ {
1708
+ /* Create and zero the first page of the members log */
1709
+ slotno = ZeroMultiXactMemberPage (multiMemberPageno , false);
1710
+
1711
+ /* Make sure it's written out */
1712
+ SimpleLruWritePage (MultiXactMemberCtl , slotno );
1713
+ Assert (!MultiXactMemberCtl -> shared -> page_dirty [slotno ]);
1714
+ }
1715
+
1696
1716
LWLockRelease (MultiXactMemberControlLock );
1697
1717
}
1698
1718
@@ -1706,7 +1726,7 @@ BootStrapMultiXact(void)
1706
1726
* Control lock must be held at entry, and will be held at exit.
1707
1727
*/
1708
1728
static int
1709
- ZeroMultiXactOffsetPage (int pageno , bool writeXlog )
1729
+ ZeroMultiXactOffsetPage (int64 pageno , bool writeXlog )
1710
1730
{
1711
1731
int slotno ;
1712
1732
@@ -1722,7 +1742,7 @@ ZeroMultiXactOffsetPage(int pageno, bool writeXlog)
1722
1742
* Ditto, for MultiXactMember
1723
1743
*/
1724
1744
static int
1725
- ZeroMultiXactMemberPage (int pageno , bool writeXlog )
1745
+ ZeroMultiXactMemberPage (int64 pageno , bool writeXlog )
1726
1746
{
1727
1747
int slotno ;
1728
1748
0 commit comments