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/10/14 08:08:52 UTC

[GitHub] [shardingsphere] chengyonghu opened a new issue, #21558: shardingsphere5.1.2+seata1.5.1

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

   **The error is displayed when data is inserted**
   Table primary keys are generated automatically and I did not specify them
   
   Here is the SQL I executed and the error message
   insert into icloud_team_picture (         folder_id,         user_id,         team_id,         organize_id,         picture_name,         picture_path,         picture_size,         picture_time,         picture_status         )         values                        (?,?, ?,?,?,             ?,?,?,             ?             )
   ### Cause: java.sql.SQLException: io.seata.common.exception.ShouldNeverHappenException
   ; uncategorized SQLException; SQL state [null]; error code [0]; io.seata.common.exception.ShouldNeverHappenException; nested exception is java.sql.SQLException: io.seata.common.exception.ShouldNeverHappenException] with root cause
   io.seata.common.exception.ShouldNeverHappenException: null


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


[GitHub] [shardingsphere] FlyingZC commented on issue #21558: shardingsphere5.1.2+seata1.5.1

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

   Thanks for the feedback, I will try.


-- 
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] chengyonghu commented on issue #21558: shardingsphere5.1.2+seata1.5.1

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

   **This is my yml configuration**
   `spring:`
     `shardingsphere:`
       `datasource:`
         `ds-0:`
           `driver-class-name: com.mysql.cj.jdbc.Driver`
           `type: com.alibaba.druid.pool.DruidDataSource`
           `driverClassName: com.mysql.jdbc.Driver`
           `url: jdbc:mysql://192.168.0.12:3307/xx?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8`
           `username: `
           `password: `
         `names: ds-0`
       `rules:`
         `sharding:`
   
   ​        `binding-tables:`
   
      - `icloud_user_picture,icloud_user_picture_ext,icloud_user_picture_meta`
        `ud_user_folder,icloud_user_folder_ext`
           - `icloud_team_picture,icloud_team_picture_ext,icloud_team_picture_meta`
             `ud_team_folder,icloud_team_folder_ext`
                     `tables:`
   
   ​          `icloud_user_picture: # 逻辑表名称`
   ​            `actualDataNodes: ds-0.icloud_user_picture_$->{0..1} # 由数据源名 + 表名组成(参考 Inline 语法规则)`
   ​            `tableStrategy: # 分表策略,同分库策略`
   ​              `standard:`
   ​                `shardingColumn: user_id #分配键`
   ​                `shardingAlgorithmName: icloud_user_picture_inline #分片规则`
   ​            `keyGenerateStrategy: # 分布式序列策略`
   ​              `column: picture_id # 自增列名称,缺省表示不使用自增主键生成器`
   ​              `keyGeneratorName: leaf # 分布式序列算法名称`
   
             # `个人图片扩展信息表`
   
   ​          `icloud_user_picture_ext:`
   ​            `actualDataNodes: ds-0.icloud_user_picture_ext_$->{0..1}`
   ​            `tableStrategy:`
   ​              `standard:`
   ​                `shardingColumn: user_id`
   ​                `shardingAlgorithmName: icloud_user_picture_ext_inline`
   
             # `个人图片水印信息表`
   
   ​          `icloud_user_picture_meta:`
   ​            `actualDataNodes: ds-0.icloud_user_picture_meta_$->{0..1}`
   ​            `tableStrategy:`
   ​              `standard:`
   ​                `shardingColumn: user_id`
   ​                `shardingAlgorithmName: icloud_user_picture_meta_inline`
   
             # `个人文件夹基本信息表`
   
   ​          `icloud_user_folder:`
   ​            `actualDataNodes: ds-0.icloud_user_folder`
   ​            `keyGenerateStrategy:`
   ​              `column: folder_id`
   ​              `keyGeneratorName: leaf`
   
             # `个人文件夹扩展信息表`
   
   ​          `icloud_user_folder_ext:`
   ​            `actualDataNodes: ds-0.icloud_user_folder_ext`
   
             # `团队图片基本信息表`
   
   ​          `icloud_team_picture:`
   ​            `actualDataNodes: ds-0.icloud_team_picture_${0..1}`
   ​            `tableStrategy: # 分表策略,同分库策略`
   ​              `standard:`
   ​                `shardingColumn: team_id`
   ​                `shardingAlgorithmName: icloud_team_picture_inline`
   ​            `keyGenerateStrategy: # 分布式序列策略`
   ​              `column: picture_id # 自增列名称,缺省表示不使用自增主键生成器`
   ​              `keyGeneratorName: leaf # 分布式序列算法名称`
   
             # `团队图片扩展信息表`
   
   ​          `icloud_team_picture_ext:`
   ​            `actualDataNodes: ds-0.icloud_team_picture_ext_${0..1}`
   ​            `tableStrategy: # 分表策略,同分库策略`
   ​              `standard:`
   ​                `shardingColumn: team_id`
   ​                `shardingAlgorithmName: icloud_team_picture_ext_inline`
   
             # `团队图片水印信息表`
   
   ​          `icloud_team_picture_meta:`
   ​            `actualDataNodes: ds-0.icloud_team_picture_meta_${0..1}`
   ​            `tableStrategy: # 分表策略,同分库策略`
   ​              `standard:`
   ​                `shardingColumn: team_id`
   ​                `shardingAlgorithmName: icloud_team_picture_meta_inline`
   
             # `团队文件夹基本信息表`
   
   ​          `icloud_team_folder:`
   ​            `actualDataNodes: ds-0.icloud_team_folder`
   ​            `keyGenerateStrategy:`
   ​              `column: folder_id`
   ​              `keyGeneratorName: leaf`
   
             # `团队文件夹拓展信息表`
   
   ​          `icloud_team_folder_ext:`
   ​            `actualDataNodes: ds-0.icloud_team_folder_ext`
   
             # `文件下载记录`
   
   ​          `icloud_history_download:`
   ​            `actualDataNodes: ds-0.icloud_history_download`
   ​            `keyGenerateStrategy:`
   ​              `column: download_id`
   ​              `keyGeneratorName: leaf`
   
             # `用户常用文件夹`
   
   ​          `icloud_user_common_folder:`
   ​            `actualDataNodes: ds-0.icloud_user_common_folder`
   ​            `keyGenerateStrategy:`
   ​              `column: id`
   ​              `keyGeneratorName: leaf`
   
             # `团队常用文件夹`
   
   ​          `icloud_team_common_folder:`
   ​            `actualDataNodes: ds-0.icloud_team_common_folder`
   ​            `keyGenerateStrategy:`
   ​              `column: id`
   ​              `keyGeneratorName: leaf`
   
             # `操作日志`
   
   ​          `icloud_sys_oper_log:`
   ​            `actualDataNodes: ds-0.icloud_sys_oper_log_${202201..202212}`
   ​            `table-strategy:`
   ​              `standard:`
   ​                `sharding-column: oper_time`
   ​                `shardingAlgorithmName: icloud_sys_log_inline`
   ​            `keyGenerateStrategy:`
   ​              `column: oper_id`
   ​              `keyGeneratorName: leaf`
   
             # `登录日志`
   
   ​          `icloud_sys_logininfor:`
   ​            `actualDataNodes: ds-0.icloud_sys_logininfor_${202201..202212}`
   ​            `table-strategy:`
   ​              `standard:`
   ​                `sharding-column: login_time`
   ​                `shardingAlgorithmName: icloud_sys_log_inline`
   ​            `keyGenerateStrategy:`
   ​              `column: info_id`
   ​              `keyGeneratorName: leaf`
   
           # `分片规则`
   
   ​        `sharding-algorithms:`
   ​          `icloud_sys_log_inline:`
   ​            `type: CLASS_BASED`
   ​            `props:`
   ​              `strategy: STANDARD`
   ​              `algorithmClassName: com.ydtx.camera.icloud.config.CustomPreciseShardingAlgorithm`
   ​          `icloud_user_picture_inline:`
   ​            `type: inline`
   ​            `props:`
   ​              `algorithm-expression: icloud_user_picture_$->{user_id % 2}
   ​          icloud_user_picture_ext_inline:
   ​            type: inline
   ​            props:
   ​              algorithm-expression: icloud_user_picture_ext_$->{user_id % 2}`
   ​          `icloud_user_picture_meta_inline:`
   ​            `type: inline`
   ​            `props:`
   ​              `algorithm-expression: icloud_user_picture_meta_$->{user_id % 2}
   ​          icloud_team_picture_inline:
   ​            type: inline
   ​            props:
   ​              algorithm-expression: icloud_team_picture_$->{team_id % 2}`
   ​          `icloud_team_picture_ext_inline:`
   ​            `type: inline`
   ​            `props:`
   ​              `algorithm-expression: icloud_team_picture_ext_$->{team_id % 2}
   ​          icloud_team_picture_meta_inline:
   ​            type: inline
   ​            props:
   ​              algorithm-expression: icloud_team_picture_meta_$->{team_id % 2}`
   ​        `keyGenerators:`
   ​          `leaf:`
   ​            `type: "LEAF"`
   **This is my seata configuration**
   seata:
     registry:
       type: nacos
     config:
       type: nacos
       nacos:
         server-addr: 127.0.0.1:8848
         group: SEATA_GROUP
         username: nacos
         password: nacos
     tx-service-group: camera-icloud-tx-group
     application-id: camera-icloud
     use-jdk-proxy: true
   @FlyingZC 


