-
Enhancement
-
Resolution: Done
-
Minor
-
0.6.1
-
None
Because of select pg_current_xlog_location() is not support in PostgreSQL 10, When we start running we just get an error in start process. I think we can validate PostgreSQL version first and then use select pg_current_wal_lsn() instead when we use PostgreSQL 10.
[2017-11-02 18:58:00,727] INFO Step 2: locking each of the database tables, waiting a maximum of '10.0' seconds for each lock (io.debezium.connector.postgresql.RecordsSnapshotProducer:148)
[2017-11-02 18:58:00,777] ERROR Cannot rollback snapshot transaction (io.debezium.connector.postgresql.RecordsSnapshotProducer:221)
org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:766)
at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:773)
at io.debezium.connector.postgresql.RecordsSnapshotProducer.takeSnapshot(RecordsSnapshotProducer.java:218)
at io.debezium.connector.postgresql.RecordsSnapshotProducer.lambda$start$1(RecordsSnapshotProducer.java:77)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
[2017-11-02 18:58:00,781] ERROR unexpected exception (io.debezium.connector.postgresql.RecordsSnapshotProducer:86)
org.apache.kafka.connect.errors.ConnectException: org.postgresql.util.PSQLException: ERROR: function pg_current_xlog_location() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 15
at io.debezium.connector.postgresql.RecordsSnapshotProducer.takeSnapshot(RecordsSnapshotProducer.java:223)
at io.debezium.connector.postgresql.RecordsSnapshotProducer.lambda$start$1(RecordsSnapshotProducer.java:77)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: ERROR: function pg_current_xlog_location() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2412)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2125)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:297)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:231)
at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:387)
at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:344)
at io.debezium.connector.postgresql.connection.PostgresConnection.currentXLogLocation(PostgresConnection.java:193)
at io.debezium.connector.postgresql.RecordsSnapshotProducer.takeSnapshot(RecordsSnapshotProducer.java:166)
... 5 more
[2017-11-02 18:58:00,948] INFO WorkerSourceTask
Committing offsets (org.apache.kafka.connect.runtime.WorkerSourceTask:306)
[2017-11-02 18:58:00,949] INFO WorkerSourceTask
flushing 0 outstanding messages for offset commit (org.apache.kafka.connect.runtime.WorkerSourceTask:323)
[2017-11-02 18:58:00,953] ERROR WorkerSourceTask
Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:172)
org.apache.kafka.connect.errors.ConnectException: java.util.concurrent.CompletionException: org.apache.kafka.connect.errors.ConnectException: org.postgresql.util.PSQLException: ERROR: function pg_current_xlog_location() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 15
at io.debezium.connector.postgresql.PostgresConnectorTask.poll(PostgresConnectorTask.java:165)
at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:179)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.CompletionException: org.apache.kafka.connect.errors.ConnectException: org.postgresql.util.PSQLException: ERROR: function pg_current_xlog_location() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 15
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1629)
... 3 more
Caused by: org.apache.kafka.connect.errors.ConnectException: org.postgresql.util.PSQLException: ERROR: function pg_current_xlog_location() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 15
at io.debezium.connector.postgresql.RecordsSnapshotProducer.takeSnapshot(RecordsSnapshotProducer.java:223)
at io.debezium.connector.postgresql.RecordsSnapshotProducer.lambda$start$1(RecordsSnapshotProducer.java:77)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
... 3 more
Caused by: org.postgresql.util.PSQLException: ERROR: function pg_current_xlog_location() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2412)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2125)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:297)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:231)
at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:387)
at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:344)
at io.debezium.connector.postgresql.connection.PostgresConnection.currentXLogLocation(PostgresConnection.java:193)
at io.debezium.connector.postgresql.RecordsSnapshotProducer.takeSnapshot(RecordsSnapshotProducer.java:166)
... 5 more
[2017-11-02 18:58:00,956] ERROR WorkerSourceTask
Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:173)