{"record":{"id":"d71edc81af77ea78","repo":"alibaba/canal","slug":"failed-to-rollback-after","errorCode":null,"errorMessage":"failed to rollback after ","messagePattern":"failed to rollback after ","errorType":"exception","errorClass":"CanalClientException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java","lineNumber":237,"sourceCode":"        throw new CanalClientException(\"failed to fetch the data after \" + times + \" times retry\");\n    }\n\n    @Override\n    public void rollback(long batchId) throws CanalClientException {\n        int times = 0;\n        while (times < retryTimes) {\n            try {\n                currentConnector.rollback(batchId);\n                return;\n            } catch (Throwable t) {\n                logger.warn(String.format(\"something goes wrong when rollbacking data from server:%s\",\n                    currentConnector != null ? currentConnector.getAddress() : \"null\"), t);\n                times++;\n                restart();\n                logger.info(\"restart the connector for next round retry.\");\n            }\n        }\n        throw new CanalClientException(\"failed to rollback after \" + times + \" times retry\");\n    }\n\n    @Override\n    public void rollback() throws CanalClientException {\n        int times = 0;\n        while (times < retryTimes) {\n            try {\n                currentConnector.rollback();\n                return;\n            } catch (Throwable t) {\n                logger.warn(String.format(\"something goes wrong when rollbacking data from server:%s\",\n                    currentConnector != null ? currentConnector.getAddress() : \"null\"), t);\n                times++;\n                restart();\n                logger.info(\"restart the connector for next round retry.\");\n            }\n        }\n","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java#L219-L255","documentation":"Error \"failed to rollback after \" thrown in alibaba/canal.","triggerScenarios":"Thrown at client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java:237 when the library encounters an invalid state.","commonSituations":"Rollback failure on a cluster connector. Validate batchId before rollback, guard against stale client state after failover, and log the active node so retries do not silently drop the batch.","solutions":["Check that the batchId being rolled back was previously returned by get/getWithoutAck and has not already been acked or rolled back.","Verify the current active connector has not failed over to another canal server; after failover, re-subscribe and fetch again before rolling back.","Enable client retry logic (retryTimes/retryInterval) so transient network errors during rollback are retried automatically."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}