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 1wD7CB-002cjE-1O for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Apr 2026 20:50:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wD7C7-0026nh-1c for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Apr 2026 20:50:43 +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.96) (envelope-from ) id 1wD7C7-0026nV-0f for pgsql-bugs@lists.postgresql.org; Wed, 15 Apr 2026 20:50:43 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wD7C5-00000001CuO-0p5J for pgsql-bugs@lists.postgresql.org; Wed, 15 Apr 2026 20:50:42 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-35d90833cacso4363641a91.2 for ; Wed, 15 Apr 2026 13:50:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776286241; cv=none; d=google.com; s=arc-20240605; b=ZW6KfqxGjHPr0ihUDxjT6eH/QqqGiVmR36qiWWm89kBqgfSl1ZaW54btDZf5oZ5Vu8 HIKBN5+628+VbBrssvUS1qZ7RP0fDab0XD18i0SUCopoO3/Lp4xTd5gREVIeCCKUd17+ ni2t7UELtaUxNX/lefuy+O/HFfj2yJKEwKPjofl7gscoOWsT/VLXlTQOTBNN+ngcYl9v zOqLoQSe6CVAagCxq1ui/8T2NEO08cVI5uSHUvZB1iwW7GPmsDdJxaSg7NcVvdFbnAop iPnGW3as6x99YySAF+AaeEE+IV7U2vbFvXLsP0eGk69gXpLjI3gs4a5hOG2m+i0UAdFF XMgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SxI7BnNiIjmDBXrWKFJc9Jb0xSOS+HiO7seUVrcCRD0=; fh=eq4N0ZJ8hrEgR38nsBqR0qT98+sD9swSO80XeCQALy8=; b=dLa54JmdGgz32eF/JEhqo7DLokDB/Ov+j79xfW1+VZfiihS8kz/klivokwnLFF+kp2 QwBAT3XvTfP9kJfiKYRc8uCJsiZa3N69vL5tbeYb8D+1HpV3QDvGSoRdxeyL/RxwJX8g xxXMF+3JKxDk1qD5t4silXFrHcBo0YRyVCD0D/dj5WNm8coY8/FKZAu99hOAQXiIBRbU umyL58xjL0t5UjCtOK4ihNDX4iBQ4gzCTf3IHTEPPqW+8cpD/r+mygQ+CvEEG21jVURY tzcapwElcki6vJzg7HIfxC7oZF6ltNWiyavI9qCXeHPuGUex+CGyN90bPkennKpkivy/ 2b4g==; darn=lists.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=20251104; t=1776286241; x=1776891041; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SxI7BnNiIjmDBXrWKFJc9Jb0xSOS+HiO7seUVrcCRD0=; b=VobPr4MvbvbY+LR8efQzDGI4GSPzl0DSRotfPTj70AFnT75Gsnun7sxtztw+bUwa1k St6gKkgXWgU0Mx6qEYx3HxzxnTXBleNOhEwXymjkHwYcZoJvJ0Dj8utb8BAXsrGgh3rr n3lmEdlvufBzRAcn7DZdFtOH0t8Bg1MRXa0C/pozd1wk9gz7bJpLP8U9LtPT3jIOd30w x7rq4vQZD26LXWrat/7CVztnPUL7sWONwl/gjLF53BNdpMEPVnOW4cAewLDbru5BDhkQ A2cWndD9cnwNitOSJq1rlrp4HPgFEE2aaI1rJQh1WR2y30ht2+w1HXkTgbHCBZWdaMlj LxOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776286241; x=1776891041; h=content-transfer-encoding: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=SxI7BnNiIjmDBXrWKFJc9Jb0xSOS+HiO7seUVrcCRD0=; b=GsjcuUO4+6nJJ715t/waTzEM6rWKTguKWGKJgrnrrusEN6Q8mmjSIzwlE+604YeVXe m/gvW6qwetsCo82/Nm5NBIrlGys9Bhd9RDET8uieDBxJIzj6R4BuMaAPNyMweYM4/idS bRdddqzUEQMivqg9zRBQfNnxSGay5ByIn5x+9XzsaJ1TIBu1EX8lWwj0ONf/losIykIz IRf3X3oruJXavFLo8WD3X6e07L7iIFi3d3IJ3qmgCUFmSY1hdWdC/qMqbC+Nve2SIEDT etSxlhsDeMBXF/dZXKInvRTqlqc8nauY6nXwj2tbs4rLzKD/saaUQ5qg6z3/Qp01nNJ5 A9eg== X-Gm-Message-State: AOJu0YyaCrNS4nAWN3k/RQPz2E4efOYqkCj8mQscqq/kvcMOmZpPOdfP IvEls/nc/HRukjE1J2Z/QYhWPOK9DCLMR2KkNZXRhTGWwTunbF7HDyz2dEqhZSEvTUbzXfEKH7V Dk4vDYdGpXwLau8uz1DygtFAkMDcy4iIJ9Ibl X-Gm-Gg: AeBDieufJyXKyzonrgo7LnneTO0o0k6DBp+cNbtdNp0osWsqR/SG+ofHQn4j/zJs8Qa N2/upCtXomYMYVve60hYg/pVwfWcWispDaX/Tiz05gPq52u4N+lOl20g80mjkV8uHToFf8YOwSr TSQzslr+AU/8uVMogy6elEsIXjjWBOQKE1DLmRx4ml8V0bfyFDqqS56zO3IrioO6peASWCWl+6M KUOzZTmsT5BgbaMeTHA68tU9f9QApa1hEZIlpaTDiZyKjFfGvfCe7DOv/65XHAmTa2TZCbKGyyr m0vHmcPaqElagf0= X-Received: by 2002:a17:90b:510f:b0:35f:d61a:fe08 with SMTP id 98e67ed59e1d1-35fd61b0833mr2932213a91.24.1776286240720; Wed, 15 Apr 2026 13:50:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Masahiko Sawada Date: Wed, 15 Apr 2026 13:50:01 -0700 X-Gm-Features: AQROBzDntlHpgGhRz_yl9RkBLB_08C47yHueauHCfjlhY6oM7-eojBjeJlN6f0k Message-ID: Subject: Re: TRAP: failed Assert("offsets[i] > offsets[i - 1]"), File: "tidstore.c" To: Andrei Lepikhov Cc: PostgreSQL mailing lists Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 15, 2026 at 5:48=E2=80=AFAM Andrei Lepikhov = wrote: > > Hi, > > While experimenting with query plans, I periodically see test_tidstore > fail on the assertion in TidStoreSetBlockOffsets(). > > The cause is that the harness function do_set_block_offsets() forwards > the SQL array straight to TidStoreSetBlockOffsets(), which has an > explicit contract: > > "The offset numbers 'offsets' must be sorted in ascending order." > > array_agg() without ORDER BY gives no such guarantee, and plan shapes > that reshuffle the input can deliver the offsets out of order and trip > the Assert. > > The issue is minor and doesn't expose any underlying bug, but it is > still worth fixing: it removes a source of flaky test runs and makes > life easier for extension developers who reuse the same pattern. > > Patch attached. Thank you for the report. Could you provide the reproducer of the assertion failure? IIRC there have not been such reports on the community so far and the test should be included in the patch anyway. Regards, --=20 Masahiko Sawada Amazon Web Services: https://aws.amazon.com