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

EOFException after a long initial snapshot

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Bug report

      What Debezium connector do you use and what version?

      postgresql 3.3.1

      What is the connector configuration?

      What is the captured database version and mode of deployment?

      postgresql 14, on prem

      What behavior do you expect?

      After initial snapshot, Debezium should normally start streaming even if connection created before snapshot to create publication and replication slot, was killed by a proxy due to inactivity.

      What behavior do you see?

      After initial snapshot, when the snapshot takes a long time (more than 1 hour in our case) we observe EOFException because connection initiated before the snapshot to create publication and replication slot, is killed by a proxy in the meantime due to inactivity. Then the whole snapshot is repeated which is a high cost for large databases. After the second snapshot streaming works just fine.  

      Do you see the same behaviour using the latest released Debezium version?

      Yes

      Do you have the connector logs, ideally from start till finish?

      ```

      2025-11-09 11:18:26.744 [debezium-postgresconnector-cdc-change-event-source-coordinator] ERROR Exceptions - [019a6969-6738-7497-b2d6-701e7b5d11eb] io.debezium.jdbc.JdbcConnectionException : An I/O error occurred while sending to the backend.
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.initPublication(PostgresReplicationConnection.java:325)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.initConnection(PostgresReplicationConnection.java:774)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.startStreaming(PostgresReplicationConnection.java:674)
            at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.execute(PostgresStreamingChangeEventSource.java:168)
            at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.execute(PostgresStreamingChangeEventSource.java:50)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:329)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:207)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:147)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.base/java.lang.Thread.run(Unknown Source)
      Caused by : org.postgresql.util.PSQLException : An I/O error occurred while sending to the backend.
            at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:399)
            at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:525)
            at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:435)
            at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:357)
            at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:342)
            at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:318)
            at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:268)
            at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:564)
            at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:506)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.isReadOnlyDb(PostgresReplicationConnection.java:346)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.initPublication(PostgresReplicationConnection.java:226)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.initConnection(PostgresReplicationConnection.java:774)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.startStreaming(PostgresReplicationConnection.java:674)
            at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.execute(PostgresStreamingChangeEventSource.java:168)
            at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.execute(PostgresStreamingChangeEventSource.java:50)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:329)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:207)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:147)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.base/java.lang.Thread.run(Unknown Source)
      Caused by : java.io.EOFException : null
            at org.postgresql.core.PGStream.receiveChar(PGStream.java:479)
            at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2175)
            at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
            at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:525)
            at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:435)
            at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:357)
            at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:342)
            at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:318)
            at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:268)
            at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:564)
            at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:506)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.isReadOnlyDb(PostgresReplicationConnection.java:346)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.initPublication(PostgresReplicationConnection.java:226)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.initConnection(PostgresReplicationConnection.java:774)
            at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.startStreaming(PostgresReplicationConnection.java:674)
            at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.execute(PostgresStreamingChangeEventSource.java:168)
            at io.debezium.connector.postgresql.PostgresStreamingChangeEventSource.execute(PostgresStreamingChangeEventSource.java:50)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:329)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:207)
            at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:147)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.base/java.lang.Thread.run(Unknown Source)

      ```

       

       

              Unassigned Unassigned
              rudlig Piotr Wolny
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: