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/21 03:18:20 UTC

[GitHub] [shardingsphere] ReyYang opened a new issue #15532: Using Add Resource causes loss of broadcast tables under the /metadata/schemaName/tables

ReyYang opened a new issue #15532:
URL: https://github.com/apache/shardingsphere/issues/15532


   ### Which version of ShardingSphere did you use?
   master batch
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
    /metadata/schemaName/tables broadcast table metadata exist
   ### Actual behavior
    /metadata/schemaName/tables broadcast table metadata lost
   ### Reason analyze (If you can)
   It may be because Debug finds
   TableMetadataLoadRengine's LOAD method leads to the loss of the broadcast
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   1、start ShardingSphere-proxy
   2、perform distsql
   3、Data loss found in ZK


-- 
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] ReyYang commented on issue #15532: Using Add Resource causes loss of broadcast tables under the /metadata/schemaName/tables

Posted by GitBox <gi...@apache.org>.
ReyYang commented on issue #15532:
URL: https://github.com/apache/shardingsphere/issues/15532#issuecomment-1046433438


   before perform distsql
   <img width="313" alt="image" src="https://user-images.githubusercontent.com/29473272/154883754-1b2a0dcf-3d7c-4f05-ae35-13e0aad7c293.png">
   after perform distsql
   <img width="328" alt="image" src="https://user-images.githubusercontent.com/29473272/154883823-dff1aa37-d7c1-4397-9d0f-51c57e058a70.png">
   


-- 
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 closed issue #15532: Using Add Resource causes loss of broadcast tables under the /metadata/schemaName/tables

Posted by GitBox <gi...@apache.org>.
tuichenchuxin closed issue #15532:
URL: https://github.com/apache/shardingsphere/issues/15532


   


-- 
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 issue #15532: Using Add Resource causes loss of broadcast tables under the /metadata/schemaName/tables

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #15532:
URL: https://github.com/apache/shardingsphere/issues/15532#issuecomment-1082559644


   I tried these steps, but didn't reproduced.
   ## FIREST 
   server.ymal
   ```
   mode:
     type: Cluster
     repository:
       type: ZooKeeper
       props:
         namespace: agent
         server-lists: localhost:2181
         retryIntervalMilliseconds: 500
         timeToLiveSeconds: 60
         maxRetries: 3
         operationTimeoutMilliseconds: 30000
     overwrite: true
   #
   rules:
     - !AUTHORITY
       users:
         - root@%:root
         - sharding@:sharding
       provider:
         type: ALL_PRIVILEGES_PERMITTED
   
   props:
     max-connections-size-per-query: 1
     executor-size: 16  # Infinite by default.
     proxy-frontend-flush-threshold: 128  # The default value is 128.
     proxy-opentracing-enabled: false
     proxy-hint-enabled: true
     sql-show: false
     check-table-metadata-enabled: false
     lock-wait-timeout-milliseconds: 50000 # The maximum time to wait for a lock
     show-process-list-enabled: true
     # Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
     # The default value is -1, which means set the minimum value for different JDBC drivers.
     proxy-backend-query-fetch-size: -1
     check-duplicate-table-enabled: false
   ```
   ## Second
   ```
   CREATE DATABASE sharding_db;
   ```
   ## Third
   ```
   ADD RESOURCE demo_ds_0 (
       HOST=127.0.0.1,
       PORT=3306,
       DB=demo_ds_0,
       USER=root,
       PASSWORD=123456
   ), demo_ds_1(
       HOST=127.0.0.1,
       PORT=3306,
       DB=demo_ds_0,
       USER=root,
       PASSWORD=123456
   );
   ```
   ## Fourth
   ```
   CREATE SHARDING BROADCAST TABLE RULES (t_config);
   ```
   ## final
   I found broadcast tables are exist.
   ![image](https://user-images.githubusercontent.com/86938616/160739900-79eda776-bce3-4ad9-8037-68916f95b1f1.png)
   


-- 
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 issue #15532: Using Add Resource causes loss of broadcast tables under the /metadata/schemaName/tables

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #15532:
URL: https://github.com/apache/shardingsphere/issues/15532#issuecomment-1082590311


   Since there's no exact reproduct steps.
   I tried on master branch, commit 6fd57154632ea0f108f9e991b1721ad1c9660aed.
   On existing schema `test1`, execute SQLs:
   ```
   mysql> CREATE SHARDING BROADCAST TABLE RULES (t_broadcast_table);
   Query OK, 0 rows affected (0.42 sec)
   
   mysql> CREATE TABLE t_broadcast_table (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id));
   Query OK, 0 rows affected (0.39 sec)
   
   mysql> ALTER SHARDING TABLE RULE t_order(
       -> RESOURCES(ds_2,ds_3,ds_4),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=6)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
       -> ), t_order_item(
       -> RESOURCES(ds_2,ds_3,ds_4),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=6)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
       -> );
   Query OK, 0 rows affected (0.26 sec)
   ```
   
   `t_broadcast_table` always exist in registry center after created.
   
   We'll check it again when developing broadcast table support of scaling job.
   


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