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/09/15 09:06:23 UTC

[GitHub] [shardingsphere] natehuangting opened a new pull request, #21000: show processlist can check sleep connection

natehuangting opened a new pull request, #21000:
URL: https://github.com/apache/shardingsphere/pull/21000

   Fixes #20896 


-- 
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] tuichenchuxin commented on a diff in pull request #21000: show processlist can check sleep connection

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on code in PR #21000:
URL: https://github.com/apache/shardingsphere/pull/21000#discussion_r972607943


##########
shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/process/GovernanceExecuteProcessReporter.java:
##########
@@ -54,7 +54,13 @@ public void report(final String executionID, final ExecuteProcessConstants const
     
     @Override
     public void reportClean(final String executionID) {
-        ShowProcessListManager.getInstance().removeProcessContext(executionID);

Review Comment:
   remove this line may result in jdbc mode, not clear process context.



-- 
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] tuichenchuxin commented on pull request #21000: show processlist can check sleep connection

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on PR #21000:
URL: https://github.com/apache/shardingsphere/pull/21000#issuecomment-1248903375

   Looks great!
   


-- 
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] strongduanmu merged pull request #21000: show processlist can check sleep connection

Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #21000:
URL: https://github.com/apache/shardingsphere/pull/21000


-- 
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] strongduanmu commented on a diff in pull request #21000: show processlist can check sleep connection

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #21000:
URL: https://github.com/apache/shardingsphere/pull/21000#discussion_r973826879


##########
shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/kernel/model/ExecutionGroupContext.java:
##########
@@ -38,7 +38,7 @@
     
     private final Collection<ExecutionGroup<T>> inputGroups;
     
-    private final String executionID = new UUID(ThreadLocalRandom.current().nextLong(), ThreadLocalRandom.current().nextLong()).toString().replace("-", "");
+    private String executionID = new UUID(ThreadLocalRandom.current().nextLong(), ThreadLocalRandom.current().nextLong()).toString().replace("-", "");

Review Comment:
   Can we move `new UUID` to proxy and jdbc adaptor?



##########
shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessEngine.java:
##########
@@ -41,13 +45,41 @@
 public final class ExecuteProcessEngine {
     
     /**
-     * Initialize.
+     * Initialize connection.
+     *
+     * @param grantee grantee
+     * @param databaseName database name
+     * @param eventBusContext event bus context
+     * @return execution id
+     */
+    public static String initializeConnection(final Grantee grantee, final String databaseName, final EventBusContext eventBusContext) {
+        ExecutionGroupContext<SQLExecutionUnit> executionGroupContext = new ExecutionGroupContext<>(Collections.emptyList());
+        executionGroupContext.setExecutionID(new UUID(ThreadLocalRandom.current().nextLong(), ThreadLocalRandom.current().nextLong()).toString());

Review Comment:
   Please add `.replace("-", "")` after `new UUID(ThreadLocalRandom.current().nextLong(), ThreadLocalRandom.current().nextLong()).toString()` single mysql kill processlist statement parse logic doesn't support `-`.



-- 
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] natehuangting commented on a diff in pull request #21000: show processlist can check sleep connection

Posted by GitBox <gi...@apache.org>.
natehuangting commented on code in PR #21000:
URL: https://github.com/apache/shardingsphere/pull/21000#discussion_r974161333


##########
shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/process/ExecuteProcessEngine.java:
##########
@@ -41,13 +45,41 @@
 public final class ExecuteProcessEngine {
     
     /**
-     * Initialize.
+     * Initialize connection.
+     *
+     * @param grantee grantee
+     * @param databaseName database name
+     * @param eventBusContext event bus context
+     * @return execution id
+     */
+    public static String initializeConnection(final Grantee grantee, final String databaseName, final EventBusContext eventBusContext) {
+        ExecutionGroupContext<SQLExecutionUnit> executionGroupContext = new ExecutionGroupContext<>(Collections.emptyList());
+        executionGroupContext.setExecutionID(new UUID(ThreadLocalRandom.current().nextLong(), ThreadLocalRandom.current().nextLong()).toString());

Review Comment:
   Yeah!



-- 
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] natehuangting commented on pull request #21000: show processlist can check sleep connection

Posted by GitBox <gi...@apache.org>.
natehuangting commented on PR #21000:
URL: https://github.com/apache/shardingsphere/pull/21000#issuecomment-1248892049

   > This pr will show the proxy front sleep connection? But curent show processlist logic show the backend execution.
   
   It will show all the connection status, including the background sleep in execution.
   
   ```
   mysql> show processlist;
   +--------------------------------------+------+-----------+-------------+---------+------+-------+------+
   | Id                                   | User | Host      | db          | Command | Time | State | Info |
   +--------------------------------------+------+-----------+-------------+---------+------+-------+------+
   | cb9e262f-2833-4925-2d8b-f905237c58c6 | root | 127.0.0.1 | sharding_XA | Sleep   | 14   |       |      |
   +--------------------------------------+------+-----------+-------------+---------+------+-------+------+
   1 row in set (0.02 sec)
   
   mysql> show processlist;
   +--------------------------------------+------+-----------+-------------+---------+------+---------------+-----------------------+
   | Id                                   | User | Host      | db          | Command | Time | State         | Info                  |
   +--------------------------------------+------+-----------+-------------+---------+------+---------------+-----------------------+
   | cb9e262f-2833-4925-2d8b-f905237c58c6 | root | 127.0.0.1 | sharding_XA | Sleep   | 40   |               |                       |
   | fc646062-99fc-2556-d42e-257dc7c9c621 | root | 127.0.0.1 | sharding_xa | Execute | 2    | Executing 0/2 | select * from t_order |
   +--------------------------------------+------+-----------+-------------+---------+------+---------------+-----------------------+
   2 rows in set (0.03 sec)
   ```


-- 
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 #21000: show processlist can check sleep connection

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/21000?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 [#21000](https://codecov.io/gh/apache/shardingsphere/pull/21000?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4334dcb) into [master](https://codecov.io/gh/apache/shardingsphere/commit/f1267e7b538f28fedac0c5f4c2b099f996feeec6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f1267e7) will **decrease** coverage by `0.02%`.
   > The diff coverage is `35.38%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #21000      +/-   ##
   ============================================
   - Coverage     61.60%   61.57%   -0.03%     
     Complexity     2472     2472              
   ============================================
     Files          4056     4056              
     Lines         55768    55799      +31     
     Branches       9451     9453       +2     
   ============================================
   + Hits          34354    34357       +3     
   - Misses        18543    18569      +26     
   - Partials       2871     2873       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/21000?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ecute/engine/driver/jdbc/JDBCExecutorCallback.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZXhlY3V0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL2V4ZWN1dG9yL3NxbC9leGVjdXRlL2VuZ2luZS9kcml2ZXIvamRiYy9KREJDRXhlY3V0b3JDYWxsYmFjay5qYXZh) | `88.88% <0.00%> (ø)` | |
   | [...a/executor/sql/execute/engine/raw/RawExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZXhlY3V0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL2V4ZWN1dG9yL3NxbC9leGVjdXRlL2VuZ2luZS9yYXcvUmF3RXhlY3V0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...te/engine/raw/callback/RawSQLExecutorCallback.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZXhlY3V0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL2V4ZWN1dG9yL3NxbC9leGVjdXRlL2VuZ2luZS9yYXcvY2FsbGJhY2svUmF3U1FMRXhlY3V0b3JDYWxsYmFjay5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...fra/executor/sql/process/ExecuteProcessEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZXhlY3V0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL2V4ZWN1dG9yL3NxbC9wcm9jZXNzL0V4ZWN1dGVQcm9jZXNzRW5naW5lLmphdmE=) | `48.27% <0.00%> (-25.41%)` | :arrow_down: |
   | [...cutor/sql/process/model/ExecuteProcessContext.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZXhlY3V0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL2V4ZWN1dG9yL3NxbC9wcm9jZXNzL21vZGVsL0V4ZWN1dGVQcm9jZXNzQ29udGV4dC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [.../process/model/yaml/YamlExecuteProcessContext.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZXhlY3V0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL2V4ZWN1dG9yL3NxbC9wcm9jZXNzL21vZGVsL3lhbWwvWWFtbEV4ZWN1dGVQcm9jZXNzQ29udGV4dC5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...deration/executor/FilterableTableScanExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLXNxbC1mZWRlcmF0aW9uL3NoYXJkaW5nc3BoZXJlLXNxbC1mZWRlcmF0aW9uLWV4ZWN1dG9yL3NoYXJkaW5nc3BoZXJlLXNxbC1mZWRlcmF0aW9uLWV4ZWN1dG9yLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbGZlZGVyYXRpb24vZXhlY3V0b3IvRmlsdGVyYWJsZVRhYmxlU2NhbkV4ZWN1dG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ration/executor/TranslatableTableScanExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLXNxbC1mZWRlcmF0aW9uL3NoYXJkaW5nc3BoZXJlLXNxbC1mZWRlcmF0aW9uLWV4ZWN1dG9yL3NoYXJkaW5nc3BoZXJlLXNxbC1mZWRlcmF0aW9uLWV4ZWN1dG9yLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbGZlZGVyYXRpb24vZXhlY3V0b3IvVHJhbnNsYXRhYmxlVGFibGVTY2FuRXhlY3V0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [.../proxy/backend/communication/ProxySQLExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL1Byb3h5U1FMRXhlY3V0b3IuamF2YQ==) | `30.30% <0.00%> (-0.95%)` | :arrow_down: |
   | [...ackend/communication/ReactiveProxySQLExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/21000/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL1JlYWN0aXZlUHJveHlTUUxFeGVjdXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | ... and [10 more](https://codecov.io/gh/apache/shardingsphere/pull/21000/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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] natehuangting commented on a diff in pull request #21000: show processlist can check sleep connection

Posted by GitBox <gi...@apache.org>.
natehuangting commented on code in PR #21000:
URL: https://github.com/apache/shardingsphere/pull/21000#discussion_r974161136


##########
shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/kernel/model/ExecutionGroupContext.java:
##########
@@ -38,7 +38,7 @@
     
     private final Collection<ExecutionGroup<T>> inputGroups;
     
-    private final String executionID = new UUID(ThreadLocalRandom.current().nextLong(), ThreadLocalRandom.current().nextLong()).toString().replace("-", "");
+    private String executionID = new UUID(ThreadLocalRandom.current().nextLong(), ThreadLocalRandom.current().nextLong()).toString().replace("-", "");

Review Comment:
   I would move that logic to the ExecuteProcessEngine.



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