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

Getting "Cannot obtain valid replication slot" during snapshots

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Blocker Blocker
    • None
    • 3.2.1.Final
    • postgresql-connector
    • False
    • Hide

      None

      Show
      None
    • False
    • Important

      i have configured debezium to use aws rds postgres, although it starts up correct and works perfectly for some time, after some hours of inactivity on the tables, the slots are getting inactive and debezium is failing to take snapshots at all. The below error is being logged

      {"timestamp":"2025-09-08T06:14:30.367426907Z","sequence":1089,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.debezium.connector.postgresql.connection.PostgresConnection","level":"WARN","message":"Cannot obtain valid replication slot 'dbz_slot' for plugin 'pgoutput' and database 'drope' [during attempt 650 out of 900, concurrent tx probably blocks taking snapshot.","threadName":"pool-9-thread-1","threadId":34,"mdc":{},"ndc":"","hostName":"ip-172-31-11-212.ap-south-1.compute.internal","processName":"/usr/lib/jvm/java-21-openjdk-21.0.8.0.9-1.el8.x86_64/bin/java","processId":1}

      What Debezium connector do you use and what version?

      aws kinesis

      What is the connector configuration?

      1. — SINK: Kinesis —
        debezium.sink.type=kinesis
        debezium.sink.kinesis.region=ap-south-1
      2. (Create Kinesis streams named from Debezium topics; see note below.)
      1. — SOURCE: PostgreSQL (RDS) —
        debezium.source.connector.class=io.debezium.connector.postgresql.PostgresConnector
        debezium.source.database.hostname=${DB_HOST}
        debezium.source.database.port=5432
        debezium.source.database.user=${DB_USER}
        debezium.source.database.password=${DB_PASSWORD}
        debezium.source.database.dbname=${DB_NAME}
        debezium.source.plugin.name=pgoutput
      1. Identify tables to capture (recommended)
        debezium.source.table.include.list=public.message,public.business,public.user
      2. Or narrow further with schema/table includes.
      1. Topic/stream naming
        debezium.source.topic.prefix=app
      1. Publication/slot naming (one per connector)
        debezium.source.publication.name=dbz_pub
      2. debezium.source.publication.autocreate.mode=filtered
        debezium.source.slot.name=dbz_slot
      1. Offsets/snapshots
        debezium.source.offset.storage.file.filename=/debezium/data/offsets.dat
        debezium.source.snapshot.mode=when_needed
      1. Helpful in low-traffic DBs to advance LSN and avoid WAL bloat
        debezium.source.heartbeat.interval.ms=10000

      debezium.source.heartbeat.action.query=UPDATE public.debezium_heartbeat SET heartbeat = NOW()::text

       

      What is the captured database version and mode of deployment?

      postgres 17.4 on aws rds

      What behavior do you expect?

      for the snapshots to work correctly

      What behavior do you see?

      snapshots are failing due to the below error

      {"timestamp":"2025-09-08T06:14:30.367426907Z","sequence":1089,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.debezium.connector.postgresql.connection.PostgresConnection","level":"WARN","message":"Cannot obtain valid replication slot 'dbz_slot' for plugin 'pgoutput' and database 'drope' [during attempt 650 out of 900, concurrent tx probably blocks taking snapshot.","threadName":"pool-9-thread-1","threadId":34,"mdc":{},"ndc":"","hostName":"ip-172-31-11-212.ap-south-1.compute.internal","processName":"/usr/lib/jvm/java-21-openjdk-21.0.8.0.9-1.el8.x86_64/bin/java","processId":1}

      Do you see the same behaviour using the latest released Debezium version?

      (Ideally, also verify with latest Alpha/Beta/CR version)

      yes

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

      yes

      How to reproduce the issue using our tutorial deployment?

      <Your answer>

              Unassigned Unassigned
              alvinlal alvin lal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: