sandynz commented on code in PR #29965:
URL: https://github.com/apache/shardingsphere/pull/29965#discussion_r1475794995
##########
kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/api/CDCJobAPI.java:
##########
@@ -257,10 +257,14 @@ public void disable(final String jobId) {
* Drop CDC job.
*
* @param jobId job id
+ * @param force force
*/
- public void drop(final String jobId) {
+ public void drop(final String jobId, final boolean force) {
CDCJobConfiguration jobConfig =
jobConfigManager.getJobConfiguration(jobId);
-
ShardingSpherePreconditions.checkState(PipelineJobIdUtils.getElasticJobConfigurationPOJO(jobId).isDisabled(),
() -> new PipelineInternalException("Can't drop streaming job which is
active"));
+ if (!force) {
+
ShardingSpherePreconditions.checkState(PipelineJobIdUtils.getElasticJobConfigurationPOJO(jobId).isDisabled(),
+ () -> new PipelineInternalException("Can't drop streaming
job which is active"));
+ }
Review Comment:
Could we just remove `checkState` to allow drop when job is active?
I just planed to remove it, since CDC job could not be dropped when CDC E2E
test failure in some cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]