Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srGES-0005yy-KU for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2024 12:26:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1srGDS-000A3D-Ao for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2024 12:24:59 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srGDR-000A2z-Vr for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2024 12:24:59 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1srGDP-0000rA-Gs for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2024 12:24:58 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2f7657f9f62so8625381fa.3 for ; Thu, 19 Sep 2024 05:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726748695; x=1727353495; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JomqIrc1EIe8BHDvU1rg2cDf3AE1triHvSCLCx84a7E=; b=l8nkgCAU6E6zb7N+fcKfsVBF9XnHF8pEoogBPWva0X3tX/kEMx/JCZaRPK3on6GfTN Q6gNplBedZcwj7NqBXRgxe2iCIGsnv+3devxJ7dGPP02Vd4Z9l0+/cPC2ikr5HKY96y+ 6gvGI7tjPz+5gclFF7khFgkf/1nNcT3b2Py2U0eUu1v7r1UWOxegBlPu8gw6b1y4Sz9p TDBBmUILhWLkI2SHs0HxvWTSZ0qq71jmWXUb2gTbqBI1deLvBaNhd67pw4R2AuPAEyoX vzZV5kek67CSrw7hz6XTD34EuhKWSHtLcnhN2zA3HOVa/Jn+b7g0GY/lwJY2R7I56pos ZAIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726748695; x=1727353495; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JomqIrc1EIe8BHDvU1rg2cDf3AE1triHvSCLCx84a7E=; b=sfNNRK+ihzkZ7lKxeye8qFbO7DXXd+JNHkUM7nrqeB5eg9CPPUrKKeR5FpR6rNOj4U GquTTw9w8j6sYyZlBCMGsfboBOBOq3Giyjt09J+STdY18Ym6Lf3bYsEzv+6hh5qvInJI YBY9mdmzHi8+4grVsdFmnJRVEEBYGqtXtZ99HcA0lYtTSamN5K7O854yG8uc/AeHKjW4 Ug7/AM5cCpm37jsOxXHMbUV/i5Y0VgQnxLXlCtwANckRYOFwsmbX1eX3+Z1Fnjr2NRAR VA55vbLlwS+iqC+OhP5xlYRo9zOM1+AU63BSigSgxKrlUQvBC6YMkE66UgfsOMFrV6KT wzFA== X-Forwarded-Encrypted: i=1; AJvYcCXLe6tG+mrhXOzaxL6XOtNzG6GgVWvDej48fUL4JnfIPUZciL8VjGDvw3wSEcw3tyl4s0Wb55XAJedphVU4@lists.postgresql.org X-Gm-Message-State: AOJu0YweqGLFNZNhE5kwl7MMgWKuWEsgdaeeJ6pJlQtjTcvatbItrqVr byMa1ZX1qAVkH4PUnKKu6SgSO/1URVmhr9/Bn1UJGNaqnngo2ISd3FblxkqapWZjL2Gj0IcHexF I44nKjg2V0krrCIRp92pnc7/4A+4= X-Google-Smtp-Source: AGHT+IGWs/ODzn5EuRlBV5MHjRYAGfQN5hNjSOEf1eKJVcNi/Al1cN7OV3WpROmk/4zj1kcz2KdMvylmeuNbyVrzXsA= X-Received: by 2002:a2e:4e11:0:b0:2f7:4fac:f695 with SMTP id 38308e7fff4ca-2f787dbf6e6mr118089981fa.14.1726748694805; Thu, 19 Sep 2024 05:24:54 -0700 (PDT) MIME-Version: 1.0 References: <3dddea5e-52ab-4075-970d-a87b0c921ae7@aklaver.com> <225d1bc1-5117-4c72-85a1-bac6355fb659@aklaver.com> <586d988d-978b-4b08-84b4-ef3ebb8736a8@aklaver.com> In-Reply-To: From: Greg Sabino Mullane Date: Thu, 19 Sep 2024 08:24:19 -0400 Message-ID: Subject: Re: IO related waits To: veem v Cc: Adrian Klaver , Christophe Pettus , pgsql-general Content-Type: multipart/alternative; boundary="000000000000920b2f0622780276" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000920b2f0622780276 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 19, 2024 at 5:17=E2=80=AFAM veem v wrote: > 2024-09-18 17:05:56 UTC:100.72.10.66(54582):USER1@TRANDB:[14537]:DETAIL: > Process 14537 waits for ShareLock on transaction 220975629; blocked by > process 14548. > You need to find out exactly what commands, and in what order, all these processes are doing. Deadlocks can be avoided by rearranging your application logic. > 2024-09-18 17:05:56 UTC:100.72.22.33(54582):USER1@TRANDB:[14537]:ERROR: > current transaction is aborted, commands ignored until end of transactio= n > block > 2024-09-18 17:05:56 UTC:100.72.22.33(54582):USER1@TRANDB:[14537]:STATEMEN= T: > INSERT INTO TRANDB.EXCEP_TAB (...) > 2024-09-18 17:05:56 UTC:100.72.22.33(54582):USER1@TRANDB:[14537]:ERROR: > current transaction is aborted, commands ignored until end of transactio= n > block > 2024-09-18 17:05:56 UTC:100.72.22.33(54582):USER1@TRANDB:[14537]:STATEMEN= T: > > 2024-09-18 17:05:56 UTC:100.72.22.33(36096):USER1@TRANDB:[14551]:ERROR: > current transaction is aborted, commands ignored until end of transactio= n > block > Fix your application. It should be checking that each command completed and not just blindly pushing on to the next statement while ignoring the error. This is really difficult to diagnose from afar with only snippets of logs and half-complete descriptions of your business logic. Pull everyone involved into a room with a whiteboard, and produce a document describing exactly what your application does, and how it is doing it. Switch from reactive to proactive. Cheers, Greg --000000000000920b2f0622780276 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Sep 19, 2024 at 5:17=E2=80=AFAM v= eem v <veema0000@gmail.com>= ; wrote:
2024-09-18= 17:05:56 UTC:100.72.10.66(54582):USER1@TRANDB:[14537]:DETAIL: =C2=A0Proces= s 14537 waits for ShareLock on transaction 220975629; blocked by process 14= 548.

