Re: SLRUs in the main buffer pool, redux - Mailing list pgsql-hackers

From Bagga, Rishu
Subject Re: SLRUs in the main buffer pool, redux
Date
Msg-id 1B2B5DB8-7BEE-489E-AEF8-79BE92E07C3F@amazon.com
Whole thread Raw
In response to Re: SLRUs in the main buffer pool, redux  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: SLRUs in the main buffer pool, redux
List pgsql-hackers
Hi Thomas,

While I was working on adding the page headers to SLRU pages on your patch, I came across this code where it seems like
"MultiXactIdToMemberPage"is mistakenly being used instead of MultiXactIdToOffsetPage in the TrimMultiXact function.
 

Below is the area of concern in the patch:

@@ -2045,14 +1977,7 @@ TrimMultiXact(void)
     oldestMXactDB = MultiXactState->oldestMultiXactDB;
     LWLockRelease(MultiXactGenLock);
 
-    /* Clean up offsets state */
-    LWLockAcquire(MultiXactOffsetSLRULock, LW_EXCLUSIVE);
-
-    /*
-     * (Re-)Initialize our idea of the latest page number for offsets.
-     */
-    pageno = MultiXactIdToOffsetPage(nextMXact);
-    MultiXactOffsetCtl->shared->latest_page_number = pag0eno;
+    pageno = MXOffsetToMemberPage(offset);


Let us know if I am missing something here or if it is an error.

Sincerely,

Rishu Bagga (Amazon Web Services)

On 9/16/22, 5:37 PM, "Thomas Munro" <thomas.munro@gmail.com> wrote:

    CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you
canconfirm the sender and know the content is safe.
 



    Rebased, debugged and fleshed out a tiny bit more, but still with
    plenty of TODO notes and questions.  I will talk about this idea at
    PGCon, so I figured it'd help to have a patch that actually applies,
    even if it doesn't work quite right yet.  It's quite a large patch but
    that's partly because it removes a lot of lines...


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Making C function declaration parameter names consistent with corresponding definition names
Next
From: bt22nakamorit
Date:
Subject: Re: Make ON_ERROR_STOP stop on shell script failure