Skip to content

Commit ae060a5

Browse files
committed
Fix thinko when ending progress report for a backend
The logic ending progress reporting for a backend entry introduced by b6fb647 causes callers of pgstat_progress_end_command() to do some extra work when track_activities is enabled as the process fields are reset in the backend entry even if no command were started for reporting. This resets the fields only if a command is registered for progress reporting, and only if track_activities is enabled. Author: Masahiho Sawada Discussion: https://postgr.es/m/CAD21AoCry_vJ0E-m5oxJXGL3pnos-xYGCzF95rK5Bbi3Uf-rpA@mail.gmail.com Backpatch-through: 9.6
1 parent 522baf1 commit ae060a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,10 +3272,10 @@ pgstat_progress_end_command(void)
32723272
{
32733273
volatile PgBackendStatus *beentry = MyBEEntry;
32743274

3275-
if (!beentry)
3275+
if (!beentry || !pgstat_track_activities)
32763276
return;
3277-
if (!pgstat_track_activities
3278-
&& beentry->st_progress_command == PROGRESS_COMMAND_INVALID)
3277+
3278+
if (beentry->st_progress_command == PROGRESS_COMMAND_INVALID)
32793279
return;
32803280

32813281
PGSTAT_BEGIN_WRITE_ACTIVITY(beentry);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy