Neil Conway <[EMAIL PROTECTED]> 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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to