You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/02/14 11:02:59 UTC

[GitHub] [shardingsphere] ReyYang opened a new pull request #15407: For #14719: Fixed an issue where some DisSQL could cause errors when Scaling was not enabled

ReyYang opened a new pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407


   Fixes #14719.
   
   Changes proposed in this pull request:
   - Judgment before DISTSQL is executed
   -
   -
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter commented on pull request #15407: For #14719: Fixed an issue where some DisSQL could cause errors when Scaling was not enabled

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407#issuecomment-1039898038


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#15407](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (559ff6b) into [master](https://codecov.io/gh/apache/shardingsphere/commit/5ca4a3a1025b41ab5213eedb1bb803100dcc1342?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5ca4a3a) will **decrease** coverage by `0.00%`.
   > The diff coverage is `33.33%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/15407/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #15407      +/-   ##
   ============================================
   - Coverage     60.39%   60.38%   -0.01%     
     Complexity     1952     1952              
   ============================================
     Files          3219     3219              
     Lines         48128    48132       +4     
     Branches       8168     8170       +2     
   ============================================
   + Hits          29065    29066       +1     
   - Misses        16721    16723       +2     
   - Partials       2342     2343       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...distsql/rdl/rule/RuleDefinitionBackendHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/15407/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmRsL3J1bGUvUnVsZURlZmluaXRpb25CYWNrZW5kSGFuZGxlci5qYXZh) | `61.66% <33.33%> (-2.62%)` | :arrow_down: |
   | [...ine/representer/ShardingSphereYamlRepresenter.java](https://codecov.io/gh/apache/shardingsphere/pull/15407/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS95YW1sL2VuZ2luZS9yZXByZXNlbnRlci9TaGFyZGluZ1NwaGVyZVlhbWxSZXByZXNlbnRlci5qYXZh) | `90.00% <0.00%> (ø)` | |
   | [.../representer/processor/NoneYamlTupleProcessor.java](https://codecov.io/gh/apache/shardingsphere/pull/15407/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcveWFtbC9lbmdpbmUvcmVwcmVzZW50ZXIvcHJvY2Vzc29yL05vbmVZYW1sVHVwbGVQcm9jZXNzb3IuamF2YQ==) | `40.00% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [5ca4a3a...559ff6b](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz merged pull request #15407: For #14719: Fixed an issue where some DisSQL could cause errors when Scaling was not enabled

Posted by GitBox <gi...@apache.org>.
sandynz merged pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz commented on a change in pull request #15407: For #14719: Fixed an issue where some DisSQL could cause errors when Scaling was not enabled

Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407#discussion_r806521450



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -17,6 +17,8 @@
 
 package org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule;
 
+import com.google.common.collect.Sets;
+import com.sun.javafx.runtime.SystemProperties;

Review comment:
       `com.sun.javafx.runtime.SystemProperties` is not necessary.

##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -68,7 +79,11 @@ protected ResponseHeader execute(final String schemaName, final T sqlStatement)
         ruleDefinitionUpdater.checkSQLStatement(shardingSphereMetaData, sqlStatement, currentRuleConfig);
         Optional<RuleDefinitionAlterPreprocessor> preprocessor = TypedSPIRegistry.findRegisteredService(RuleDefinitionAlterPreprocessor.class, sqlStatement.getClass().getCanonicalName(), 
                 new Properties());
-        if (RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig) && preprocessor.isPresent()) {
+        if (!RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig)) {
+            if (RULE_ALTERED_ACTION_LIST.contains(sqlStatement.getClass().getCanonicalName())) {
+                throw new RuntimeException("scaling is not enabled");
+            }
+        } else if (RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig) && preprocessor.isPresent()) {

Review comment:
       There's still duplicated call of `RuleAlteredJobWorker.isOnRuleAlteredActionEnabled`.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz merged pull request #15407: For #14719: Fixed an issue where some DisSQL could cause errors when Scaling was not enabled

Posted by GitBox <gi...@apache.org>.
sandynz merged pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter commented on pull request #15407: For #14719: Fixed an issue where some DisSQL could cause errors when Scaling was not enabled

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407#issuecomment-1039898038


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#15407](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (559ff6b) into [master](https://codecov.io/gh/apache/shardingsphere/commit/5ca4a3a1025b41ab5213eedb1bb803100dcc1342?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5ca4a3a) will **decrease** coverage by `0.00%`.
   > The diff coverage is `33.33%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/15407/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #15407      +/-   ##
   ============================================
   - Coverage     60.39%   60.38%   -0.01%     
     Complexity     1952     1952              
   ============================================
     Files          3219     3219              
     Lines         48128    48132       +4     
     Branches       8168     8170       +2     
   ============================================
   + Hits          29065    29066       +1     
   - Misses        16721    16723       +2     
   - Partials       2342     2343       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...distsql/rdl/rule/RuleDefinitionBackendHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/15407/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmRsL3J1bGUvUnVsZURlZmluaXRpb25CYWNrZW5kSGFuZGxlci5qYXZh) | `61.66% <33.33%> (-2.62%)` | :arrow_down: |
   | [...ine/representer/ShardingSphereYamlRepresenter.java](https://codecov.io/gh/apache/shardingsphere/pull/15407/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS95YW1sL2VuZ2luZS9yZXByZXNlbnRlci9TaGFyZGluZ1NwaGVyZVlhbWxSZXByZXNlbnRlci5qYXZh) | `90.00% <0.00%> (ø)` | |
   | [.../representer/processor/NoneYamlTupleProcessor.java](https://codecov.io/gh/apache/shardingsphere/pull/15407/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcveWFtbC9lbmdpbmUvcmVwcmVzZW50ZXIvcHJvY2Vzc29yL05vbmVZYW1sVHVwbGVQcm9jZXNzb3IuamF2YQ==) | `40.00% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [5ca4a3a...559ff6b](https://codecov.io/gh/apache/shardingsphere/pull/15407?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz commented on a change in pull request #15407: For #14719: Fixed an issue where some DisSQL could cause errors when Scaling was not enabled

Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407#discussion_r806388418



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -68,6 +78,11 @@ protected ResponseHeader execute(final String schemaName, final T sqlStatement)
         ruleDefinitionUpdater.checkSQLStatement(shardingSphereMetaData, sqlStatement, currentRuleConfig);
         Optional<RuleDefinitionAlterPreprocessor> preprocessor = TypedSPIRegistry.findRegisteredService(RuleDefinitionAlterPreprocessor.class, sqlStatement.getClass().getCanonicalName(), 
                 new Properties());
+        if (!RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig)) {
+            if (RULE_ALTERED_ACTION_LIST.contains(sqlStatement.getClass().getCanonicalName())) {
+                throw new RuntimeException("scaling is not enabled");
+            }
+        }
         if (RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig) && preprocessor.isPresent()) {

Review comment:
       `RuleAlteredJobWorker.isOnRuleAlteredActionEnabled` is checked before, it's not necessary here. And it could use `else if`.

##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -54,6 +61,9 @@
         ShardingSphereServiceLoader.register(RuleDefinitionAlterPreprocessor.class);
     }
     
+    private static final List<String> RULE_ALTERED_ACTION_LIST = Lists.newArrayList(AlterShardingTableRuleStatement.class.getName(), AlterShardingAlgorithmStatement.class.getName(),
+            AlterDefaultShardingStrategyStatement.class.getName(), AlterShardingBindingTableRulesStatement.class.getName(), AlterShardingBroadcastTableRulesStatement.class.getName());

Review comment:
       Why not use `Set`, since `contains` is used and it might be executed frequently.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz commented on a change in pull request #15407: For #14719: Fixed an issue where some DisSQL could cause errors when Scaling was not enabled

Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #15407:
URL: https://github.com/apache/shardingsphere/pull/15407#discussion_r806388418



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -68,6 +78,11 @@ protected ResponseHeader execute(final String schemaName, final T sqlStatement)
         ruleDefinitionUpdater.checkSQLStatement(shardingSphereMetaData, sqlStatement, currentRuleConfig);
         Optional<RuleDefinitionAlterPreprocessor> preprocessor = TypedSPIRegistry.findRegisteredService(RuleDefinitionAlterPreprocessor.class, sqlStatement.getClass().getCanonicalName(), 
                 new Properties());
+        if (!RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig)) {
+            if (RULE_ALTERED_ACTION_LIST.contains(sqlStatement.getClass().getCanonicalName())) {
+                throw new RuntimeException("scaling is not enabled");
+            }
+        }
         if (RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig) && preprocessor.isPresent()) {

Review comment:
       `RuleAlteredJobWorker.isOnRuleAlteredActionEnabled` is checked before, it's not necessary here. And it could use `else if`.

##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -54,6 +61,9 @@
         ShardingSphereServiceLoader.register(RuleDefinitionAlterPreprocessor.class);
     }
     
+    private static final List<String> RULE_ALTERED_ACTION_LIST = Lists.newArrayList(AlterShardingTableRuleStatement.class.getName(), AlterShardingAlgorithmStatement.class.getName(),
+            AlterDefaultShardingStrategyStatement.class.getName(), AlterShardingBindingTableRulesStatement.class.getName(), AlterShardingBroadcastTableRulesStatement.class.getName());

Review comment:
       Why not use `Set`, since `contains` is used and it might be executed frequently.

##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -17,6 +17,8 @@
 
 package org.apache.shardingsphere.proxy.backend.text.distsql.rdl.rule;
 
+import com.google.common.collect.Sets;
+import com.sun.javafx.runtime.SystemProperties;

Review comment:
       `com.sun.javafx.runtime.SystemProperties` is not necessary.

##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/rule/RuleDefinitionBackendHandler.java
##########
@@ -68,7 +79,11 @@ protected ResponseHeader execute(final String schemaName, final T sqlStatement)
         ruleDefinitionUpdater.checkSQLStatement(shardingSphereMetaData, sqlStatement, currentRuleConfig);
         Optional<RuleDefinitionAlterPreprocessor> preprocessor = TypedSPIRegistry.findRegisteredService(RuleDefinitionAlterPreprocessor.class, sqlStatement.getClass().getCanonicalName(), 
                 new Properties());
-        if (RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig) && preprocessor.isPresent()) {
+        if (!RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig)) {
+            if (RULE_ALTERED_ACTION_LIST.contains(sqlStatement.getClass().getCanonicalName())) {
+                throw new RuntimeException("scaling is not enabled");
+            }
+        } else if (RuleAlteredJobWorker.isOnRuleAlteredActionEnabled(currentRuleConfig) && preprocessor.isPresent()) {

Review comment:
       There's still duplicated call of `RuleAlteredJobWorker.isOnRuleAlteredActionEnabled`.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org