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/04/15 06:48:14 UTC

[GitHub] [shardingsphere] sunzhen086 opened a new issue, #16849: @Transactional cause all sql route to write database even in other request

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   5.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   i hava three databases of mysql,one for write,tow for read,i use ShardingSphere-Proxy and config readwrite-splitting, when a select not in transaction, i think it will route to read database .
   
   ### Actual behavior
   
   begin, all my examples run good util a request with @Transactional ,after this request,all select sql route to write database  even in other request
   
   ### Reason analyze (If you can)
   
   i debug the ShardingSphere-Proxy,find the TransactionHolder.isTransaction=true,but i can't understand why a request with transaction can affect other request
   
   
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   -------------------------------------------------------
   config-readwrite-splitting.yaml
   
   
   schemaName: x1db_shardingsphere
   
   dataSources:
     write_ds_141:
       url: jdbc:mysql://10.110.34.141:3306/x1db?serverTimezone=UTC&useSSL=false&characterEncoding=utf8
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     read_ds_151:
       url: jdbc:mysql://10.110.34.151:3306/x1db?serverTimezone=UTC&useSSL=false&characterEncoding=utf8
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     read_ds_152:
       url: jdbc:mysql://10.110.34.152:3306/x1db?serverTimezone=UTC&useSSL=false&characterEncoding=utf8
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !READWRITE_SPLITTING
     dataSources:
       readwrite_ds:
         type: Static
         props:
           write-data-source-name: write_ds_141
           read-data-source-names: read_ds_151, read_ds_152
   
   -------------------------------------------------------
   server.yaml
   
   rules:
     - !AUTHORITY
       users:
         - root@%:shardingsphere@141
       provider:
         type: ALL_PRIVILEGES_PERMITTED
     - !SQL_PARSER
       sqlCommentParseEnabled: true
       sqlStatementCache:
         initialCapacity: 2000
         maximumSize: 65535
         concurrencyLevel: 4
       parseTreeCache:
         initialCapacity: 128
         maximumSize: 1024
         concurrencyLevel: 4
   props:
     max-connections-size-per-query: 1
     kernel-executor-size: 16  
     proxy-frontend-flush-threshold: 128  
     proxy-opentracing-enabled: false
     proxy-hint-enabled: false
     sql-show: true
     check-table-metadata-enabled: false
     show-process-list-enabled: false
     proxy-backend-query-fetch-size: -1
     check-duplicate-table-enabled: false
     proxy-frontend-executor-size: 0 
     proxy-backend-executor-suitable: OLAP
     proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
     sql-federation-enabled: false
     proxy-backend-driver-type: JDBC
   
   -----------------------------------------------------
   
   ![image](https://user-images.githubusercontent.com/16077783/163531912-e37b0634-45e4-4d26-beb6-9943953d97b1.png)
   
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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] sunzhen086 closed issue #16849: @Transactional cause all sql route to write database even in other request

Posted by GitBox <gi...@apache.org>.
sunzhen086 closed issue #16849: @Transactional cause all sql route to write database  even in other request
URL: https://github.com/apache/shardingsphere/issues/16849


-- 
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] sunzhen086 commented on issue #16849: @Transactional cause all sql route to write database even in other request

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

   #14868 


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