pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Large objects and out-of-memory
Date: Fri, 25 Dec 2020 10:51:00 +0900
Message-ID: <X+VFhCg3dFJvsyX2@paquier.xyz> (raw)
In-Reply-To: <8044c223-4d3a-2cdb-42bf-29940840ce94@postgrespro.ru>
References: <7c57860c-fc05-143e-aa81-f11ca13ec00a@postgrespro.ru>
	<543675.1608575245@sss.pgh.pa.us>
	<8044c223-4d3a-2cdb-42bf-29940840ce94@postgrespro.ru>

On Thu, Dec 24, 2020 at 05:06:34PM +0300, Konstantin Knizhnik wrote:
> Also I noticed small inconsistency in inval.c:
> 
>     else if (msg->id == SHAREDINVALSNAPSHOT_ID)
>     {
>         /* We only care about our own database and shared catalogs */
>         if (msg->rm.dbId == InvalidOid)
>             InvalidateCatalogSnapshot();
>         else if (msg->rm.dbId == MyDatabaseId)
>             InvalidateCatalogSnapshot();
>     }
> 
> Here we are processing snapshot invalidation message but using structure for
> relation map invalidation.
> It doesn't cause problems because only dbId field is used and it has the
> same offset
> in SharedInvalRelmapMsg and SharedInvalSnapshotMsg structures.
> But it should be fixed.

Good catch.  It is very easy to miss that this is not "rm", but "sn".
I have checked the rest of this area and did not notice similar
errors.  I'll backpatch the attached if there are no objections.  This
may look cosmetic, but this would cause unnecessary conflicts if this
area gets touched and it would be hard to miss.  This comes from
568d413.  There may be a point in having a single call to
InvalidateCatalogSnapshot() as well..
--
Michael

Attachments:

inval-inconsistent.patch (text/x-diff, 620B) download diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index 628d6f5d0c..e7279d06a3 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -622,9 +622,9 @@ LocalExecuteInvalidationMessage(SharedInvalidationMessage *msg) else if (msg->id == SHAREDINVALSNAPSHOT_ID) { /* We only care about our own database and shared catalogs */ - if (msg->rm.dbId == InvalidOid) + if (msg->sn.dbId == InvalidOid) InvalidateCatalogSnapshot(); - else if (msg->rm.dbId == MyDatabaseId) + else if (msg->sn.dbId == MyDatabaseId) InvalidateCatalogSnapshot(); } else
signature.asc (application/pgp-signature, 832B) download

view thread (5+ messages)  latest in thread

Message-ID: <X+VFhCg3dFJvsyX2@paquier.xyz>
Permalink:  ../X+VFhCg3dFJvsyX2@paquier.xyz/
Also on:    postgresql.org/message-id/X+VFhCg3dFJvsyX2@paquier.xyz

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, k.knizhnik@postgrespro.ru, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
  Subject: Re: Large objects and out-of-memory
  In-Reply-To: <X+VFhCg3dFJvsyX2@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox