Neil Conway <neilc(at)samurai(dot)com> writes:
> - when we read in the stats collector's stats file in a normal backend,
> there will be no pgStatDBHash entry for the backend's database.
> Therefore we'll read the beentry for the backend, and when we go to
> increment the n_backends for the corresponding dbentry, there will be no
> dbentry found (HASH_FIND at pgstat.c:2554), so n_backends won't be updated.
> - therefore we won't count the n_backends for the database correctly.
However, this could equally be fixed by replacing the hash_search call
at l. 2554 by pgstat_get_db_entry(). If your definition of "correct"
is that "a new backend can see at least one backend in its own database"
then this would be a more appropriate fix anyway, since there's a lag
between sending BESTART and seeing any result in the collector's output.
This isn't an argument against moving the responsibility for counting
n_backends into the collector, but as long as it's done in
pgstat_read_statsfile the proposed fix is pretty bogus.
regards, tom lane
In response to
pgsql-patches by date
|Next:||From: Michael Fuhr||Date: 2005-06-27 13:53:23|
|Subject: PL/Python error checking|
|Previous:||From: Andrew Dunstan||Date: 2005-06-27 13:49:54|
|Subject: Re: regexp_replace|