Remove superfluous memset from pgstat_recv_resetslrucounter
authorTomas Vondra <[email protected]>
Sat, 2 May 2020 13:30:10 +0000 (15:30 +0200)
committerTomas Vondra <[email protected]>
Sat, 2 May 2020 13:30:10 +0000 (15:30 +0200)
The extra memset meant pg_stat_reset_slru() always reset all the entries
even when reset of a single entry was requested, but the timestamp was
left uninitialized.

Reported-by: Atsushi Torikoshi
Discussion: https://postgr.es/m/CACZ0uYFe16pjZxQYaTn53mspyM7dgMPYL3DJLjjPw69GMCC2Ow%40mail.gmail.com

src/backend/postmaster/pgstat.c

index 2ba3858d31e3078d5e88c93bbc6e92fca57f5c18..3f8105c6ebc496a2d06cc1557aa71c4f4964e4d7 100644 (file)
@@ -6233,8 +6233,6 @@ pgstat_recv_resetslrucounter(PgStat_MsgResetslrucounter *msg, int len)
        int                     i;
        TimestampTz     ts = GetCurrentTimestamp();
 
-       memset(&slruStats, 0, sizeof(slruStats));
-
        for (i = 0; i < SLRU_NUM_ELEMENTS; i++)
        {
                /* reset entry with the given index, or all entries (index is -1) */