pgsql: Remove the pgstat_drop_relation() call from - Mailing list pgsql-committers

From [email protected] (Tom Lane)
Subject pgsql: Remove the pgstat_drop_relation() call from
Date
Msg-id [email protected]
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Remove the pgstat_drop_relation() call from smgr_internal_unlink(), because
we don't know at that point which relation OID to tell pgstat to forget.
The code was passing the relfilenode, which is incorrect, and could possibly
cause some other relation's stats to be zeroed out.  While we could try to
clean this up, it seems much simpler and more reliable to let the next
invocation of pgstat_vacuum_tabstat() fix things; which indeed is how it
worked before I introduced the buggy code into 8.1.3 and later :-(.
Problem noticed by Itagaki Takahiro, fix is per subsequent discussion.

Tags:
----
REL8_1_STABLE

Modified Files:
--------------
    pgsql/src/backend/postmaster:
        pgstat.c (r1.111.2.8 -> r1.111.2.9)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/pgstat.c.diff?r1=1.111.2.8&r2=1.111.2.9)
    pgsql/src/backend/storage/smgr:
        smgr.c (r1.93.2.3 -> r1.93.2.4)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/smgr/smgr.c.diff?r1=1.93.2.3&r2=1.93.2.4)
    pgsql/src/include:
        pgstat.h (r1.38.2.1 -> r1.38.2.2)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/pgstat.h.diff?r1=1.38.2.1&r2=1.38.2.2)

pgsql-committers by date:

Previous
From: [email protected] (Tom Lane)
Date:
Subject: pgsql: Remove the pgstat_drop_relation() call from
Next
From: [email protected] (Tom Lane)
Date:
Subject: pgsql: Minor copy-editing.