title: Postgres replication slot from kafka-connect is filling up
body: <p>The replication slot created by a kafka-connector connector is filling up.</p>
  
  <p>I have a postgres RDS database on AWS. I put the following parameter group option on it (only showing the diff from default)</p>
  
  <p>rds.logical_replication: 1</p>
  
  <p>I have kafka connect running with a debezium postgres connector. This is the config (with certain values redacted, of course)</p>
  
  <pre><code>"database.dbname"        = "mydb"
  "database.hostname"      = "myhostname"
  "database.password"      = "mypass"
  "database.port"          = "myport"
  "database.server.name"   = "postgres"
  "database.user"          = "myuser"
  "database.whitelist"     = "my_database"
  "include.schema.changes" = "false"
  "plugin.name"            = "wal2json_streaming"
  "slot.name"              = "my_slotname"
  "snapshot.mode"          = "never"
  "table.whitelist"        = "public.mytable"
  "tombstones.on.delete"   = "false"
  "transforms"             = "key"
  "transforms.key.field"   = "id"
  "transforms.key.type"    = "org.apache.kafka.connect.transforms.ExtractField$Key"
  </code></pre>
  
  <p>If I get the status of this connector, it appears to be fine.</p>
  
  <pre><code>curl -s http://my.kafkaconnect.url:kc_port/connectors/my-connector/status | jq
  
  {
    "name": "my-connector",
    "connector": {
      "state": "RUNNING",
      "worker_id": "some_ip"
    },
    "tasks": [
      {
        "id": 0,
        "state": "RUNNING",
        "worker_id": "some_ip"
      }
    ],
    "type": "source"
  }
  </code></pre>
  
  <p>However, the replication slot in postgres keeps getting larger and larger:</p>
  
  <pre><code>SELECT slot_name,
    pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) as replicationSlotLag,
    pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), confirmed_flush_lsn)) as confirmedLag,
    active
  FROM pg_replication_slots;
             slot_name           | replicationslotlag | confirmedlag | active
  -------------------------------+--------------------+--------------+--------
   my_slotname                   | 20 GB              | 20 GB        | t
  </code></pre>
  
  <p>Why does replication keep growing? As I understand, the kafka connect connector task that is running should be reading from this replication slot, publishing it to the topic <code>postgres. public.mytable</code>, and then the replication slot should decrease in size. Am I missing something in this chain of actions?</p>