-- 
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] chengyonghu commented on issue #21558: shardingsphere5.1.2+seata1.5.1

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

   `spring:`
     `shardingsphere:`
       `datasource:`
         `ds-0:`
           `driver-class-name: com.mysql.cj.jdbc.Driver`
           `type: com.alibaba.druid.pool.DruidDataSource`
           `driverClassName: com.mysql.jdbc.Driver`
           `url: jdbc:mysql://192.168.0.12:3307/xx?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8`
           `username:`
           `password:`
         `names: ds-0`
       `rules:`
         `sharding:`
   
   ​        `binding-tables:`
   
      - `icloud_user_picture,icloud_user_picture_ext,icloud_user_picture_meta`
        `ud_user_folder,icloud_user_folder_ext`
           - `icloud_team_picture,icloud_team_picture_ext,icloud_team_picture_meta`
             `ud_team_folder,icloud_team_folder_ext`
                     `tables:`
   
   ​          `icloud_user_picture: # 逻辑表名称`
   ​            `actualDataNodes: ds-0.icloud_user_picture_$->{0..1} # 由数据源名 + 表名组成(参考 Inline 语法规则)`
   ​            `tableStrategy: # 分表策略,同分库策略`
   ​              `standard:`
   ​                `shardingColumn: user_id #分配键`
   ​                `shardingAlgorithmName: icloud_user_picture_inline #分片规则`
   ​            `keyGenerateStrategy: # 分布式序列策略`
   ​              `column: picture_id # 自增列名称,缺省表示不使用自增主键生成器`
   ​              `keyGeneratorName: leaf # 分布式序列算法名称`
   
   ​        `sharding-algorithms:`
   ​          `icloud_sys_log_inline:`
   ​            `type: CLASS_BASED`
   ​            `props:`
   ​              `strategy: STANDARD`
   ​              `algorithmClassName: com.ydtx.camera.icloud.config.CustomPreciseShardingAlgorithm`
   ​          `icloud_user_picture_inline:`
   ​            `type: inline`
   ​            `props:`
   ​              `algorithm-expression: icloud_user_picture_$->{user_id % 2}
   ​          icloud_user_picture_ext_inline:
   ​            type: inline
   ​            props:
   ​              algorithm-expression: icloud_user_picture_ext_$->{user_id % 2}`
   ​        `keyGenerators:`
   ​          `leaf:`
   ​            `type: "LEAF"`
   
   ## seata 配置
   
   ```
   seata:
     registry:
       type: nacos
     config:
       type: nacos
       nacos:
         server-addr: 127.0.0.1:8848
         group: SEATA_GROUP
         username: nacos
         password: nacos
     #对应nacos配置 service.vgroupMapping.XXXX
     tx-service-group: camera-icloud-tx-group
     application-id: camera-icloud
     use-jdk-proxy: true
   ```