You n= eed to find out exactly what commands, and in what order, all these process= es are doing. Deadlocks can be avoided by rearranging your application logi= c.
=C2=A0
2024-09-18 17:05:56 UT= C:100.72.22.33(54582):USER1@TRANDB:[14537]:ERROR: =C2=A0current transaction= is aborted, commands ignored until end of transaction block
2024-09-18 = 17:05:56 UTC:100.72.22.33(54582):USER1@TRANDB:[14537]:STATEMENT: =C2=A0INSE= RT INTO TRANDB.EXCEP_TAB (...)
2024-09-18 17:05:56 UTC:100.72.22.33(5458= 2):USER1@TRANDB:[14537]:ERROR: =C2=A0current transaction is aborted, comman= ds ignored until end of transaction block
2024-09-18 17:05:56 UTC:100.72= .22.33(54582):USER1@TRANDB:[14537]:STATEMENT: =C2=A0
2024-09-18 17:05:56= UTC:100.72.22.33(36096):USER1@TRANDB:[14551]:ERROR: =C2=A0current transact= ion is aborted, commands ignored until end of transaction block

Fix your application. It should = be checking that each command completed and not just blindly pushing on to = the next statement while=C2=A0ignoring the error.

= This is really difficult to diagnose from afar with only snippets of logs a= nd half-complete descriptions of your business logic. Pull everyone involve= d into a room with a whiteboard, and produce a document describing exactly = what your application does, and how it is doing it. Switch from reactive to= proactive.

Cheers,
Greg

<= /div>
--000000000000920b2f0622780276--