Re: Reducing memory consumption for pending inval messages

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-08-16T20:18:12Z
Lists: pgsql-hackers
"Bossart, Nathan" <bossartn@amazon.com> writes:
> On 5/30/21, 10:22 AM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>> We can do a lot better, by exploiting what we know about the usage
>> patterns of invalidation requests.

> I spent some time looking through this patch, and it seems reasonable
> to me.

Thanks for reviewing!

>> There is one notable new assumption I had to make for this.  At end
>> of a subtransaction, we have to merge its inval events into the
>> "PriorCmd" list of the parent subtransaction.  (It has to be the
>> PriorCmd list, not the CurrentCmd list, because these events have
>> already been processed locally; we don't want to do that again.)
>> This means the parent's CurrentCmd list has to be empty at that
>> instant, else we'd be trying to merge sublists that aren't adjacent
>> in the array.  As far as I can tell, this is always true: the patch's
>> check for it doesn't trigger in a check-world run.  And there's an
>> argument that it must be true for semantic consistency (see comments
>> in patch).  So if that check ever fails, it probably means there is a
>> missing CommandCounterIncrement somewhere.  Still, this could use more
>> review and testing.

> I didn't discover any problems with this assumption in my testing,
> either.  Perhaps it'd be good to commit something like this sooner in
> the v15 development cycle to maximize the amount of coverage it gets.

Yeah, that's a good point.  I'll go push this.

			regards, tom lane



Commits

  1. Reduce memory consumption for pending invalidation messages.