summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/pgstat.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-07-08 22:23:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-07-08 22:23:16 +0000
commitb09cb0cf12e797339f13ed05d02e2d809248a61f (patch)
tree92d875d88e909bc1d6e5bb0983e17c5ad9b97600 /src/backend/postmaster/pgstat.c
parent8331c11f3f6d9f4b9a194b928f7d8380e8a16e5b (diff)
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.
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r--src/backend/postmaster/pgstat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 5b9989d4814..4097787ec69 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.160 2007/06/28 00:02:38 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.161 2007/07/08 22:23:16 tgl Exp $
* ----------
*/
#include "postgres.h"
@@ -964,8 +964,12 @@ pgstat_drop_database(Oid databaseid)
* Tell the collector that we just dropped a relation.
* (If the message gets lost, we will still clean the dead entry eventually
* via future invocations of pgstat_vacuum_tabstat().)
+ *
+ * Currently not used for lack of any good place to call it; we rely
+ * entirely on pgstat_vacuum_tabstat() to clean out stats for dead rels.
* ----------
*/
+#ifdef NOT_USED
void
pgstat_drop_relation(Oid relid)
{
@@ -984,6 +988,7 @@ pgstat_drop_relation(Oid relid)
msg.m_databaseid = MyDatabaseId;
pgstat_send(&msg, len);
}
+#endif /* NOT_USED */
/* ----------