Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-1893

AWS RDS Performance Insights show "SELECT COUNT(1) FROM pg_publication WHER ..." continuously

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • 1.0.3.Final
    • postgresql-connector
    • None

    Description

      Same symptoms as described in DBZ-1596.

      AWS RDS Performance Insights show continuous load equivalent to 1 CPU for the replication connection.

      It seems to be confused by the reported active query for the replication connection, which is "SELECT COUNT(1) FROM pg_publication WHERE ..."

      When setting up the connector initially, this was not the case. Performance insights did not show continuous load for the replication connection.
      After restarting the connector the described issue appeared, and consistently happens.

      Checking the sources I found one difference for replication connection intialization, depending on whether the connector starts for the first time or not:
      https://github.com/debezium/debezium/blob/1.0/debezium-connector-postgres/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java#L255

      The replication slot is initialized only once initially by calling `initReplicationSlot()`.
      In that case a new connection is created to address some unrelated issue.
      As a new connection is used, the `SELECT COUNT(1) ...` is not stuck in pg_stat_activity and performance insights works as intended.

      If the connector always uses a fresh connection to replicate, this issue should be resolved.
      I'm not familiar with other monitoring tools, but as `pg_stat_activity` shows confusing data, there might be impact in other non-AWS scenarios too.

      Environment:
      Debezium 1.0.3.Final
      AWS Aurora Postgres 3.1 (~ postgres 10.6)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pyranja Chris Borckholder (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: