Skip to content

postgres: dbstrict configuration parameter not honored (regression since 7.80.0) #24598

Description

@toadjaune

Hi everyone !

Summary

Since version 7.80.0 of the agent, even setting dbstrict: true and disabling database autodiscovery, the postgresql connects to databases other than the one specified in dbname.

Affected versions

The following agent versions were tested :

  • 7.79.2 : Works fine
  • 7.80.0 : Affected
  • 7.81.1 : Affected

Reproducer

This should be a minimal reproducer :

# /etc/conf.d/postgres.d/conf.yaml

instances:
  - dbm: true
    host: <server_hostname>
    port: 5432
    username: <username>
    password: <password>
    dbname: database_1
    dbstrict: true

Assuming there are 2 databases on the server (database_1 and database_2), with this configuration on one of the affected versions above, I can see the agent querying database_2 as well with pg_stat_activity. This, in turn, can block some postgres operations (such as dropping a database), because there are active sessions on said database.

Related issues

#24531 may be related, but I'm not certain.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions