Re: limiting connections per user/database
От | Tom Lane |
---|---|
Тема | Re: limiting connections per user/database |
Дата | |
Msg-id | 5986.1119880262@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: limiting connections per user/database (Neil Conway <neilc@samurai.com>) |
Список | pgsql-patches |
Neil Conway <neilc@samurai.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
В списке pgsql-patches по дате отправления: