ReyYang commented on a change in pull request #14991:
URL: https://github.com/apache/shardingsphere/pull/14991#discussion_r791404767



##########
File path: 
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/cache/subscriber/ScalingRegistrySubscriber.java
##########
@@ -98,6 +108,10 @@ public void scalingTaskFinished(final 
ScalingTaskFinishedEvent event) {
             log.info("start to delete cache, ruleCacheId={}", ruleCacheId);
             
registryCacheManager.deleteCache(SchemaMetaDataNode.getRulePath(event.getTargetSchemaName()),
 ruleCacheId);
         }
+        if (lockStatus) {

Review comment:
       Yes, there are lock release failures when the task is stopped abruptly. 
Here I will raise a new pull request to solve it

##########
File path: 
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/cache/subscriber/ScalingRegistrySubscriber.java
##########
@@ -130,6 +127,20 @@ public void clusterSwitchConfiguration(final 
ClusterSwitchConfigurationEvent eve
         persistService.persist(schemaName, event.getTargetRuleConfigs());
     }
     
+    /**
+     * scaling release lock.
+     *
+     * @param event Scaling Job Release Schema Name Lock Event
+     */
+    @Subscribe
+    public void scalingJobReleaseLockEvent(final 
ScalingJobReleaseSchemaNameLockEvent event) {
+        if (schemaNameLockedMap.getOrDefault(event.getSchemaName(), false)) {
+            log.info("scaling job finished, release schema name lock, event = 
{}", event);
+            
lockRegistryService.releaseLock(decorateLockName(event.getSchemaName()));
+            schemaNameLockedMap.remove(event.getSchemaName());
+        }
+    }

Review comment:
       ok, I will implement this feature in a new pull request




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