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 1rrheQ-0029HT-7W for pgsql-admin@arkaria.postgresql.org; Tue, 02 Apr 2024 17:10:22 +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 1rrheP-00ADmm-3O for pgsql-admin@arkaria.postgresql.org; Tue, 02 Apr 2024 17:10:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::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 1rrheO-00ADme-KK for pgsql-admin@lists.postgresql.org; Tue, 02 Apr 2024 17:10:20 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rrheH-000DbZ-Mb for pgsql-admin@lists.postgresql.org; Tue, 02 Apr 2024 17:10:19 +0000 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2d6ee6c9945so40719001fa.3 for ; Tue, 02 Apr 2024 10:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712077812; x=1712682612; 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=66mKfmaGD3HBaKjX+ompVl6519Sc3qlVv5Mkav7xboM=; b=UsZkkGRpCBVx8NqXBhHZpCJ3VluU7LDyGwQxLTA0YBC2/0AQSnlcWZQu2ciokieCeD ASq4TPE5dpZBlOhrzQMqaNQ+Qa1kb//h5ctQhj08KCoQIXBWNp6BW4AlzY6GSU6ZMcaI KJeKJx94haOjx9erj56xuPDRZkO1U4r3n7AmHWSPp0VVTcVO7ZQkD6lsKcbpqzutlywH t1KqhWRcTUSKwpqObZMOxDvtDwQ4hOiGE1ynxcoSY7siagPXCiXwGJgMWcjXS2hBAOTg 6Dvf0s0wH44/HNxTUG3EFQlVyvgxuBtdWP4u20BuQrufaw9nindf542N2BGC63q/g01e ENpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712077812; x=1712682612; 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=66mKfmaGD3HBaKjX+ompVl6519Sc3qlVv5Mkav7xboM=; b=kq8PWRpADiONNfhYhMBKM1Pa486XC+PgaF2tBZoqf86lauuLI3bI8B3kaQWmPA8lEv ArccanlrW0zXYXk9Cn5PoviDhQusujCbWzllWn6OF+4+VBegNXQ6MAdNcQVire2TrfgT yMeGD8y0dBuQutxqMHbd/PFh1b+iR7lqOm2lAX7nnrxrSH7PBdIegANe1DqNIoSdwtdG VAXWne4QtGCsnpbA7Pac2Xs+zhLz3UUQ54d/PUxo61GX/yjv6SbY/vusYkmB/xXrMjE/ qi30SUXIzOrVswEn66xZbsDHbTRBNProCAzh9ylMw+qG1vVxTM7C9W0MnWaxNeqOwoMR PIag== X-Gm-Message-State: AOJu0YxiZFeuxWTqpak7g/BUmgwhoBqEIbhEbg99TPTZwZgRrSG2bBBq 7XDUokBOxfqNTtUevcjsA9HIs4LcWSLMs+5tCY3iDI5WAiIXw1FQAT71gNxwge0NRDPQ5Vm+/Qz wGQcN/W3wbWz72gXKJhpWVs5vfH8= X-Google-Smtp-Source: AGHT+IFmglCrPsbWU2F/UzvWvU+jmsjzFubi8V1qicxJz/EQN7JQFl+YEpmM0v9LA/vV7enUIVgZc9/stE4wD/2O+LA= X-Received: by 2002:a2e:98d8:0:b0:2d8:d6c:81fb with SMTP id s24-20020a2e98d8000000b002d80d6c81fbmr167748ljj.37.1712077811669; Tue, 02 Apr 2024 10:10:11 -0700 (PDT) MIME-Version: 1.0 References: <58661f82-620c-8116-efe7-23266578289c@jakobs.com> In-Reply-To: <58661f82-620c-8116-efe7-23266578289c@jakobs.com> From: Rajesh Kumar Date: Tue, 2 Apr 2024 22:39:58 +0530 Message-ID: Subject: Re: Deadlock To: Holger Jakobs Cc: Pgsql-admin Content-Type: multipart/mixed; boundary="000000000000caf41e0615202dbb" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000caf41e0615202dbb Content-Type: multipart/related; boundary="000000000000caf41d0615202dba" --000000000000caf41d0615202dba Content-Type: multipart/alternative; boundary="000000000000caf41c0615202db9" --000000000000caf41c0615202db9 Content-Type: text/plain; charset="UTF-8" Yes, I am trying to find out what message i should reply if I receive email with deadlock notification. I understand how deadlock occurs, hot to find them in logs, prevention of deadlock(ex: oqueries in order) etc. But since the deadlock_timeout is 1s, they don't probably hang around. So post getting an alert, not sure what to respond to them On Tue, 2 Apr 2024, 22:15 Holger Jakobs, wrote: > Am 02.04.24 um 18:40 schrieb Rajesh Kumar: > > Hi > > If I receive an alert for deadlock, what should I do? Like what analysis > should I do? No way to find a root cause? > Under pg_locks, what I can analyse? > > If you receive an error with a deadlock, the current transaction is dead. > You have to decide whether to try again. > > Within the error message you find a hint which other (not aborted) > transaction was involved in the deadlock. So you have all the information > you need to find the culprit. > > Regards, > > Holger > -- > > Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012 > > chat with me on Signal messenger > > --000000000000caf41c0615202db9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes, I am trying to find out what message i should reply = if I receive email with deadlock notification.

