Enternal-ZERO commented on issue #23421:
URL: 
https://github.com/apache/shardingsphere/issues/23421#issuecomment-1375350425

   > Hi @Enternal-ZERO I remember a scene related to #13375, pseudocode:
   > 
   > ```java
   > public String fooQuery {
   > # insert a request log
   > statement.executeUpdate("xxx");
   > 
   > # do some business query
   > statement.executeQuery("xxx");
   > ...
   > return result;
   > }
   > ```
   > 
   > As above, if I have such a business scenario (record request log), then 
all request threads are `MASTER_VISITED`, and no request will be routed to the 
read data source. This violates the original intention of readwrite splitting.
   
   
   this sounds some troubles really .
   
   but remove this feature will cause data consistency , if user update version 
in product env. it is terrible..and it not mentioned in doc(5.x) 
   
   at least, i think it must be Highlight  in 5.x docs.
   
   in another way, can this feature be controlled by user self (use config)
   or give an entrance to manage a thread local status  by user code?
   because in sharding framework,the code using “ try catch + autocloseable 
”,thread local object will remove automatically
   i think this is nice. 
   but if use hintmanage to finish this feature ,user code should find a way to 
setMasterOnly, and find a way to release thread local object。
   in most time, these code “ set and release ”  is being separate.  and diff 
project ,such as WEB、JOB、 RPC , release code maybe different.
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to