summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2006-03-30 22:11:55 +0000
committerTom Lane2006-03-30 22:11:55 +0000
commit4243f2387a762b26c8e6be5c8094425798d86ea3 (patch)
treee32fc797f4cb2638a828d55c41fd2d13dfa92278
parentbee34e9930a7a52e0a46650ac8f3f31093368ddb (diff)
Suppress attempts to report dropped tables to the stats collector from a
startup or recovery process. Since such a process isn't a real backend, pgstat.c gets confused. This accounts for recent reports of strange "invalid server process ID -1" log messages during crash recovery. There isn't any point in attempting to make the report, since we'll discard stats in such scenarios anyhow.
-rw-r--r--src/backend/storage/smgr/smgr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c
index 2ab1268ba1d..ef7c3994fef 100644
--- a/src/backend/storage/smgr/smgr.c
+++ b/src/backend/storage/smgr/smgr.c
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.97 2006/03/24 04:32:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.98 2006/03/30 22:11:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -470,8 +470,14 @@ smgr_internal_unlink(RelFileNode rnode, int which, bool isTemp, bool isRedo)
*/
FreeSpaceMapForgetRel(&rnode);
- /* Tell the stats collector to forget it immediately, too. */
- pgstat_drop_relation(rnode.relNode);
+ /*
+ * Tell the stats collector to forget it immediately, too. Skip this
+ * in recovery mode, since the stats collector likely isn't running
+ * (and if it is, pgstat.c will get confused because we aren't a real
+ * backend process).
+ */
+ if (!InRecovery)
+ pgstat_drop_relation(rnode.relNode);
/*
* And delete the physical files.