Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the sink-connector lightweight should retry on failures #463

Closed
aadant opened this issue Feb 15, 2024 · 1 comment · Fixed by #464
Closed

the sink-connector lightweight should retry on failures #463

aadant opened this issue Feb 15, 2024 · 1 comment · Fixed by #464
Assignees
Labels
bug Something isn't working GA-1 All the issues that are issues in release(Scheduled Dec 2023) lightweight Issues related to Lightweight version qa-verified label to mark issues that were verified by QA

Comments

@aadant
Copy link
Collaborator

aadant commented Feb 15, 2024

I noticed that the data did not reconcile between CH and MySQL.

1714737 2024-02-15 10:28:37.820 [Sink Connector thread-pool-4] ERROR com.altinity.clickhouse.sink.connector.db.batch.PreparedStatementExecutor  - ******* ERROR inserting Batch *****************
java.sql.BatchUpdateException: Error writing request body to server, server ClickHouseNode [uri=http://host:8123/db, options={custom_settings=allow_experimental_object_type=1,insert_allow_materialized_columns=1,client_name=Sink Connector Lightweight}]@205662767
        at com.clickhouse.jdbc.SqlExceptionUtils.batchUpdateError(SqlExceptionUtils.java:107)
        at com.clickhouse.jdbc.internal.InputBasedPreparedStatement.executeAny(InputBasedPreparedStatement.java:154)
        at com.clickhouse.jdbc.internal.AbstractPreparedStatement.executeLargeBatch(AbstractPreparedStatement.java:85)
        at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.executeBatch(ClickHouseStatementImpl.java:752)
        at com.altinity.clickhouse.sink.connector.db.batch.PreparedStatementExecutor.lambda$executePreparedStatement$0(PreparedStatementExecutor.java:156)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at com.altinity.clickhouse.sink.connector.db.batch.PreparedStatementExecutor.executePreparedStatement(PreparedStatementExecutor.java:117)
        at com.altinity.clickhouse.sink.connector.db.batch.PreparedStatementExecutor.addToPreparedStatementBatch(PreparedStatementExecutor.java:88)
        at com.altinity.clickhouse.sink.connector.executor.ClickHouseBatchRunnable.flushRecordsToClickHouse(ClickHouseBatchRunnable.java:300)
        at com.altinity.clickhouse.sink.connector.executor.ClickHouseBatchRunnable.processRecordsByTopic(ClickHouseBatchRunnable.java:266)
        at com.altinity.clickhouse.sink.connector.executor.ClickHouseBatchRunnable.run(ClickHouseBatchRunnable.java:144)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
1714741 2024-02-15 10:28:37.824 [Sink Connector thread-pool-4] ERROR com.altinity.clickhouse.sink.connector.db.batch.PreparedStatementExecutor  - **** ERROR: executing prepared statement
1714741 2024-02-15 10:28:37.824 [Sink Connector thread-pool-4] ERROR com.altinity.clickhouse.sink.connector.executor.ClickHouseBatchRunnable  - Error processing records for topic: embeddedconnector.

when rewinding to the replication position, the insert succeeded.

So failing batches should be retried (forever). Replication position should not make progress until the error is fixed.

Errors should not be snoozed but retried. Retrying transient failures will make replication more robust.

@aadant aadant added bug Something isn't working lightweight Issues related to Lightweight version GA-1 All the issues that are issues in release(Scheduled Dec 2023) labels Feb 15, 2024
@subkanthi subkanthi linked a pull request Feb 16, 2024 that will close this issue
@Selfeer
Copy link
Collaborator

Selfeer commented Feb 27, 2024

The issue was verified by the Altinity QA team and marked as qa-verified.

Build used for testing: altinityinfra/clickhouse-sink-connector:464-c979a8c2583ff701dd5b63efb8f36f7fff8111e7-lt

Automated TestFlows tests were added to the develop branch:
https://github.com/Altinity/clickhouse-sink-connector/blob/develop/sink-connector-lightweight/tests/integration/tests/retry_on_fail.py

Requirements for the ClickHouse Sink Connector Lightweight were updated.

@Selfeer Selfeer added the qa-verified label to mark issues that were verified by QA label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GA-1 All the issues that are issues in release(Scheduled Dec 2023) lightweight Issues related to Lightweight version qa-verified label to mark issues that were verified by QA
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants