pgsql: Fix thinko when ending progress report for a backend

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix thinko when ending progress report for a backend
Date: 2019-09-04 06:47:59
Message-ID: E1i5P5D-0006Ir-57@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/af28744288b1de46615c947be69935c2172374c7

Modified Files
--------------
src/backend/postmaster/pgstat.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2019-09-05 06:37:53 pgsql: Use explicit_bzero
Previous Message Michael Paquier 2019-09-04 04:26:45 pgsql: Delay fsyncs of pg_basebackup until the end of backup