-- 
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] chengyonghu commented on issue #21558: shardingsphere5.1.2+seata1.5.1

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

   Hello, there is another case that sharding key will be lost after using seata proxy for shardingsphere data source, which will not happen if I use primary key
   @FlyingZC 


-- 
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] FlyingZC commented on issue #21558: shardingsphere5.1.2+seata1.5.1

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

   Can you provide your shardingsphere and seata configuration.


-- 
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] chengyonghu commented on issue #21558: shardingsphere5.1.2+seata1.5.1

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

   
   
   ## `shardingsphere configuration`
   
   ```
   spring:
     shardingsphere:
       datasource:
         ds-0:
           driver-class-name: com.mysql.cj.jdbc.Driver
           type: com.alibaba.druid.pool.DruidDataSource
           driverClassName: com.mysql.jdbc.Driver
           url: jdbc:mysql://192.168.0.xx2:3307/xx?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
           username: root
           password: xx
         names: ds-0
       rules:
         sharding:
           # 设置绑定表
           binding-tables:
             - icloud_user_picture
           tables:
             # 个人图片基本信息表
             icloud_user_picture: # 逻辑表名称
               actualDataNodes: ds-0.icloud_user_picture_$->{0..1} # 由数据源名 + 表名组成(参考 Inline 语法规则)
               tableStrategy: # 分表策略,同分库策略
                 standard:
                   shardingColumn: user_id #分配键
                   shardingAlgorithmName: icloud_user_picture_inline #分片规则
               keyGenerateStrategy: # 分布式序列策略
                 column: picture_id # 自增列名称,缺省表示不使用自增主键生成器
                 keyGeneratorName: leaf # 分布式序列算法名称
           # 分片规则
           sharding-algorithms:
             icloud_sys_log_inline:
               type: CLASS_BASED
               props:
                 strategy: STANDARD
                 algorithmClassName: com.ydtx.camera.icloud.config.CustomPreciseShardingAlgorithm
             icloud_user_picture_inline:
               type: inline
               props:
                 algorithm-expression: icloud_user_picture_$->{user_id % 2}
           keyGenerators:
             leaf:
               type: "LEAF"
   
       props:
         sql-show: true
   ```
   
   
   
   ## seata configuration
   
   ```
   seata:
     registry:
       type: nacos
     config:
       type: nacos
       nacos:
         server-addr: 127.0.0.1:8848
         group: SEATA_GROUP
         username: nacos
         password: nacos
     #对应nacos配置 service.vgroupMapping.XXXX
     tx-service-group: camera-icloud-tx-group
     application-id: camera-icloud
     use-jdk-proxy: true
   ```
   @FlyingZC 


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