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/05/16 15:18:04 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue, #17715: Consider optimizing existing metadata renew logic

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

   ## Feature Request
   
   ### Is your feature request related to a problem?
   
   No
   
   ### Describe the feature you would like.
   
   There are two problems in the existing metadata renew logic:
   
   1. The following putAll method is used in the renew logic to update the metadata in memory, which makes us need to control the concurrency of the metadata;
   
   ```java
   private void refreshMetaDataContext(final String databaseName, final Map<String, DataSourceProperties> dataSourceProps) throws SQLException {
       MetaDataContexts changedMetaDataContext = buildChangedMetaDataContextWithAddedDataSource(metaDataContexts.getMetaDataMap().get(databaseName), dataSourceProps);
       metaDataContexts.getMetaDataMap().putAll(changedMetaDataContext.getMetaDataMap());
       metaDataContexts.getOptimizerContext().getFederationMetaData().getDatabases().putAll(changedMetaDataContext.getOptimizerContext().getFederationMetaData().getDatabases());
       metaDataContexts.getOptimizerContext().getParserContexts().putAll(changedMetaDataContext.getOptimizerContext().getParserContexts());
       metaDataContexts.getOptimizerContext().getPlannerContexts().putAll(changedMetaDataContext.getOptimizerContext().getPlannerContexts());
       renewTransactionContext(databaseName, metaDataContexts.getMetaData(databaseName).getResource());
   }
   ```
   
   2. The `databaseMap` in the `MetaDataContextsBuilder` contains the system database and the normal database, and maintaining them in one object will lead to the cost of understanding and unnecessary execution logic when renewing metadata;
   


-- 
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] github-actions[bot] closed issue #17715: Consider optimizing existing metadata renew logic

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #17715: Consider optimizing existing metadata renew logic
URL: https://github.com/apache/shardingsphere/issues/17715


-- 
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] github-actions[bot] commented on issue #17715: Consider optimizing existing metadata renew logic

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #17715:
URL: https://github.com/apache/shardingsphere/issues/17715#issuecomment-1272349787

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


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