Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFj3x-0000lR-Hh for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Aug 2021 20:18:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mFj3w-0001BY-GR for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Aug 2021 20:18:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFj3w-0001BQ-8m for pgsql-hackers@lists.postgresql.org; Mon, 16 Aug 2021 20:18:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFj3q-00052B-1c for pgsql-hackers@lists.postgresql.org; Mon, 16 Aug 2021 20:18:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 17GKICqb987630; Mon, 16 Aug 2021 16:18:12 -0400 From: Tom Lane To: "Bossart, Nathan" cc: "pgsql-hackers@lists.postgresql.org" Subject: Re: Reducing memory consumption for pending inval messages In-reply-to: <584A570C-8B36-4A02-B8BC-2257DB5567A3@amazon.com> References: <2380555.1622395376@sss.pgh.pa.us> <3380133.1626207700@sss.pgh.pa.us> <584A570C-8B36-4A02-B8BC-2257DB5567A3@amazon.com> Comments: In-reply-to "Bossart, Nathan" message dated "Mon, 16 Aug 2021 20:14:25 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <987628.1629145092.1@sss.pgh.pa.us> Date: Mon, 16 Aug 2021 16:18:12 -0400 Message-ID: <987629.1629145092@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Bossart, Nathan" writes: > On 5/30/21, 10:22 AM, "Tom Lane" 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