kfwang90 commented on a change in pull request #8906:
URL: https://github.com/apache/shardingsphere/pull/8906#discussion_r555055054
##########
File path:
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/metadata/dialect/PostgreSQLDataSourceMetaData.java
##########
@@ -41,7 +41,7 @@
private final String schema;
- private final Pattern pattern =
Pattern.compile("jdbc:postgresql://([\\w\\-\\.]+):?([0-9]*)/([\\w\\-]+)",
Pattern.CASE_INSENSITIVE);
+ private final Pattern pattern =
Pattern.compile("jdbc:postgresql://([\\w\\-\\.]+):?([0-9]*),?.*?/([\\w\\-]+)?\\S*",
Pattern.CASE_INSENSITIVE);
Review comment:
Like this secene: There is PG clusters, contains one master node and
another async slave node.
The replica-query file can config as this:
**master :
jdbc:postgresql://masterIp:5432,slaveIp:5432/db?targerServerType=master**
**slave :
jdbc:postgresql://masterIp:5432,slaveIp:5432/db?targerServerType=preferSlave**
When PG master node goes down, I can promote async node change to new master
fast. And the replica-query config file don't have to change. And the
application don't have to restart. JDBC will recovery over a moment time.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]