Re: ERROR: invalid memory alloc request size - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ERROR: invalid memory alloc request size
Date
Msg-id 18713.1130422987@sss.pgh.pa.us
Whole thread Raw
In response to Re: ERROR: invalid memory alloc request size  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: ERROR: invalid memory alloc request size
Re: ERROR: invalid memory alloc request size
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I think the problem is that CreateMultiXactId calls
> GetNewMultiXactId and then RecordNewMultiXact, and the lock is released
> between the calls.  So one backend could try to read the offset before
> another one had the time to finish writing it.

Ugh, yes, that is clearly a hole :-( even if it turns out not to explain
Matteo's observation.

I don't see any easy way to fix this except by introducing a lot more
locking than is there now --- ie, holding the MultiXactGenLock until the
new mxact's starting offset has been written to disk.  Any better ideas?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Matteo Beccati
Date:
Subject: Re: ERROR: invalid memory alloc request size
Next
From: Martijn van Oosterhout
Date:
Subject: Re: ERROR: invalid memory alloc request size