confluentinc / kafka-connect-jdbc

Kafka Connect connector for JDBC-compatible databases
Other
19 stars 955 forks source link

JDBC source does not respect `query.retry.attempts = 0` #1340

Open Schm1tz1 opened 1 year ago

Schm1tz1 commented 1 year ago

We'd like to have a JDBC source fail upon the first SQL exception by setting query.retry.attempts=0 as we are running non-incremental mode that delivers the output of a stored procedure to the connector. Configuring for 0 retries, it does not seem to respect this setting and we are getting messages like: ERROR [sqlserver-source|task-0] SQL exception while running query for table: BulkTableQuerier{table='null', query='Exec dbo.listCustomers', topicPrefix='sqlserver-customers2'}, java.sql.SQLException: The record does not exist.. Attempting retry 3 of 0 attempts. (io.confluent.connect.jdbc.source.JdbcSourceTask:455).

Suggestion: Add this feature either by setting maxRetriesPerQuerier >= 0 in JdbcSourceTask or by adding an additional fail fast / no retries property to the configuration.

Schm1tz1 commented 1 year ago

Created a fork an branch for this issue: https://github.com/Schm1tz1/kafka-connect-jdbc/tree/issue-1340 and a PR https://github.com/confluentinc/kafka-connect-jdbc/pull/1341