kafka-connect错误:无法获得有效的复制插槽

问题描述 投票:0回答:1

我的应用程序中的Kafka debezium-postgres连接器抛出此错误:

org.apache.kafka.connect.errors.ConnectException: Unable to obtain valid replication slot. Make sure there are no long-running transactions running in parallel as they may hinder the allocation of the replication slot when starting this connector
    at io.debezium.connector.postgresql.connection.PostgresConnection.readReplicationSlotInfo(PostgresConnection.java:226)
    at io.debezium.connector.postgresql.connection.PostgresConnection.getReplicationSlotState(PostgresConnection.java:150)
    at io.debezium.connector.postgresql.PostgresConnectorTask.start(PostgresConnectorTask.java:98)
    at io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:49)
    at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:198)
    at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)
    at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

该应用程序使用PostgreSQL版本9.6.11,max_replication_slots的值为10。我可以看到数据库中的活动逻辑replication_slot,其中confirmed_flush_lsn = null,restart_lsn = 3/93043310,catalog_xmin = 202656,active = t,datoid = 16407,slot_type =逻辑,active_pid = 32183,插件= wal2json,slot_name = slot1,数据库= db1(我已用虚拟值替换了插槽名称和数据库名称)根据我的理解,由于此处的逻辑复制插槽的Confirmed_flush_lsn = null导致此错误,因为它阻止连接器找到此插槽。

我该如何解决,为什么Confirmed_flush_lsn值将为null?

postgresql apache-kafka database-replication
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.