Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opAr4-0007Oe-IO for pgsql-general@arkaria.postgresql.org; Sun, 30 Oct 2022 16:08:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1opAr2-0004Vf-AW for pgsql-general@arkaria.postgresql.org; Sun, 30 Oct 2022 16:08:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opAr1-0004VV-J3 for pgsql-general@lists.postgresql.org; Sun, 30 Oct 2022 16:08:07 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1opAqu-0002Wp-B5 for pgsql-general@lists.postgresql.org; Sun, 30 Oct 2022 16:08:06 +0000 Received: by mail-qt1-x831.google.com with SMTP id z6so6239919qtv.5 for ; Sun, 30 Oct 2022 09:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joeconway.com; s=google; h=content-transfer-encoding:in-reply-to:subject:from:references:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=0KJqaoUhkJJDO+qleqBIb1pBoHqLAJZ6wI54Tz5kQa4=; b=Kpo+WApgRmwAwWjMrQBSZ8iBK7zTU8keWjh4M9uYLGkknC/I13LPRFuxKqhgOLefYX 8q895/8cOrKhFBP7ahZNkOAY45d+PSx9AGMQXRHQA9+OOqFRo7n7f/0G2/HsaiB1yW5s CvEABIyVfqIutMLASrLRoMK+8Hh1NK1Q+me5KO5tCVoPtV/rnnNVPLsEkiAxFa+rpRnE e6M/iHLjVpn4uPq8zK3g2gsHi7Uuydz4Y1eKKMfk2jGK70pXspEKEaixqegzx1J4A3bV qaLqfXWiOk7V298KBzh4XbC6XFMoyrPIo8DFJvSQrdK5WFK0xjcjL7MnOqQWjSWon8EE 2Zbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0KJqaoUhkJJDO+qleqBIb1pBoHqLAJZ6wI54Tz5kQa4=; b=2JVXgb5zQiBZBTknYG6SANXJ3cIQxtLzzrrHJQnWzsxOf9X3Yxgvj6X6ycwJlYPriG iUg+rVzSjPJEOUjEwK2Ya81SnVDG5DwAYMw80VUFSFq7SdvdchYNDwoms0bSk2l37ubR P47uS1zChnUOkvZ6s1jjvvo8e4vmhqHRQcXep00XsLvhxdiWALYHn7Exrz+VPlBWJ7lP yz2liXF77+ULCS4qyZMkzZAcb/sstcZaP3bTbywQLBARYcdR4AXdptJ5FhthW8sl9tX8 DSFQ7pH12tC1+VLCwffir70IDu31jWfO/NejQu+k4P6fHY4SBjxWBzdeCxy/F4KuiDoM oZ9A== X-Gm-Message-State: ACrzQf3acn4TumNpIp2EcmXG1AfSXY49y01a7qE1FaqNua1bnzmNpxqM SxxfFVTN1bpAfawUjKCmvcpDntWC7JIvyNrTgtrgkNDgh8m8c2iSZkyuG8K/vAro8Ee9GzAEmMr vklpiSmT44/uEly1Lqueg2bB5QrlUoKzmxnqZacopHMWhyNuJOktWs9IL++FI8TdkmZPlgV5FSN raQ4QPe+em X-Google-Smtp-Source: AMsMyM7ynvlt88OQLXEu1aznIyWKp0SRqccX8vYK2vCHfKkKzgRf2svHvjwNXjM/GSyj51CFfgvlgQ== X-Received: by 2002:ac8:7ef3:0:b0:3a5:108b:4cc0 with SMTP id r19-20020ac87ef3000000b003a5108b4cc0mr6760517qtc.436.1667146079103; Sun, 30 Oct 2022 09:07:59 -0700 (PDT) Received: from [192.168.4.41] (162-239-31-113.lightspeed.dybhfl.sbcglobal.net. [162.239.31.113]) by smtp.gmail.com with ESMTPSA id n17-20020a05620a295100b006ce2c3c48ebsm3111531qkp.77.2022.10.30.09.07.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Oct 2022 09:07:58 -0700 (PDT) Message-ID: Date: Sun, 30 Oct 2022 12:07:58 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <20221027091800.u4nmh4cgtedb2iho@hjp.at> <20221027234116.kh3pxxxviwvg5gm7@hjp.at> <20221028202447.aoagwsal5j5ti5by@hjp.at> From: Joe Conway Subject: Re: Index corruption revealed after upgrade to 11.17, could date back to at least 11.12 In-Reply-To: <20221028202447.aoagwsal5j5ti5by@hjp.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/28/22 16:24, Peter J. Holzer wrote: > On 2022-10-28 17:23:02 +0300, Kristjan Mustkivi wrote: >> By the way, index rebuild while completing successfully did not fix >> the indexes - the data in the tables was still missing even after the >> successful rebuild command. > > This is surprising. As I understand it, REINDEX scans the complete table > and builds a new index. So after a REINDEX the index should be complete > and usable. > > However, reading > https://www.postgresql.org/docs/current/sql-reindex.html I'm unsure what > happens if you have issued a REINDEX for a table, schema, etc. and > rebuilding an index fails: Does it abort at that time or does it just > issue a notice and continue to rebuild the other indexes? In the latter > case it migh be easy to miss a problem. Debian 9 appears to be glibc 2.24 and Debian 11 is glibc 2.31. Therefore the issue here is almost certainly corrupt indexes due to the glibc changes. Note that some forms of the problem can manifest in primary keys or unique indexes that were valid in the original collation behavior, but contained duplicate rows according to the new collation. Those indexes would not be able to be reindexed without manual intervention. I don't know offhand what happens if you concurrently reindex an entire database and just a few indexes fail to rebuild, but I suspect as you mentioned above the failure might easily be missed and invalid indexes would be left behind. I think you will find both indisready and indisvalid false for these indexes. HTH, -- Joe Conway PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com