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.96) (envelope-from ) id 1vsMUl-001INd-2C for pgsql-general@arkaria.postgresql.org; Tue, 17 Feb 2026 14:56:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vsMUk-00AKfe-0X for pgsql-general@arkaria.postgresql.org; Tue, 17 Feb 2026 14:56:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vsMUj-00AKfV-2k for pgsql-general@lists.postgresql.org; Tue, 17 Feb 2026 14:56:09 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vsMUh-00000001D3L-2MTE for pgsql-general@postgresql.org; Tue, 17 Feb 2026 14:56:09 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-662fc35291eso2221542eaf.1 for ; Tue, 17 Feb 2026 06:56:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771340166; cv=none; d=google.com; s=arc-20240605; b=iQt09KBqL+SiGf1rhpSVt1F4sDPNvRHhWLKmi8VdnZY9nGK9WaIf2lt6q/FNVzI+Gl zRwPEisQXsixJwo+uZcMxx9q7/K7EUFDAy83+wmFGQNVN/ksCe7xc2Wnqi4h/caBJTgj HXQqvwdMegcOs0yFvpdzaN+wG9aP8Pj4sCmgHbcBkkS8s9gO75arySiNJ3VI0nX1Zy93 d+oXx0/gn92k8Lz2zRIN7BC72ws4LO/xPIqPsR+Qrxc3yYMg3PYdmkV/8hg34GGe2Ote +X5pg42rvkMOSTtKkCEQs7qVpG8EZsB164Z5KhvgKK2zhEcJg//1QVF95AEbQsHemPQU 2qQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=1NVJFfmYMjKfqDRK7mrP9ne9xBqeJgZuDvhyu6QHRBo=; fh=nbJlscA1f4JT0MYFqURnr3M02zu34nlCGr68y/UJqUE=; b=bss0vz47VHY2wNnj8atRDcUDLwKow6ep1j4dUTBS1En4xiQZYIkcUT7atQarkyhrK0 Wph3XVdVQeNM/nL2/3t2E1rgmb6cjcB2qfFMjFDTP9QYAPh8e4GryKvfQJQo7w2VQ1wt A/hrikzcpFsHiNzYkGHegQYc05RAEghqFXzaKS2rnUSsX9evX8EZnp3+bCwL3Oyxhvlx MaxTA7+oCr0ZCBnG8RONnza4rYp1DfA63lJJ7wzejn02KHgJkmM8ZH202RvMDG0ldEOb Kf39hOrtv1mDWj1eDI2BsifwGyC8j8siKljo5OZrovZp5nTZciDjA5THRKecScb4INIv bZaQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771340166; x=1771944966; darn=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=1NVJFfmYMjKfqDRK7mrP9ne9xBqeJgZuDvhyu6QHRBo=; b=g6a1Q33jNeVFD0A4RH0Ws1A0PW4fNXfwq/MnibQkvOF4RkmaDEJNanY01CydbIkpQO OQHBEA5qYuzj3xrYp1ZrouE2ev0bh+0/H4OB4l0vV8bTneA/CRPiHJxBboAlth0Kji0R QqdMGdRt6wUiqhU11fbGgtY8znHxcwWNqRTOjGShO5h4ET6LN6NZZOuT3VLBUxMLom+A 9QnTVVokRfpgwg8Y1zQ2TdLCdDOPdkEK15nGwy4J88ygkC/mh+dyQzvviiuERJHT15jf TH9VszEUToAfjpxHfttoqwy/2b6c1QSO29mx1lBs8c0qr1hCFZk2ZtrAvWAvneLxTZQZ Eenw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771340166; x=1771944966; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1NVJFfmYMjKfqDRK7mrP9ne9xBqeJgZuDvhyu6QHRBo=; b=BRuE97o6PabIyVTB9uP5bPqLhPf/Z1x1AAi3OeGiJzjAPCyN8ndzGUfy3TowbOZK8d EauJv8mvejo/Zn41lbjy9otBGxoQK8xb5fRl72xrvcCzUQWbnPQ/272I6psHwHiwQICo Z/fH30k5g7IxZTvYYG1MphDSOgPlbVSlxF1b8ebe0drhLh1TE+LwlwzNO3cuIT+RTxF/ E6iQpgN7hdqi39tm0FEFa5vl/CekiR+c33pDdFkfPWAYrvp+YBsHYZuGhTkJXBQd0Rox C5rwGDnawVzbpYMjSIkQ7bzVbpzG/fQhINylG5B5jLbbTYxM89zIC3SuxhRorETyxWuQ ON2w== X-Gm-Message-State: AOJu0YzU8kt+Ppg2povSyrULOtHVOFz6fSv4JMK6yGIXIe4/RZlFDOwO exjK7SDC3N92u//yKxPkAQjZ6+8+KiWhLV3FZMr/KK0+N8SoScDeJ60eEsCCz305RJJeLe+fDGq EvjuJn4YAa9LZXearZuDYuygs8A7HkEA= X-Gm-Gg: AZuq6aLw9HoEqjHUGbJcxfqD5o2uzNvrG34HXu00uQLl9cX193Sd+zMTuXfdoZ45dYV hRUArePn74cLf2f4Bd4KwcKl+OoCDPkEbXxDqKI67bnm8zJz/J8l11ykTRSUAmEulnVRCHrcmpi wSbH+rlWK1c/nbExfKH//6gdamiL+BzmAkmeNWq9rdO0UYrBdeMNNlQQpQtlzLRR4PdHwiXg9An orELudkr4S3CtJ6TBMx10pHS67FhdfupoVEz8HNUw4beLMzMQYVjikAeTtEeuoBqQKs52yR5yMX 2E2oBY7fK9Qxxw296M7WvxGc/M4OOC2/5+k5dXOvjA== X-Received: by 2002:a05:6820:1990:b0:679:9366:9788 with SMTP id 006d021491bc7-67993669b42mr2653303eaf.83.1771340165633; Tue, 17 Feb 2026 06:56:05 -0800 (PST) MIME-Version: 1.0 References: <93fb937f-9f4d-4bd7-b7e6-51d5f98859d9@posteo.de> <14506.1770844674@sss.pgh.pa.us> <101916.1770850197@sss.pgh.pa.us> <777cfa1c-fd1f-479f-b9b8-217b0f7a40b7@posteo.de> <87ca8c2c-6826-44d1-8a31-a5f793a2729e@posteo.de> In-Reply-To: <87ca8c2c-6826-44d1-8a31-a5f793a2729e@posteo.de> From: Greg Sabino Mullane Date: Tue, 17 Feb 2026 09:55:30 -0500 X-Gm-Features: AaiRm51DnNTt_kgZgie8Zr0FkdxF0hbqsbeM9ajqcvFiiNhSiQC-Ueg4o6iltd8 Message-ID: Subject: Re: Guarantee order of batched pg_advisory_xact_lock To: Nico Heller Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="000000000000595cf1064b064582" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000595cf1064b064582 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 16, 2026 at 12:45=E2=80=AFPM Nico Heller wrote: > Does anyone have any idea what the root cause of my issue is? I appreciat= e > any insight. > As I said, hash collisions can be rules out, sadly. > Well, you could set log_statement to 'all' for a bit to see *exactly* what each of the deadlocking processes are doing. Alternatively, perhaps you can write a hashextendedkey() function that outputs arguments and results to a log and/or a table. keysToLock is a text[] parameter which is pre-sorted in our application Would not hurt to triple-check this part as well. Could show us the app code? Maybe put in some sort of global assert in the app to verify that things are indeed sorted as you think they are. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --000000000000595cf1064b064582 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Feb 16, 2026 at 12:45=E2=80= =AFPM Nico Heller <nico.heller@= posteo.de> wrote:
=20 =20 =20

Does anyone have any idea what the root cause of my issue is? I appreciate any insight.
As I said, hash collisions can be rules out, sadly.


Well, you could set log_statement to 'all'= for a bit to see *exactly* what each of the deadlocking processes are doin= g. Alternatively, perhaps you can write a hashextendedkey() function that o= utputs arguments and results to a log and/or a table.

keysToLock is a text[] parameter= which is pre-sorted in our application

Would not hurt to triple-check this part as well. Could show us the app = code? Maybe put in some sort of global assert in the app to verify that thi= ngs are indeed sorted as you think they are.


<= /div>
Cheers,
Greg

--
Enterprise Postgres Software Products & Tech= Support

--000000000000595cf1064b064582--