You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "gavenpeng (via GitHub)" <gi...@apache.org> on 2023/03/06 08:43:28 UTC

[GitHub] [shardingsphere] gavenpeng commented on issue #24169: Shardingsphere sharding rule use error in two shardingsphere datasource and different sharding rule

gavenpeng commented on issue #24169:
URL: https://github.com/apache/shardingsphere/issues/24169#issuecomment-1455713860

   i looked the router code,found the routers  of PartialSQLRouteExecutor init maybe exist problem,the code is follow:
   
   ```
   public PartialSQLRouteExecutor(final Collection<ShardingSphereRule> rules, final ConfigurationProperties props) {
           this.props = props;
           routers = OrderedSPIRegistry.getRegisteredServices(rules, SQLRouter.class);
       }
   ```
   the last invoked the follow code:
   
   ```
   public static <K, V extends OrderedSPI<?>> void cacheServices(final Collection<K> types, final Class<V> orderedSPIClass, final Map<K, V> services) {
           CACHED_SERVICES.put(orderedSPIClass, new CachedOrderedServices(types, services));
       }
   ```
   the CACHED_SERVICES is concurrenthashmap,  the **orderedSPIClass** is sqlRouter classes, when exist multi sharding rule, the **CACHED_SERVICES** only cache the one rule, i see 5.20  modidyed the key contain rules


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