diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-30 22:11:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-30 22:11:59 +0000 |
commit | 21b54ed81a808199dba9f536fa101ff629def90b (patch) | |
tree | 57a35a7df0ccead3be5775125f6401cdfed6fa18 | |
parent | c119cdcab0af13bd9440271811265db7a8dba0db (diff) | |
download | postgresql-21b54ed81a808199dba9f536fa101ff629def90b.tar.gz postgresql-21b54ed81a808199dba9f536fa101ff629def90b.zip |
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.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index d8d12f4892c..ea5075e12df 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.93.2.2 2006/01/18 20:35:16 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.93.2.3 2006/03/30 22:11:59 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, pgstats.c will get confused because we aren't a real + * backend process). + */ + if (!InRecovery) + pgstat_drop_relation(rnode.relNode); /* * And delete the physical files. |