mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
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
This commit is contained in:
parent
522baf1484
commit
ae060a52b2
1 changed files with 3 additions and 3 deletions
|
|
@ -3272,10 +3272,10 @@ pgstat_progress_end_command(void)
|
|||
{
|
||||
volatile PgBackendStatus *beentry = MyBEEntry;
|
||||
|
||||
if (!beentry)
|
||||
if (!beentry || !pgstat_track_activities)
|
||||
return;
|
||||
if (!pgstat_track_activities
|
||||
&& beentry->st_progress_command == PROGRESS_COMMAND_INVALID)
|
||||
|
||||
if (beentry->st_progress_command == PROGRESS_COMMAND_INVALID)
|
||||
return;
|
||||
|
||||
PGSTAT_BEGIN_WRITE_ACTIVITY(beentry);
|
||||
|
|
|
|||
Loading…
Reference in a new issue