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

PostgreSQL replication slots grow indefinitely

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Blocker Blocker
    • None
    • 0.8.2.Final
    • postgresql-connector
    • None

      On Amazon RDS PostgreSQL, the replication slots size is constantly increasing and they are not cleaned:

      > select slot_name, pg_size_pretty(pg_xlog_location_diff(pg_current_xlog_location(),restart_lsn)) as replicationSlotLag, active from pg_replication_slots;
             slot_name        | replicationslotlag | active 
      ------------------------+--------------------+--------
       debeziumstagingmobile  | 8815 MB            | t
       debeziumstagingbackend | 8815 MB            | t
       debeziumstagingsandbox | 8816 MB            | t
      

      This causes the database to run out of disk space. This is not caused by the Debezium instance not running or crashing since we see the records on the other side.
      On the table above, the only replication slot we read from is debeziumstagingsandbox, and since its size is equal to the other two, it means that the PostgreSQL connector never flushes the replication slot even though it reads from it.
      This is definitely a bug, and also referred in the Google Groups

              Unassigned Unassigned
              oripwk Ori Popowski (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              15 Start watching this issue

                Created:
                Updated:
                Resolved: