Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql kafka连接错误:无法获取有效的复制插槽_Postgresql_Apache Kafka_Database Replication - Fatal编程技术网

Postgresql kafka连接错误:无法获取有效的复制插槽

Postgresql kafka连接错误:无法获取有效的复制插槽,postgresql,apache-kafka,database-replication,Postgresql,Apache Kafka,Database Replication,我的应用程序中的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 replica

我的应用程序中的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版,最大复制槽的值为10。我可以看到数据库中的活动逻辑复制插槽,已确认\u flush\u lsn=null,restart\u lsn=3/93043310,catalog\u xmin=202656,active=t,datoid=16407,slot\u type=logical,active\u pid=32183,plugin=wal2json,slot\u name=slot1,database=db1(我已经用伪值替换了插槽名称和数据库名称)
根据我的理解,因为此处的逻辑复制插槽已确认\u flush\u lsn=null,导致此错误,因为它阻止连接器找到此插槽


我如何解决这个问题?为什么确认的\u flush\u lsn值将为空

我通过重新启动连接器引用的aws中的rds DB实例将其修复,之后确认的_flush_lsn值被重置为与(restart_lsn=3/93043310)类似的非空值。kafka connect能够按预期找到复制_插槽“slot1”。接头也被拔出。 这暂时解决了我的问题,但我仍然想了解,对于逻辑复制\u插槽,首先应该将什么设置为confirm\u flush\u lsn=null