pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Index corruption revealed after upgrade to 11.17, could date back to at least 11.12
Date: Sun, 30 Oct 2022 12:07:58 -0400
Message-ID: <ee36247e-d0e4-8f5f-5def-2fea9d0044e4@joeconway.com> (raw)
In-Reply-To: <20221028202447.aoagwsal5j5ti5by@hjp.at>
References: <CAOQPKavKxwFnRF4-D+fZY4=+4vKW=xi_SKTXpX853zGLt2-Ceg@mail.gmail.com>
	<CAF3N6oRT7OXHfuGXe2aMPoXzB5YANke0dXGetmzWc0MXXwQ8dQ@mail.gmail.com>
	<CAF3N6oS6L0r=sw6PhSZDO0KL4kc9xoSGnU=qs2cvj6d+WRzRCA@mail.gmail.com>
	<CAOQPKat5RxaXFX5RPndGXYk4AiP6mrMC3r1SrpLd3BBLYA6G3w@mail.gmail.com>
	<20221027091800.u4nmh4cgtedb2iho@hjp.at>
	<CAOQPKaut-MBc6Z5q9ZasBwtgOXpRO7AR+QzNeuwMt-4-pZTLSA@mail.gmail.com>
	<20221027234116.kh3pxxxviwvg5gm7@hjp.at>
	<CAOQPKat61iG2=LLG6q_jE+T_i2s-0YMZfo8wJUE-ejG1=w7Adg@mail.gmail.com>
	<20221028202447.aoagwsal5j5ti5by@hjp.at>

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






view thread (12+ messages)

Message-ID: <ee36247e-d0e4-8f5f-5def-2fea9d0044e4@joeconway.com>
Permalink:  ../ee36247e-d0e4-8f5f-5def-2fea9d0044e4@joeconway.com/
Also on:    postgresql.org/message-id/ee36247e-d0e4-8f5f-5def-2fea9d0044e4@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: mail@joeconway.com
  Subject: Re: Index corruption revealed after upgrade to 11.17, could date back to at least 11.12
  In-Reply-To: <ee36247e-d0e4-8f5f-5def-2fea9d0044e4@joeconway.com>
  References: <CAOQPKavKxwFnRF4-D+fZY4=+4vKW=xi_SKTXpX853zGLt2-Ceg@mail.gmail.com> <CAF3N6oRT7OXHfuGXe2aMPoXzB5YANke0dXGetmzWc0MXXwQ8dQ@mail.gmail.com> <CAF3N6oS6L0r=sw6PhSZDO0KL4kc9xoSGnU=qs2cvj6d+WRzRCA@mail.gmail.com> <CAOQPKat5RxaXFX5RPndGXYk4AiP6mrMC3r1SrpLd3BBLYA6G3w@mail.gmail.com> <20221027091800.u4nmh4cgtedb2iho@hjp.at> <CAOQPKaut-MBc6Z5q9ZasBwtgOXpRO7AR+QzNeuwMt-4-pZTLSA@mail.gmail.com> <20221027234116.kh3pxxxviwvg5gm7@hjp.at> <CAOQPKat61iG2=LLG6q_jE+T_i2s-0YMZfo8wJUE-ejG1=w7Adg@mail.gmail.com> <20221028202447.aoagwsal5j5ti5by@hjp.at> <ee36247e-d0e4-8f5f-5def-2fea9d0044e4@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox