1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

doc: Clarify phase descriptions of pg_stat_progress_repack.

The "initializing" phase was described as expected to be very brief,
but for REPACK (CONCURRENTLY), it also covers enabling and
initializing logical decoding, either of which can take a long
time. Also, the "catch-up" phase includes waiting for the ACCESS
EXCLUSIVE lock needed to swap the files, which was not mentioned.

Adding separate progress phases for these steps is left for v20; for
v19 we only clarify the description.

Author: Sami Imseih <samimseih.pg@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
Discussion: https://postgr.es/m/CAN12%2BYJOeOyPYB5JS28VE_%2Brzg%3DRbzQXfj58TGfMYwv-TX9mJA%40mail.gmail.com
Backpatch-through: 19
This commit is contained in:
Masahiko Sawada
2026-09-23 14:57:48 -07:00
parent 4a2f5533f3
commit bd2aebd7a7

View File

@@ -7601,7 +7601,19 @@ FROM pg_stat_get_backend_idset() AS backendid;
<entry><literal>initializing</literal></entry>
<entry>
The command is preparing to begin scanning the heap. This phase is
expected to be very brief.
expected to be very brief, except for
<command>REPACK CONCURRENTLY</command>, where it also covers enabling
logical decoding and then initializing it. Enabling has nothing to do
if <xref linkend="guc-effective-wal-level"/> is already
<literal>logical</literal>; otherwise it waits for all processes to
acknowledge that they started writing the additional WAL information
that logical decoding requires. Initializing then waits for the
transactions that have been assigned a transaction ID to end, including
ones that started while this wait was in progress, so this phase can
last longer than the longest transaction running when the command
started. This includes any other
<command>REPACK CONCURRENTLY</command>, which holds a transaction ID
until it finishes.
</entry>
</row>
<row>
@@ -7633,7 +7645,10 @@ FROM pg_stat_get_backend_idset() AS backendid;
<entry>
<command>REPACK CONCURRENTLY</command> is currently processing the DML
commands that other transactions executed during any of the preceding
phases.
phases. This phase also covers waiting for the <literal>ACCESS
EXCLUSIVE</literal> lock needed to swap the files, so a command blocked
by a conflicting lock stays in this phase.
This phase is skipped when not in concurrent mode.
</entry>
</row>
<row>