strongduanmu commented on issue #10996:
URL: 
https://github.com/apache/shardingsphere/issues/10996#issuecomment-894158173


   When I use the encrypt feature alone and configure multiple data sources, 
refresh the metadata after executing create table statement, there is a certain 
probability that it will fail. When Encrypt loads metadata, it always selects 
the first data source, which results in that metadata cannot be loaded when 
distributed to other data sources.
   
   ```java
   /**
    * Table meta data builder for encrypt.
    */
   public final class EncryptTableMetaDataBuilder implements 
RuleBasedTableMetaDataBuilder<EncryptRule> {
       
       @Override
       public Optional<TableMetaData> load(final String tableName, final 
DatabaseType databaseType, final Map<String, DataSource> dataSourceMap, final 
DataNodes dataNodes,
                                           final EncryptRule encryptRule, final 
ConfigurationProperties props) throws SQLException {
           return encryptRule.findEncryptTable(tableName).isPresent() ? 
TableMetaDataLoader.load(dataSourceMap.values().iterator().next(), tableName, 
databaseType) : Optional.empty();
       }
   }
   ```


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