Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9240a60

Browse files
author
Alexander Korotkov
committed
Fix handling of 64-bit page numbers in multixacts.
Also make multixacts initialize from non-zero page.
1 parenta79ec22 commit9240a60

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

‎src/backend/access/transam/multixact.c‎

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ static void mXactCachePut(MultiXactId multi, int nmembers,
326326
staticchar*mxstatus_to_string(MultiXactStatusstatus);
327327

328328
/* management of SLRU infrastructure */
329-
staticintZeroMultiXactOffsetPage(intpageno,boolwriteXlog);
330-
staticintZeroMultiXactMemberPage(intpageno,boolwriteXlog);
329+
staticintZeroMultiXactOffsetPage(int64pageno,boolwriteXlog);
330+
staticintZeroMultiXactMemberPage(int64pageno,boolwriteXlog);
331331
staticvoidExtendMultiXactOffset(MultiXactIdmulti);
332332
staticvoidExtendMultiXactMember(MultiXactOffsetoffset,intnmembers);
333333
staticboolfind_multixact_start(MultiXactIdmulti,MultiXactOffset*result);
@@ -1674,25 +1674,45 @@ BootStrapMultiXact(void)
16741674
LWLockAcquire(MultiXactOffsetControlLock,LW_EXCLUSIVE);
16751675

16761676
/* Create and zero the first page of the offsets log */
1677-
slotno=ZeroMultiXactOffsetPage(multiOffsetPageno, false);
1677+
slotno=ZeroMultiXactOffsetPage(0, false);
16781678

16791679
/* Make sure it's written out */
16801680
SimpleLruWritePage(MultiXactOffsetCtl,slotno);
16811681
Assert(!MultiXactOffsetCtl->shared->page_dirty[slotno]);
16821682

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+
16831693
LWLockRelease(MultiXactOffsetControlLock);
16841694

16851695
multiMemberPageno=MXOffsetToMemberPage(MultiXactState->nextOffset);
16861696

16871697
LWLockAcquire(MultiXactMemberControlLock,LW_EXCLUSIVE);
16881698

16891699
/* Create and zero the first page of the members log */
1690-
slotno=ZeroMultiXactMemberPage(multiMemberPageno, false);
1700+
slotno=ZeroMultiXactMemberPage(0, false);
16911701

16921702
/* Make sure it's written out */
16931703
SimpleLruWritePage(MultiXactMemberCtl,slotno);
16941704
Assert(!MultiXactMemberCtl->shared->page_dirty[slotno]);
16951705

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+
16961716
LWLockRelease(MultiXactMemberControlLock);
16971717
}
16981718

@@ -1706,7 +1726,7 @@ BootStrapMultiXact(void)
17061726
* Control lock must be held at entry, and will be held at exit.
17071727
*/
17081728
staticint
1709-
ZeroMultiXactOffsetPage(intpageno,boolwriteXlog)
1729+
ZeroMultiXactOffsetPage(int64pageno,boolwriteXlog)
17101730
{
17111731
intslotno;
17121732

@@ -1722,7 +1742,7 @@ ZeroMultiXactOffsetPage(int pageno, bool writeXlog)
17221742
* Ditto, for MultiXactMember
17231743
*/
17241744
staticint
1725-
ZeroMultiXactMemberPage(intpageno,boolwriteXlog)
1745+
ZeroMultiXactMemberPage(int64pageno,boolwriteXlog)
17261746
{
17271747
intslotno;
17281748

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp