Remove redundant call to pgstat_report_wal()
authorAndres Freund <[email protected]>
Tue, 23 Aug 2022 03:25:42 +0000 (20:25 -0700)
committerAndres Freund <[email protected]>
Tue, 23 Aug 2022 03:25:42 +0000 (20:25 -0700)
pgstat_report_stat() will be called before shutdown so an explicit call to
pgstat_report_wal() just before shutdown is redundant.

This likely was not redundant before 5891c7a8ed8, but now it clearly is.

Author: Melanie Plageman <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Discussion: https://www.postgresql.org/message-id/CAAKRu_aaq33UnG4TXq3S-OSXGWj1QGf0sU%2BECH4tNwGFNERkZA%40mail.gmail.com

src/backend/postmaster/walwriter.c

index e926f8c27c760bc05f32b27c3c0341fe7dc010ad..beb46dcb55c93e9ea639ddfc6f14c0e063ca338d 100644 (file)
@@ -293,18 +293,7 @@ HandleWalWriterInterrupts(void)
        }
 
        if (ShutdownRequestPending)
-       {
-               /*
-                * Force reporting remaining WAL statistics at process exit.
-                *
-                * Since pgstat_report_wal is invoked with 'force' is false in main
-                * loop to avoid overloading the cumulative stats system, there may
-                * exist unreported stats counters for the WAL writer.
-                */
-               pgstat_report_wal(true);
-
                proc_exit(0);
-       }
 
        /* Perform logging of memory contexts of this process */
        if (LogMemoryContextPending)