RaigorJiang commented on code in PR #19037:
URL: https://github.com/apache/shardingsphere/pull/19037#discussion_r918491438
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/ImportDatabaseConfigurationHandler.java:
##########
@@ -94,73 +91,84 @@ protected void update(final ContextManager contextManager)
throws DistSQLExcepti
String databaseName = yamlConfig.getDatabaseName();
checkDatabaseName(databaseName, file);
checkDataSource(yamlConfig.getDataSources(), file);
- updateResources(databaseName, yamlConfig.getDataSources());
- updateRules(databaseName, yamlConfig.getRules());
+ addDatabase(databaseName);
+ addResources(databaseName, yamlConfig.getDataSources());
+ try {
+ addRules(databaseName, yamlConfig.getRules());
+ } catch (DistSQLException ex) {
+ dropDatabase(databaseName);
+ throw new RuntimeException(ex.getMessage());
Review Comment:
Why is RuntimeException thrown?
--
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]