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 1pfnoU-0005nC-3x for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Mar 2023 20:15:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pfnoT-00079S-3N for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Mar 2023 20:15:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfnoS-00079J-Ec for pgsql-bugs@lists.postgresql.org; Fri, 24 Mar 2023 20:15:00 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfnoP-00064v-0V for pgsql-bugs@lists.postgresql.org; Fri, 24 Mar 2023 20:15:00 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B2ACD5C00DB; Fri, 24 Mar 2023 16:14:55 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute6.internal (MEProxy); Fri, 24 Mar 2023 16:14:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1679688895; x=1679775295; bh=uw osIoojU9qBkYOIM/QO+vp34nZsrDVZdAKByQ+znMA=; b=iR1xmkHVTWMafG+E+u GKREnqztXaCsMW56Nfo/GXC540DOMgUT8P7Zecte8qZorPDPr5C/MVn6kgVA7c6/ YIz5ASBOWXetRydDvlHgz4pAawIc3vom4Newlb/u9O/CfYVS6fvT10QAyhfktbZd qh+bsvkVdsu8kQWrmg61wFn0FuyFfnzZLe+WsvTctJSBS8W3WCM9268VkdVvnl5l uakiQUV03VB2iiWlFuKcSaE0FJ/X6yL5WZpIoi1VkC4M5yWgVja36gdj1Oscc3Fu WCktWnEVONUCOi8S0zQv+Y6HeJhSkfdWDj4wSdFr4zq8ohxlDt0K9tnh93TzNCH8 OtKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1679688895; x=1679775295; bh=uwosIoojU9qBk YOIM/QO+vp34nZsrDVZdAKByQ+znMA=; b=JcJFE2dRhu4LeIziSqvFzFRM/jK34 lL/INH7ll3KQEGJyExGY5vqybkQCVAsyC3l+pIPunqcnzbbHACNtnS976HfiCoqb CXpipgPGPyTl8tmTFGwep0WoVEwzwH+Pcu0WwsqrR1yGDvggYxI304Kj/R9ojyvi 9olulAPs/EksbrD2/bTRTITw+GGmSGDpUttLcpnr3UNt3XHB0sic3ookIGOAaF8K vk7obvhYsxBZ2QXpjNsnkjaISRP7mJuboAKmzaJhs4di8vT3pdazntDAqmPrQQSD lzd96UjOtxpqrYeBwTRztC2zp/WtSAS9kL/b0TpODyXAmUF5TnzP8NBgw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegiedgudefiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesrg dtreerreertdenucfhrhhomhepfdfguhhlvghrucfvrghvvghirhgrfdcuoegvuhhlvghr segvuhhlvghrthhordgtohhmqeenucggtffrrghtthgvrhhnpedtveelveekfedvgfefff fhheelueevuddvieetjeehudetjedvvdfhuefgudduudenucffohhmrghinhepghhithhh uhgsrdgtohhmpdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegvuhhlvghrthhordgt ohhm X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6A93115A008E; Fri, 24 Mar 2023 16:14:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-236-g06c0f70e43-fm-20230313.001-g06c0f70e Mime-Version: 1.0 Message-Id: <1df3c550-0506-48b6-8251-2af23b017ad9@app.fastmail.com> In-Reply-To: <17865-4eab2c1b76fede4a@postgresql.org> References: <17865-4eab2c1b76fede4a@postgresql.org> Date: Fri, 24 Mar 2023 17:14:34 -0300 From: "Euler Taveira" To: reynoldregan94@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17865: Logical decoding : JDBC - Out of memory exception (WAL2JSON Format -1) gives a wrong associated LSN Content-Type: multipart/alternative; boundary=97e0b294c860426db41e6d79c41bba58 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --97e0b294c860426db41e6d79c41bba58 Content-Type: text/plain On Thu, Mar 23, 2023, at 9:22 AM, PG Bug reporting form wrote: > This issue happens while reading from the logical replication slot (WAL2JSON > plugin). > When there are multiple sessions writing to Postgres tables and there is a > Postgres StringBuffer limit exceeded exception (processing transactions > greater than 1GB size), the associated LSN reported in the SQLException > object is incorrect. If you have a big transaction then it is a format 1 limitation. In this case, you have 2 options: * use write-in-chunks parameter. It is only available for format 1; * use format 2. Format 1 is the default but format 2 avoid issues with big transactions. > Now, the Java logical decoding API reading from the slot will fail with Out > of memory error while processing the session 2's transaction. Exception > object received contains irrelevant LSN marked as associated LSN. > Note: Incase of single session writing to the database the Associated LSN is > clearly of the failing transaction. > I know nothing about JDBC, if the options above does not solve your problem, I suggest that you ask in pgsql-jdbc mailing list. If after investigation, you conclude that it is a wal2json limitation/bug, open a issue [1]. [1] https://github.com/eulerto/wal2json/issues -- Euler Taveira EDB https://www.enterprisedb.com/ --97e0b294c860426db41e6d79c41bba58 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Thu, Mar 23,= 2023, at 9:22 AM, PG Bug reporting form wrote:
This issue happens while reading fr= om the logical replication slot (WAL2JSON
plugin). 
When there are multiple sessions writing to Postgres tables= and there is a
Postgres StringBuffer limit exceeded excep= tion (processing transactions
greater than 1GB size), the = associated LSN reported in the SQLException
object is inco= rrect.

If you have a big trans= action then it is a format 1 limitation. In this case,
you= have 2 options:

* use write-in-chunks para= meter. It is only available for format 1;
* use format 2.<= br>

Format 1 is the default but format 2 avoid = issues with big transactions.

Now, the Java logical decoding API read= ing from the slot will fail with Out
of memory error while= processing the session 2's transaction. Exception
object = received contains irrelevant LSN marked as associated LSN.
Note: Incase of single session writing to the database the Associated L= SN is
clearly of the failing transaction.

I know nothing about JDBC, if t= he options above does not solve your problem, I
suggest th= at you ask in pgsql-jdbc mailing list. If after investigation, you
conclude that it is a wal2json limitation/bug, open a issue [1]= .


--97e0b294c860426db41e6d79c41bba58--