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 2021/08/26 11:59:37 UTC
[GitHub] [shardingsphere] menghaoranss opened a new issue #12031: There are some logical errors in ClusterContextManager
menghaoranss opened a new issue #12031:
URL: https://github.com/apache/shardingsphere/issues/12031
## Question
```
@Subscribe
public synchronized void renew(final SchemaChangedEvent event) {
try {
Map<String, ShardingSphereMetaData> schemaMetaData = new HashMap<>(metaDataContexts.getMetaDataMap().size(), 1);
for (Entry<String, ShardingSphereMetaData> entry : metaDataContexts.getMetaDataMap().entrySet()) {
String schemaName = entry.getKey();
ShardingSphereMetaData originalMetaData = entry.getValue();
ShardingSphereMetaData metaData = event.getSchemaName().equals(schemaName) ? getChangedMetaData(originalMetaData, event.getSchema(), schemaName) : originalMetaData;
schemaMetaData.put(schemaName, metaData);
metaDataContexts.getOptimizeContextFactory().getSchemaMetadatas().getSchemas().put(event.getSchemaName(),
new FederateSchemaMetadata(event.getSchemaName(), metaData.getSchema().getTables()));
}
metaDataContexts = new MetaDataContexts(persistService,
schemaMetaData, metaDataContexts.getGlobalRuleMetaData(), metaDataContexts.getExecutorEngine(), metaDataContexts.getProps(), metaDataContexts.getOptimizeContextFactory());
} finally {
ShardingSphereEventBus.getInstance().post(new InnerLockReleasedEvent(LockNameUtil.getMetadataRefreshLockName()));
}
}
```
`FederateSchemaMetadata` should be rebuilt with **Actual MetaData** after metadata changed, but the following code use Logic MetaData to create `FederateSchemaMetadata`.
```
new FederateSchemaMetadata(event.getSchemaName(), metaData.getSchema().getTables())
```
--
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] menghaoranss commented on issue #12031: There are some logical errors in ClusterContextManager
Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #12031:
URL: https://github.com/apache/shardingsphere/issues/12031#issuecomment-906350732
refer to #11958
--
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] strongduanmu closed issue #12031: There are some logical errors in ClusterContextManager
Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #12031:
URL: https://github.com/apache/shardingsphere/issues/12031
--
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