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/07/09 07:21:33 UTC

[GitHub] [shardingsphere] RaigorJiang opened a new issue #11247: [Question] Why the props keys does not match Hikari properties in Converter

RaigorJiang opened a new issue #11247:
URL: https://github.com/apache/shardingsphere/issues/11247


   ### Background
   Currently, we use [Hikari](https://github.com/brettwooldridge/HikariCP) as the connection pool In `Proxy`, and properties are seted to the connection pool in class `DataSourceConfiguration` by invoke the `setter` method.
   
   But in class `DataSourceParameterConverter`, where the props are prepared for Hikari, some keys are not match the Hikari prroperties, such as `maxPoolSize`, `minPoolSize`, `maintenanceIntervalMilliseconds`. 
   ```java
   private static DataSourceConfiguration createDataSourceConfiguration(final DataSourceParameter dataSourceParameter) {
           DataSourceConfiguration result = new DataSourceConfiguration(HikariDataSource.class.getName());
           result.getProps().put("jdbcUrl", dataSourceParameter.getUrl());
           result.getProps().put("username", dataSourceParameter.getUsername());
           result.getProps().put("password", dataSourceParameter.getPassword());
           result.getProps().put("connectionTimeout", dataSourceParameter.getConnectionTimeoutMilliseconds());
           result.getProps().put("idleTimeout", dataSourceParameter.getIdleTimeoutMilliseconds());
           result.getProps().put("maxLifetime", dataSourceParameter.getMaxLifetimeMilliseconds());
           result.getProps().put("maxPoolSize", dataSourceParameter.getMaxPoolSize());
           result.getProps().put("minPoolSize", dataSourceParameter.getMinPoolSize());
           result.getProps().put("maintenanceIntervalMilliseconds", dataSourceParameter.getMaintenanceIntervalMilliseconds());
           result.getProps().put("readOnly", dataSourceParameter.isReadOnly());
           if (null != dataSourceParameter.getCustomPoolProps()) {
               result.getProps().putAll(new HashMap(dataSourceParameter.getCustomPoolProps()));
           }
           return result;
       }
   ```
   
   > In Hikari, there is a property `maximumPoolSize`  but no `maxPooSize`.
   
   So,  although `maxPoolSize` is specified to '50' in our configuration, it is actually the default value '10' used.
   
   ### Question
   Is this a defect?  Or are there other considerations? 
   
   


-- 
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] RaigorJiang commented on issue #11247: [Question] Why the props keys does not match Hikari properties in Converter

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #11247:
URL: https://github.com/apache/shardingsphere/issues/11247#issuecomment-878886696


   @terrymanu 
   Yes, after investigating parameters of class `HikariConfig` and historical code of ShardingSphere, the following information is obtained:
   
   - The parameter corresponding to `maintenanceIntervalMilliseconds` cannot be found in Hikari, `maintenanceIntervalMilliseconds`has never been used. 
   - There is no `minPoolSize` parameter in Hikari,  but `minimumIdle` is close to it. Hikari's suggestion is not to configure it.
   - `maxPoolSize` should be `maximumPoolSize`.
   
   In summary, I suggest to modify the props name of `maxPoolSize`(just in DataSourceParameterConverter) and delete the other two parameters.


-- 
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] terrymanu commented on issue #11247: [Question] Why the props keys does not match Hikari properties in Converter

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #11247:
URL: https://github.com/apache/shardingsphere/issues/11247#issuecomment-879118861


   Great, please go ahead


-- 
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] RaigorJiang edited a comment on issue #11247: [Question] Why the props keys does not match Hikari properties in Converter

Posted by GitBox <gi...@apache.org>.
RaigorJiang edited a comment on issue #11247:
URL: https://github.com/apache/shardingsphere/issues/11247#issuecomment-878886696


   @terrymanu 
   Yes, after investigating parameters of class `HikariConfig` and historical code of ShardingSphere, the following information is obtained:
   
   - The parameter corresponding to `maintenanceIntervalMilliseconds` cannot be found in Hikari, `maintenanceIntervalMilliseconds`has never been used. 
   - There is no `minPoolSize` parameter in Hikari,  but `minimumIdle` is close to it. Hikari's suggestion is not to configure it.
   - `maxPoolSize` should be `maximumPoolSize`.
   
   In summary, I suggest to modify the props name of `maxPoolSize` and `maxPoolSize ` (just in DataSourceParameterConverter) and delete `maintenanceIntervalMilliseconds `.


-- 
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] tristaZero closed issue #11247: [Question] Why the props keys does not match Hikari properties in Converter

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #11247:
URL: https://github.com/apache/shardingsphere/issues/11247


   


-- 
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] RaigorJiang commented on issue #11247: [Question] Why the props keys does not match Hikari properties in Converter

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #11247:
URL: https://github.com/apache/shardingsphere/issues/11247#issuecomment-878887773


   Here is a reference: https://github.com/apache/shardingsphere/pull/6708 to remote `maintenanceIntervalMilliseconds`


-- 
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] RaigorJiang edited a comment on issue #11247: [Question] Why the props keys does not match Hikari properties in Converter

Posted by GitBox <gi...@apache.org>.
RaigorJiang edited a comment on issue #11247:
URL: https://github.com/apache/shardingsphere/issues/11247#issuecomment-878887773


   Here is a reference: https://github.com/apache/shardingsphere/pull/6708 to remove `maintenanceIntervalMilliseconds`


-- 
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] terrymanu commented on issue #11247: [Question] Why the props keys does not match Hikari properties in Converter

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #11247:
URL: https://github.com/apache/shardingsphere/issues/11247#issuecomment-878874836


   I don't see the usage of these parameters, can we just remove them?


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