yandex / odyssey

Scalable PostgreSQL connection pooler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doubles rows in database statistics

clsv opened this issue · comments

Hi, I use odyssey v1.2 in k8s as deployment in 8 replicas, in odyssey config with about 50 databases from 5 postgres13 servers.
And I have the problem with metrics exporter, in a while exporter returns error(HTTP/1.1 500 Internal Server) with text:

21 error(s) occurred:
* collected metric "pgbouncer_exporter_database_current_connections" { label:<name:"name" value:"database_1" > label:<name:"pool_mode" value:"transaction" > gauge:<value:0 > } was collected before with the same name and label values
* collected metric "pgbouncer_exporter_database_current_connections" { label:<name:"name" value:"database_2" > label:<name:"pool_mode" value:"transaction" > gauge:<value:0 > } was collected before with the same name and label values

I have changed exporter but problem didn't disappear. After some investigation I have found cause of this problem.
When I connect to database "console" and execute query "SHOW DATABASE", I can find some rows with the same database name. I haven't understood when and how it happens. After restart everything works correctly, but in a while this problem reproduces

database_1          | 192.168.0.44   | 5441 | database_1          |            |       100 |            0 | transaction |               0 |                   0 |      0 |        0
database_1          | 192.168.0.44   | 5441 | database_1          |            |       100 |            0 | transaction |               0 |                   0 |      0 |        0
database_2          | 192.168.0.41   | 5442 | database_2          |            |       50 |            0 | transaction |               0 |                   0 |      0 |        0
database_2          | 192.168.0.41   | 5442 | database_2          |            |       50 |            0 | transaction |               0 |                   0 |      0 |        0