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

Don't close connection after loading timescale metadata in TimescaleDb SMT

XMLWordPrintable

      The connection is share across the threads and closing the connection in one thread may cause issues in the other thread. Close the connection in close() method of TimescaleDb SMT.

      SMT eventually fails with

      2024-07-31 12:37:06,781 ERROR  TimescaleDbDatabaseTest|||engine|  java.util.concurrent.ExecutionException: io.debezium.DebeziumException: Failed to read TimescaleDB metadata   [io.debezium.connector.postgresql.transforms.timescaledb.TimescaleDbDatabaseTest]
      java.util.concurrent.ExecutionException: io.debezium.DebeziumException: Failed to read TimescaleDB metadata
              at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
              at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
              at io.debezium.embedded.async.ParallelSmtConsumerProcessor.processRecords(ParallelSmtConsumerProcessor.java:49)
              at io.debezium.embedded.async.AsyncEmbeddedEngine$PollRecords.doCall(AsyncEmbeddedEngine.java:1165)
              at io.debezium.embedded.async.AsyncEmbeddedEngine$PollRecords.doCall(AsyncEmbeddedEngine.java:1146)
              at io.debezium.embedded.async.RetryingCallable.call(RetryingCallable.java:47)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
              at java.base/java.lang.Thread.run(Thread.java:1583)
      Caused by: io.debezium.DebeziumException: Failed to read TimescaleDB metadata
              at io.debezium.connector.postgresql.transforms.timescaledb.QueryInformationSchemaMetadata.loadTimescaleMetadata(QueryInformationSchemaMetadata.java:100)
              at io.debezium.connector.postgresql.transforms.timescaledb.QueryInformationSchemaMetadata.hypertableId(QueryInformationSchemaMetadata.java:65)
              at io.debezium.connector.postgresql.transforms.timescaledb.TimescaleDb.apply(TimescaleDb.java:92)
              at io.debezium.embedded.Transformations.transform(Transformations.java:92)
              at io.debezium.embedded.async.ProcessingCallables$TransformRecord.call(ProcessingCallables.java:59)
              at io.debezium.embedded.async.ProcessingCallables$TransformRecord.call(ProcessingCallables.java:48)
              ... 4 common frames omitted
      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:395)
              at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:498)
              at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:415)
              at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:335)
              at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:321)
              at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:297)
              at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:246)
              at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:559)
              at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:501)
              at io.debezium.connector.postgresql.transforms.timescaledb.QueryInformationSchemaMetadata.loadTimescaleMetadata(QueryInformationSchemaMetadata.java:82)
              ... 9 common frames omitted
      Caused by: java.net.SocketException: Socket closed
              at java.base/sun.nio.ch.NioSocketImpl.endRead(NioSocketImpl.java:243)
              at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:323)
              at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
              at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
              at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1099)
              at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:161)
              at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:128)
              at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:113)
              at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
              at org.postgresql.core.PGStream.receiveChar(PGStream.java:465)
              at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
              at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:368)
              ... 18 common frames omitted
      
      

            vjuranek@redhat.com Vojtech Juranek
            vjuranek@redhat.com Vojtech Juranek
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: