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 2023/01/16 07:32:57 UTC

[GitHub] [shardingsphere] Pace2Car opened a new issue, #23576: USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error

Pace2Car opened a new issue, #23576:
URL: https://github.com/apache/shardingsphere/issues/23576

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   master [`d08e4ac2`](https://github.com/apache/shardingsphere/commit/d08e4ac2a0ac0e16ed5544cf71b9b59dec66b608)
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   IMPORT DATABASE CONFIGURATION FROM FILE 'filepath';
   
   ### Actual behavior
   Start ShardingSphere-Proxy with cluster mode, connect and run:
   ```sql
   mysql> IMPORT DATABASE CONFIGURATION FROM FILE 'filepath';
   ERROR 19001 (44000): Storage units `[ds_1, ds_0]` do not exist in database `readwrite_splliting_db`.
   ```
   ### Reason analyze (If you can)
   Incorrect order of import rules
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   ```yaml
   databaseName: readwrite_splliting_db
   
   dataSources:
     ds_0:
       url: jdbc:mysql://127.0.0.1:3306/ds0?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=8000&allowPublicKeyRetrieval=true
       username: root
       password:
       connectionTimeoutMilliseconds: 10000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 500
       minPoolSize: 1
     ds_1:
       url: jdbc:mysql://127.0.0.1:3306/ds1?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=8000&allowPublicKeyRetrieval=true
       username: root
       password:
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 500
       minPoolSize: 1
   
   rules:
   - !READWRITE_SPLITTING
     dataSources:
       readwrite_ds:
         staticStrategy:
           writeDataSourceName: ds_0
           readDataSourceNames:
             - ds_1
         loadBalancerName: random
     loadBalancers:
       random:
         type: RANDOM
   ```


-- 
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.apache.org

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


Re: [I] USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error [shardingsphere]

Posted by "wnose (via GitHub)" <gi...@apache.org>.
wnose commented on issue #23576:
URL: https://github.com/apache/shardingsphere/issues/23576#issuecomment-1845196767

   I have same error. [44000][19001] Storage units `[ds_0]` do not exist in database `seller_manager`.
   
   version 5.7.21-log-ShardingSphere-Proxy 5.4.1.
   docker image apache/shardingsphere-proxy
   
   `databaseName: seller_manager
   dataSources:
    ds_0:
      url: jdbc:mysql://127.0.0.1:3306/mit?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai&useSSL=false&zeroDateTimeBehavior=convertToNull      
      username: root
      password: 123456
      connectionTimeoutMilliseconds: 30000
      idleTimeoutMilliseconds: 60000
      maxLifetimeMilliseconds: 1800000
      maxPoolSize: 50
      minPoolSize: 1
   
   rules:
   - !SINGLE
     tables:
       - ds_0.*
     defaultDataSource: ds_0
   - !SHARDING
    tables:
      lingxing_amz_order_list:
        actualDataNodes: ds_0.lingxing_amz_order_list_${0..2}
        tableStrategy:
          standard:
            shardingColumn: amazon_order_id
            shardingAlgorithmName: order_hash_mod
        keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
        auditStrategy:
          auditorNames:
            - sharding_key_required_auditor
          allowHintDisable: true
      lingxing_amz_order_list_item:
        actualDataNodes: ds_0.lingxing_amz_order_list_item_${0..2}
        tableStrategy:
          standard:
            shardingColumn: amazon_order_id
            shardingAlgorithmName: order_hash_mod
        keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
        auditStrategy:
          auditorNames:
            - sharding_key_required_auditor
          allowHintDisable: true
      lingxing_amz_order_detail_item:
        actualDataNodes: ds_0.lingxing_amz_order_detail_item_${0..2}
        tableStrategy:
          standard:
            shardingColumn: amazon_order_id
            shardingAlgorithmName: order_hash_mod
        keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
        auditStrategy:
          auditorNames:
            - sharding_key_required_auditor
          allowHintDisable: true
    bindingTables:
      - lingxing_amz_order_list,lingxing_amz_order_list_item,lingxing_amz_order_detail_item
    shardingAlgorithms:
      order_hash_mod:
        type: HASH_MOD
        props:
          sharding-count: 128
    keyGenerators:
      snowflake:
        type: SNOWFLAKE
    auditors:
      sharding_key_required_auditor:
        type: DML_SHARDING_CONDITIONS`
   
   **when i try to exec** 
   use seller_manager;
   REGISTER STORAGE UNIT ds_0 (
       HOST="127.0.0.1",
       PORT=3306,
       DB="mit",
       USER="root",
       PASSWORD="123456"
   );
   
   Then has this error 
   [0A000][30001] Unsupported SQL operation: Database `seller_manager` exists and is not empty,overwrite is not supported.
   
   


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


Re: [I] USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error [shardingsphere]

Posted by "Pace2Car (via GitHub)" <gi...@apache.org>.
Pace2Car commented on issue #23576:
URL: https://github.com/apache/shardingsphere/issues/23576#issuecomment-1845202011

   > I have same error. [44000][19001] Storage units `[ds_0]` do not exist in database `seller_manager`.
   > 
   > version 5.7.21-log-ShardingSphere-Proxy 5.4.1. docker image apache/shardingsphere-proxy
   > 
   > `databaseName: seller_manager dataSources: ds_0: url: jdbc:mysql://127.0.0.1:3306/mit?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai&useSSL=false&zeroDateTimeBehavior=convertToNull username: root password: 123456 connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 minPoolSize: 1
   > 
   > rules:
   > 
   > * !SINGLE
   >   tables:
   >   
   >   * ds_0.*
   >     defaultDataSource: ds_0
   > * !SHARDING
   >   tables:
   >   lingxing_amz_order_list:
   >   actualDataNodes: ds_0.lingxing_amz_order_list_${0..2}
   >   tableStrategy:
   >   standard:
   >   shardingColumn: amazon_order_id
   >   shardingAlgorithmName: order_hash_mod
   >   keyGenerateStrategy:
   >   column: id
   >   keyGeneratorName: snowflake
   >   auditStrategy:
   >   auditorNames:
   >   - sharding_key_required_auditor
   >   allowHintDisable: true
   >   lingxing_amz_order_list_item:
   >   actualDataNodes: ds_0.lingxing_amz_order_list_item_${0..2}
   >   tableStrategy:
   >   standard:
   >   shardingColumn: amazon_order_id
   >   shardingAlgorithmName: order_hash_mod
   >   keyGenerateStrategy:
   >   column: id
   >   keyGeneratorName: snowflake
   >   auditStrategy:
   >   auditorNames:
   >   - sharding_key_required_auditor
   >   allowHintDisable: true
   >   lingxing_amz_order_detail_item:
   >   actualDataNodes: ds_0.lingxing_amz_order_detail_item_${0..2}
   >   tableStrategy:
   >   standard:
   >   shardingColumn: amazon_order_id
   >   shardingAlgorithmName: order_hash_mod
   >   keyGenerateStrategy:
   >   column: id
   >   keyGeneratorName: snowflake
   >   auditStrategy:
   >   auditorNames:
   >   - sharding_key_required_auditor
   >   allowHintDisable: true
   >   bindingTables:
   >   
   >   * lingxing_amz_order_list,lingxing_amz_order_list_item,lingxing_amz_order_detail_item
   >     shardingAlgorithms:
   >     order_hash_mod:
   >     type: HASH_MOD
   >     props:
   >     sharding-count: 128
   >     keyGenerators:
   >     snowflake:
   >     type: SNOWFLAKE
   >     auditors:
   >     sharding_key_required_auditor:
   >     type: DML_SHARDING_CONDITIONS`
   > 
   > **when i try to exec** use seller_manager; REGISTER STORAGE UNIT ds_0 ( HOST="127.0.0.1", PORT=3306, DB="mit", USER="root", PASSWORD="123456" );
   > 
   > Then has this error [0A000][30001] Unsupported SQL operation: Database `seller_manager` exists and is not empty,overwrite is not supported.
   
   As the message prompt says: overwrite is not supported.
   
   If it is confirmed that import is required, please drop the conflicting database first.


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


Re: [I] USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error [shardingsphere]

Posted by "terrymanu (via GitHub) via notifications" <no...@shardingsphere.apache.org>.
terrymanu closed issue #23576: USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error
URL: https://github.com/apache/shardingsphere/issues/23576


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


Re: [I] USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error [shardingsphere]

Posted by "terrymanu (via GitHub) via notifications" <no...@shardingsphere.apache.org>.
terrymanu commented on issue #23576:
URL: https://github.com/apache/shardingsphere/issues/23576#issuecomment-6623723148

   Hi @Pace2Car, this bug has been fixed on master by #40460.
   
   Cluster storage-unit registration now waits until all requested storage units are present in local metadata before proceeding with schema reconciliation and subsequent rule validation. Regression tests cover normal imports, delayed/partial notifications, and notification timeouts.
   
   This addresses the cluster import race reported here, so this issue can be closed as fixed. Please verify with a build that includes #40460.


-- 
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] Pace2Car commented on issue #23576: USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error

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

   > Hi @Pace2Car Is this issue duplicated with #22081?
   
   No, it's a different issue.


-- 
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] RaigorJiang commented on issue #23576: USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error

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

   Hi @Pace2Car 
   Is this issue duplicated with #22081?


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


Re: [I] USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error [shardingsphere]

Posted by "wnose (via GitHub)" <gi...@apache.org>.
wnose commented on issue #23576:
URL: https://github.com/apache/shardingsphere/issues/23576#issuecomment-1845204362

   > > I have same error. [44000][19001] Storage units `[ds_0]` do not exist in database `seller_manager`.
   > > version 5.7.21-log-ShardingSphere-Proxy 5.4.1. docker image apache/shardingsphere-proxy
   > > `databaseName: seller_manager dataSources: ds_0: url: jdbc:mysql://127.0.0.1:3306/mit?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai&useSSL=false&zeroDateTimeBehavior=convertToNull username: root password: 123456 connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 minPoolSize: 1
   > > rules:
   > > 
   > > * !SINGLE
   > >   tables:
   > >   
   > >   * ds_0.*
   > >     defaultDataSource: ds_0
   > > * !SHARDING
   > >   tables:
   > >   lingxing_amz_order_list:
   > >   actualDataNodes: ds_0.lingxing_amz_order_list_${0..2}
   > >   tableStrategy:
   > >   standard:
   > >   shardingColumn: amazon_order_id
   > >   shardingAlgorithmName: order_hash_mod
   > >   keyGenerateStrategy:
   > >   column: id
   > >   keyGeneratorName: snowflake
   > >   auditStrategy:
   > >   auditorNames:
   > >   
   > >   * sharding_key_required_auditor
   > >     allowHintDisable: true
   > >     lingxing_amz_order_list_item:
   > >     actualDataNodes: ds_0.lingxing_amz_order_list_item_${0..2}
   > >     tableStrategy:
   > >     standard:
   > >     shardingColumn: amazon_order_id
   > >     shardingAlgorithmName: order_hash_mod
   > >     keyGenerateStrategy:
   > >     column: id
   > >     keyGeneratorName: snowflake
   > >     auditStrategy:
   > >     auditorNames:
   > >   * sharding_key_required_auditor
   > >     allowHintDisable: true
   > >     lingxing_amz_order_detail_item:
   > >     actualDataNodes: ds_0.lingxing_amz_order_detail_item_${0..2}
   > >     tableStrategy:
   > >     standard:
   > >     shardingColumn: amazon_order_id
   > >     shardingAlgorithmName: order_hash_mod
   > >     keyGenerateStrategy:
   > >     column: id
   > >     keyGeneratorName: snowflake
   > >     auditStrategy:
   > >     auditorNames:
   > >   * sharding_key_required_auditor
   > >     allowHintDisable: true
   > >     bindingTables:
   > >   
   > >   
   > >   * lingxing_amz_order_list,lingxing_amz_order_list_item,lingxing_amz_order_detail_item
   > >     shardingAlgorithms:
   > >     order_hash_mod:
   > >     type: HASH_MOD
   > >     props:
   > >     sharding-count: 128
   > >     keyGenerators:
   > >     snowflake:
   > >     type: SNOWFLAKE
   > >     auditors:
   > >     sharding_key_required_auditor:
   > >     type: DML_SHARDING_CONDITIONS`
   > > 
   > > **when i try to exec** use seller_manager; REGISTER STORAGE UNIT ds_0 ( HOST="127.0.0.1", PORT=3306, DB="mit", USER="root", PASSWORD="123456" );
   > > Then has this error [0A000][30001] Unsupported SQL operation: Database `seller_manager` exists and is not empty,overwrite is not supported.
   > 
   > As the message prompt says: overwrite is not supported.
   > 
   > If it is confirmed that import is required, please drop the conflicting database first.
   
    when i drop the database. There are other error. 
    Storage units [ds_0] do not exist in database seller_manager.


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


Re: [I] USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error [shardingsphere]

Posted by "Pace2Car (via GitHub)" <gi...@apache.org>.
Pace2Car closed issue #23576: USE DistSQL IMPORT DATABASE CONFIGURATION FROM FILE `filepath` for import readwrite_splliting rules error
URL: https://github.com/apache/shardingsphere/issues/23576


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