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 1uXhth-00DQn9-5B for pgsql-general@arkaria.postgresql.org; Fri, 04 Jul 2025 15:00:17 +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 1uXhte-001Kjx-5S for pgsql-general@arkaria.postgresql.org; Fri, 04 Jul 2025 15:00:14 +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 1uXhtd-001KjR-L2 for pgsql-general@lists.postgresql.org; Fri, 04 Jul 2025 15:00:14 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uXhtb-005Yeu-1j for pgsql-general@lists.postgresql.org; Fri, 04 Jul 2025 15:00:12 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-553d52cb80dso971506e87.1 for ; Fri, 04 Jul 2025 08:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=element.io; s=google; t=1751641208; x=1752246008; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=3pTekT/j/r1mBkUp20EK5+cM54UerODJo+VZEoOMWKU=; b=4etvYrAgMb6ibmUEktvv/yzaApQUw+uHIL7RWV4RAyKJRFP3ec+fsijAbEAeS4Svax 0VOzgqcMgSFRXxSR5b5UhV91ydXZxf5GkzTmAg3BCU4kSqu/7vqXbUgnl8JXe61nHcOb CjlsrZeTdALz5nipvrHP7N3x/N7ZtY8qMVn9LSemcyKuR8WDJqtN7TsDm2RB//L2Dmb2 FfqLOvgBX+60CGEwOBrrH6RZF/QJDymQ3C4E2qsBMa9+sCsmZVVd3supTw+RtbdvHu2c bhFFTV7f8F9qsi3JceZjS2aus1+WhSdzqy49mFGeDWC0RZnVkZjFsRwCKzkU1obobJ4E wlOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751641208; x=1752246008; h=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=3pTekT/j/r1mBkUp20EK5+cM54UerODJo+VZEoOMWKU=; b=Xy1yIx8yKiMJ37gLYwYIGWUu65Sff0FpSaDIS17fOp3H5s+VHwnoupXJd9sQ0Lt/wn HZKgkVx47OqBIm0+Kk6eZrKv/34BpI3eaMJ0QKOA39Ye6+gUNIbI5b0OKLYpZ7SoZflg K175KbHdePkorPvKHh5w4a/eZzA4Z3imr2EyFkPQBSS7a5Dm2AV1X1JyuwBYwNxHxgKR JApEASW1fys5cumcEZEg0WOkhPChfHIxNtkqxvKmIEyVR9P2nPKFqbeDk5GOmueR3ECS u4YGZjPuk++GhGjqtyIMoQFZD5qWf5KeMW+zzFU8rE9cCzT4NqYVrYQqZuP6D6olcKzD JD4A== X-Gm-Message-State: AOJu0Yxt/sz7q/AYOtmEYLRPXxxISAKRfzEsAhrSQrz0ofv4IOjz5lKO 33LSd/lsA9ZTnb7xJVLJlk4eQZslNeC0G3yx3uwh04UI3ggZ5WVcYSpqsTFFeRfBM1evIq65A9S 71m+NoB6rsKFxQmfxFBuK06Zaq5fi76T0jR1wr0TGTmuNLOgDdZUYnhHKvJkvzDMZAlPgnaJTRE nnVULD6BVG4GJUFvqJ20h/ZIXgzNcJC5ocUoyB4V0hcJqAnkgyVCnAyA== X-Gm-Gg: ASbGncvavgOg/+txvNe3ScwbjdVbyqa53MVXESMb/4TG/Jtsszgq/xOfCqW2CdjpnZB 3auerZRYPl9ZKOYBkBAPCbmYI5d1GtvbHfVQji6cOIrn4+IvhHe4wrrCXzo4OxaQFIsIVnqo1u/ rmCms5AhdnZj2UYwHKOmh1gekrXSqLjXACDAx7EtpZvUHB0wC2uDaxnr9zE34bzfoGRjiEUa78Q 95PSg== X-Google-Smtp-Source: AGHT+IHwlIjWcBdN70cvYdAKp1bA6rRkxfHj5KR2vScCJ2mWD3g+ufJa4RgMo/qWcpNP6yRlMofZX2CVPOlCwGZv0HM= X-Received: by 2002:a05:6512:238e:b0:54a:c4af:15 with SMTP id 2adb3069b0e04-5565dfdf879mr1325184e87.19.1751641208274; Fri, 04 Jul 2025 08:00:08 -0700 (PDT) MIME-Version: 1.0 References: <01df0ca4-cf32-448f-a2cb-e44a8e9f7fd6@element.io> In-Reply-To: From: Erik Johnston Date: Fri, 4 Jul 2025 15:59:55 +0100 X-Gm-Features: Ac12FXxZA-xxBTbDn3VANu_2uvqS7olxPY8ExxRHHZDjyhLSNLx0NjjC9aq-P40 Message-ID: Subject: Re: Corrupt btree index includes rows that don't match To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000fe5f6706391bbf1b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fe5f6706391bbf1b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 4 Jul 2025, 15:38 Ron Johnson, wrote: > On Fri, Jul 4, 2025 at 9:49=E2=80=AFAM Erik Johnston w= rote: > >> Hi, a quick update: >> >> - We have discovered that the corruption was present from before libicu >> update. >> - We ran `pg_amcheck --index state_groups_state_type_idx --heapallindexe= d >> matrix`, which returned nothing >> - We believe that means that (and matches what we see sampling) the inde= x >> has gained extra entries, i.e. that for a given state group it does retu= rn >> all the relevant rows in the table *plus* extra rows. >> >> We are also seeing old state groups starting to point at rows that have >> only just been inserted. For example, querying for 353864583 on the prim= ary >> it returns that row plus four rows that have been inserted today, but on >> the backup from last week an index only scan for 353864583 only returns = one >> row. This makes it feel like the corruption is ongoing? Nothing should h= ave >> modified that state group in the interim (they are generally immutable). >> >> This naively feels like when inserting a new row we sometimes add the ro= w >> to the index twice: once pointing from the correct state group to the ne= w >> row, and once from an old state group to the new row? >> >> > Are checksums enabled in the instance? > Alas not. We've also now found that the index on the backup does in fact point to those ctids after all, but they are marked as dead. So at some point between then and when we inserted the new row at that ctid today those entries were marked undead. --=20 Copyright =C2=A9 2025 Element - All rights reserved. The Element name, logo= =20 and device are registered trademarks of New Vector Ltd. Registered number:= =20 10873661. Registered in England and Wales. Registered address: 10 Queen=20 Street Place, London, United Kingdom, EC4R 1AG. This message is intended=20 for the addressee only and may contain private and confidential information= =20 or material which may be privileged. If this message has come to you in=20 error please delete it immediately and do not copy it or show it to any=20 other person. --000000000000fe5f6706391bbf1b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable





Copyright =C2=A9 2025 Element - All rights reserved. The El= ement name, logo and device are registered trademarks of New Vector Ltd. Re= gistered number: 10873661. Registered in England and Wales. Registered addr= ess: 10 Queen Street Place, London, United Kingdom, EC4R 1AG.=

This message is intended for the addresse= e only and may contain private and confidential information or material whi= ch may be privileged. If this message has come to you in error please delet= e it immediately and do not copy it or show it to any other person.<= /span>

--000000000000fe5f6706391bbf1b--