Re: REINDEX CONCURRENTLY reports lockers_done > lockers_total

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Manu <manuelreyesbravo(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Subject: Re: REINDEX CONCURRENTLY reports lockers_done > lockers_total
Date: 2026-11-24 05:22:33
Message-ID: awUfGflZnJ70yrXH@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 17, 2026 at 02:24:48AM -0300, Manu wrote:
> While REINDEX CONCURRENTLY is "waiting for readers before marking
> dead", pg_stat_progress_create_index can show lockers_done greater
> than lockers_total (2 and 1 with the attached script), though the
> docs say these columns contain the progress information for the
> current phase.
>
> WaitForOlderSnapshots() leaves lockers_total, lockers_done and
> current_locker_pid set when it returns, while WaitForLockersMultiple()
> resets all three. Both only set lockers_total when they start, so the
> wait that comes next inherits the other two.

Hmm, yes. That leads to a temporary glitch in the progress view.
I've applied that on HEAD. Thanks.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Kirill Reshke 2026-11-24 05:22:10 Re: SLOPE - Planner optimizations on monotonic expressions.