azexcy commented on code in PR #29965:
URL: https://github.com/apache/shardingsphere/pull/29965#discussion_r1477196066


##########
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:
   I move `checkState` method, make sure DistSQL could drop job anytime.



-- 
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]

Reply via email to