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/01/06 06:36:35 UTC

[GitHub] [shardingsphere] kfwang90 opened a new pull request #8906: Support multiple databases for PostgreSQL.

kfwang90 opened a new pull request #8906:
URL: https://github.com/apache/shardingsphere/pull/8906


   Fixes about #8736.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] kfwang90 commented on a change in pull request #8906: Support multiple databases for PostgreSQL.

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [shardingsphere] kfwang90 commented on a change in pull request #8906: Support multiple databases for PostgreSQL.

Posted by GitBox <gi...@apache.org>.
kfwang90 commented on a change in pull request #8906:
URL: https://github.com/apache/shardingsphere/pull/8906#discussion_r554401489



##########
File path: shardingsphere-features/shardingsphere-ha/shardingsphere-ha-provider/shardingsphere-ha-mgr/pom.xml
##########
@@ -22,7 +22,7 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.shardingsphere</groupId>
-        <artifactId>shardingsphere-ha</artifactId>
+        <artifactId>shardingsphere-ha-provider</artifactId>

Review comment:
       > What is the proposal here?
   
   When I use maven clean intall all projects, it has a error at here. And this project is the child of shardingsphere-ha-provider. So I modify it and install again, thers is no more errors.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] kfwang90 commented on a change in pull request #8906: Support multiple databases for PostgreSQL.

Posted by GitBox <gi...@apache.org>.
kfwang90 commented on a change in pull request #8906:
URL: https://github.com/apache/shardingsphere/pull/8906#discussion_r554401489



##########
File path: shardingsphere-features/shardingsphere-ha/shardingsphere-ha-provider/shardingsphere-ha-mgr/pom.xml
##########
@@ -22,7 +22,7 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.shardingsphere</groupId>
-        <artifactId>shardingsphere-ha</artifactId>
+        <artifactId>shardingsphere-ha-provider</artifactId>

Review comment:
       > What is the proposal here?
   
   When I use maven clean intall all projects, it has a error at here. And this project is the child of shardingsphere-ha-provider. So I modify it and install again, thers is no more errors.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #8906: Support multiple databases for PostgreSQL.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #8906:
URL: https://github.com/apache/shardingsphere/pull/8906#discussion_r553875531



##########
File path: shardingsphere-features/shardingsphere-ha/shardingsphere-ha-provider/shardingsphere-ha-mgr/pom.xml
##########
@@ -22,7 +22,7 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.shardingsphere</groupId>
-        <artifactId>shardingsphere-ha</artifactId>
+        <artifactId>shardingsphere-ha-provider</artifactId>

Review comment:
       What is the proposal here?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #8906: Support multiple databases for PostgreSQL.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #8906:
URL: https://github.com/apache/shardingsphere/pull/8906#discussion_r553875531



##########
File path: shardingsphere-features/shardingsphere-ha/shardingsphere-ha-provider/shardingsphere-ha-mgr/pom.xml
##########
@@ -22,7 +22,7 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.shardingsphere</groupId>
-        <artifactId>shardingsphere-ha</artifactId>
+        <artifactId>shardingsphere-ha-provider</artifactId>

Review comment:
       What is the proposal here?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu merged pull request #8906: Support multiple databases for PostgreSQL.

Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #8906:
URL: https://github.com/apache/shardingsphere/pull/8906


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on a change in pull request #8906: Support multiple databases for PostgreSQL.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #8906:
URL: https://github.com/apache/shardingsphere/pull/8906#discussion_r554700933



##########
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:
       What is the different for use multiple hosts and replica-query rule?
   
   We need to discuss the production design here. It is better to use same way for same feature. I prefer use replica-query rule to deal with all master-slave scenarios.




----------------------------------------------------------------
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:
users@infra.apache.org