Description
Test case
- Create a connector:
curl -i -XPOST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d' { "name": "postgres-connector", "config": { "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "database.hostname": "postgresql", "database.port": "5432", "database.user": "postgres", "database.password": "postgres", "database.dbname": "postgres", "database.server.name": "test", "slot.drop_on_stop": "true" } }'
- Delete the connector:
curl -XDELETE http://localhost:8083/connectors/postgres-connector
- Check your config topic of Kafka Connect:
./bin/kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic my-connect-config --from-beginning --property print.key=true
AR:
The following records are read from the config topic after the connector is created:
Key | Value |
---|---|
connector-postgres-connector | {"properties":{"connector.class":"io.debezium.connector.postgresql.PostgresConnector","database.hostname":"postgresql","database.port":"5432","database.user":"postgres","database.password":"postgres","database.dbname":"postgres","database.server.name":"test","slot.drop_on_stop":"true","name":"postgres-connector"}} |
task-postgres-connector-0 | {"properties":{"connector.class":"io.debezium.connector.postgresql.PostgresConnector","slot.drop_on_stop":"true","database.user":"postgres","database.dbname":"postgres","task.class":"io.debezium.connector.postgresql.PostgresConnectorTask","database.hostname":"postgresql","database.password":"postgres","name":"postgres-connector","database.server.name":"test","database.port":"5432"}} |
commit-postgres-connector | {"tasks":1} |
The following records are read from the config topic after the connector is deleted:
Key | Value |
---|---|
connector-postgres-connector | null |
target-state-postgres-connector | null |
Note that the tombstone record is missing for the task-postgres-connector-0 key.
Additionally, the following fields of org.apache.kafka.connect.storage.KafkaConfigBackingStore class are never cleared during connector removal:
- connectorTaskCounts
- taskConfigs
- deferredTaskUpdates
and can lead to memory leaks.