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 1kscGA-0005lX-95 for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Dec 2020 01:51:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kscG9-00088u-6s for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Dec 2020 01:51:13 +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 1kscG7-00088h-VD for pgsql-bugs@lists.postgresql.org; Fri, 25 Dec 2020 01:51:13 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kscG2-0000Hb-BE for pgsql-bugs@lists.postgresql.org; Fri, 25 Dec 2020 01:51:10 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 377BD5C0054; Thu, 24 Dec 2020 20:51:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 24 Dec 2020 20:51:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=SxMJpYIfzSAX7BD6kuU2kfHnGzJ nO2zeZjlCxOBsra8=; b=oUILl3fndiXFx7gHY2ebBk0VcmH9fzJleiwV2R7iaNt uIHCPfay7ALXJtVBIjqqz38siVuRcsYUoVM8EWTT7xidWpFAJVyKEDuTRcoLq1vm ql5gpQsdnbNQch2eBZYmcw+VG5jAJ/SpNjjQHx+DLoDkj2qYwa9SCfBkH3QkTcjh 7edYyzToHnnn11qZTAFKy/FrOR/TM2PovKASwa/ooBUlrYJ+qwnT/zlZFMLqZAjO FBUl8l+12pvKVn63jcRgpWosYclnklWYgN/Eper9e/EhEG1M00Y2AQBFDTH5aOge 1eKe32gnE8CqzV2wn+4Aggwac1Pv+h/5eu8xzLcCSpw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=SxMJpY IfzSAX7BD6kuU2kfHnGzJnO2zeZjlCxOBsra8=; b=GROxDFUWtvqmJTyXKf9Mvw eVVTlnxTTSsJGqYdWKWRjnGn1Qti4i08yDh+9CLSIf/WB9GeGX2DaEavyeGEv5fW yVOm7sik3F7qLm4l3ZWYrhWfxPzD/0YsDTo5qASWl5Q+471SS5riASwwwzVV+uBV jktzYH8oZDnFnlGqktmfcS8XnHM0CMydDw8C344tP/f3c3WlB4gCdx8hLbN5zOrJ dK6uDzMLANbFrhchigl5cwmFpOL6QkgkT+BMCz101GrAJo1lna5y1qZT/u61xJpm lMPkAPfr9DlVuADYt/O2AyGbrmNi5yaeeXTBdThZH4yWdaeVGrU07sy2M7U9NDhA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddutddgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt udenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeevtdfgkeduudeuveetfeeggfej uddvtdetuefhleeuffeukeeihfejgfeigeduleenucfkphepudduuddruddtvddrudektd drudekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 47356240057; Thu, 24 Dec 2020 20:51:03 -0500 (EST) Date: Fri, 25 Dec 2020 10:51:00 +0900 From: Michael Paquier To: Konstantin Knizhnik Cc: Tom Lane , pgsql-bugs@lists.postgresql.org Subject: Re: Large objects and out-of-memory Message-ID: References: <7c57860c-fc05-143e-aa81-f11ca13ec00a@postgrespro.ru> <543675.1608575245@sss.pgh.pa.us> <8044c223-4d3a-2cdb-42bf-29940840ce94@postgrespro.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AsGhKi797xIiwjG5" Content-Disposition: inline In-Reply-To: <8044c223-4d3a-2cdb-42bf-29940840ce94@postgrespro.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --AsGhKi797xIiwjG5 Content-Type: multipart/mixed; boundary="kbzH979j2fmPgWKU" Content-Disposition: inline --kbzH979j2fmPgWKU Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 24, 2020 at 05:06:34PM +0300, Konstantin Knizhnik wrote: > Also I noticed small inconsistency in inval.c: >=20 > =A0=A0=A0 else if (msg->id =3D=3D SHAREDINVALSNAPSHOT_ID) > =A0=A0=A0 { > =A0=A0=A0 =A0=A0=A0 /* We only care about our own database and shared cat= alogs */ > =A0=A0=A0 =A0=A0=A0 if (msg->rm.dbId =3D=3D InvalidOid) > =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 InvalidateCatalogSnapshot(); > =A0=A0=A0 =A0=A0=A0 else if (msg->rm.dbId =3D=3D MyDatabaseId) > =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 InvalidateCatalogSnapshot(); > =A0=A0=A0 } >=20 > 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 --kbzH979j2fmPgWKU Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="inval-inconsistent.patch" 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 --kbzH979j2fmPgWKU-- --AsGhKi797xIiwjG5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl/lRYQACgkQnvQgOdby QH1Mdw//YJq2NuXSVt3gFB/vbrXkRF/jV/eIeMuCgxMTTLfFzBSKWk/iDbABRsaI TcqfIgZmPE5DH3jUGFEZ7jZMaxiuq7wWPaPHRi3oHyS80Zp5MoETP4rCssmcGTp6 NqWFy45ToT2YQ/67S90a5xIQJXBNwGETO7KYzpjER81r7GfPzOuhCt4H/I7Hxio7 GxH05RxPcf719NNHY5bB2Wax3CEgtoov7AjHZkrZlicxdS18zDpbQLsbTAtnneSw wvPaSlbPUvS2yZqPvTLl9Q+xRo64+vMSFsuB1LQlaFwR5CgM2Il3gB7QopWQHKmU rvnIq6AWVnJZmRRo6S73YhSGJtxM4AEHThwBYDx13PPNZwxMhpIashJ6sZPKit1b hSSwM2N6SRuIJfhF1Tv/LfAsIpcr3UgiBXba2w5t6XHQZJjr+nSa1kvvBomTocRc l9hCa3eFNzovpDwtWg0oXUlNZ51mOo/9AZfI8y7GwL7hlvLTqnVqozWrc7Jz4ud9 cZ1pDKuYu73nfF4nPZVJ+qmeiQdfV/vvn1hQn+xBYmBkLXri/1arfH+j8YaKdF85 yBVos1LAfjGSk4zVf87xOnt9zNgsoZwwO73k4EzzdQVt7/v1xsGNGSOcyKnoHNop JvvQPCkUw/7NwwRf21gKtc5F7ld6You02z4ezFRYdR329toaHOQ= =df9N -----END PGP SIGNATURE----- --AsGhKi797xIiwjG5--