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



##########
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:
       Is new event necessary for success case? Could we just do it in 
`scalingTaskFinished` like before, and add new logic for failure case later?




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