<= div dir=3D"auto">I understand how deadlock occurs, hot to find them in logs= , prevention of deadlock(ex: oqueries in order) etc.

But since the deadlock_timeout is 1s, they don= 't probably hang around. So post getting an alert, not sure what to res= pond to them

On Tue, 2 Apr 2024, 22:15 Holger Jakobs, <holger@jakobs.com> wrote:
=20 =20 =20
Am 02.04.24 um 18:40 schrieb Rajesh Kumar:
=20
Hi

If I receive an alert for deadlock, what should I do? Like what analysis should I do? No way to find a root cause?
Under pg_locks, what I can analyse?=C2=A0

If you receive an error with a deadlock, the current transaction is dead. You have to decide whether to try again.

Within the error message you find a hint which other (not aborted) transaction was involved in the deadlock. So you have all the information you need to find the culprit.

Regards,

Holger

--

Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
3D""
chat with me on Signal messenger

--000000000000caf41c0615202db9-- --000000000000caf41d0615202dba Content-Type: image/png; name="TapMuhNyQVuzuVPA.png" Content-Disposition: inline; filename="TapMuhNyQVuzuVPA.png" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: ii_18e9fc43962e589cfdf1 iVBORw0KGgoAAAANSUhEUgAAAIcAAACHAQMAAAAGKdhJAAAABlBMVEUAAAD///+l2Z/dAAAAAnRS TlP//8i138cAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAG5SURBVEiJ3da7bcMwEAbgM1iwkxYQwDXY cSVpAT0WkFdixzUIcAGqY0Hw8suJHSCNzkCKIIKg4isI3tMm/vnQP5FMtIQ4lbr4SmSEcnCdHa/W 7FQXFosfcEjvK76jfkNmp+6Bm35XqNOxs+8II8ahsxEXeEVxKcjPFIbP95WxS8FzFN5dJP1dnUvJ mm5sVocviiIV5pStyna4FcRrhJItTQUpqrMeehaLVk3TaIlcHZ1Umq2owsQ0OvrMqkQOhEn1Fs5I +yCVRnEJidHSIZKVChdeiXer2nkTFko7a2cOTluJX1EIJGtzLwqzs7q6BKngnNtjEJp+RiGQrNN6 1kLt1qDZhMIlzrb2xdwx5l/5uZaMWmOHWLOFODupsI/kUnaohWpWKkdJ94L+xM2xTFgojQY0f3Np 47gUIxT2iYvKp6RdS+Xw1PthdI9ZIKk0m45AHSHM550FchSaPGqhDsYgSAVPxuwU9BjqboRy7jpO 6OfshtFKBXt1tKh+ajiHxXImxzCrHeuuvCEzqc2rVfP22JBCwa7DT+GIIj7PuRY+V1ZHmAU0AAvl zA9qwQYLeXpl9Up+61/B35IPLEvZkYbCln8AAAAASUVORK5CYII= --000000000000caf41d0615202dba-- --000000000000caf41e0615202dbb Content-Type: image/png; name="TapMuhNyQVuzuVPA.png" Content-Disposition: attachment; filename="TapMuhNyQVuzuVPA.png" Content-Transfer-Encoding: base64 Content-ID: <> X-Attachment-Id: iVBORw0KGgoAAAANSUhEUgAAAIcAAACHAQMAAAAGKdhJAAAABlBMVEUAAAD///+l2Z/dAAAAAnRS TlP//8i138cAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAG5SURBVEiJ3da7bcMwEAbgM1iwkxYQwDXY cSVpAT0WkFdixzUIcAGqY0Hw8suJHSCNzkCKIIKg4isI3tMm/vnQP5FMtIQ4lbr4SmSEcnCdHa/W 7FQXFosfcEjvK76jfkNmp+6Bm35XqNOxs+8II8ahsxEXeEVxKcjPFIbP95WxS8FzFN5dJP1dnUvJ mm5sVocviiIV5pStyna4FcRrhJItTQUpqrMeehaLVk3TaIlcHZ1Umq2owsQ0OvrMqkQOhEn1Fs5I +yCVRnEJidHSIZKVChdeiXer2nkTFko7a2cOTluJX1EIJGtzLwqzs7q6BKngnNtjEJp+RiGQrNN6 1kLt1qDZhMIlzrb2xdwx5l/5uZaMWmOHWLOFODupsI/kUnaohWpWKkdJ94L+xM2xTFgojQY0f3Np 47gUIxT2iYvKp6RdS+Xw1PthdI9ZIKk0m45AHSHM550FchSaPGqhDsYgSAVPxuwU9BjqboRy7jpO 6OfshtFKBXt1tKh+ajiHxXImxzCrHeuuvCEzqc2rVfP22JBCwa7DT+GIIj7PuRY+V1ZHmAU0AAvl zA9qwQYLeXpl9Up+61/B35IPLEvZkYbCln8AAAAASUVORK5CYII= --000000000000caf41e0615202dbb--