You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2026/06/27 07:23:57 UTC

(shardingsphere) branch master updated: Fix readwrite splitting swap pool config (#38937)

This is an automated email from the ASF dual-hosted git repository.

terrymanu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new f837b613b3f Fix readwrite splitting swap pool config (#38937)
f837b613b3f is described below

commit f837b613b3ffb912d897537abdb8e9419518e25e
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Jun 27 15:23:51 2026 +0800

    Fix readwrite splitting swap pool config (#38937)
    
    - Correct min and max pool size order in readwrite splitting swap fixture
    - Use realistic idle timeout and max lifetime values
    - Update YAML swapper assertions to match the corrected pool settings
---
 .../config/yaml/swapper/YamlProxyConfigurationSwapperTest.java    | 8 ++++----
 .../yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java | 8 ++++----
 .../test/resources/conf/swap/database-readwrite-splitting.yaml    | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyConfigurationSwapperTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyConfigurationSwapperTest.java
index 2318ac24381..332ccc589b0 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyConfigurationSwapperTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyConfigurationSwapperTest.java
@@ -61,10 +61,10 @@ class YamlProxyConfigurationSwapperTest {
         assertThat(dataSource.getUsername(), is("sa"));
         assertThat(dataSource.getPassword(), is(""));
         assertThat(dataSource.getConnectionTimeout(), is(250L));
-        assertThat(dataSource.getIdleTimeout(), is(2L));
-        assertThat(dataSource.getMaxLifetime(), is(3L));
-        assertThat(dataSource.getMaximumPoolSize(), is(4));
-        assertThat(dataSource.getMinimumIdle(), is(5));
+        assertThat(dataSource.getIdleTimeout(), is(30000L));
+        assertThat(dataSource.getMaxLifetime(), is(600000L));
+        assertThat(dataSource.getMaximumPoolSize(), is(5));
+        assertThat(dataSource.getMinimumIdle(), is(4));
         assertTrue(dataSource.isReadOnly());
     }
     
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java
index 2ee84fa3bc3..5e4e7034c76 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java
@@ -56,10 +56,10 @@ class YamlProxyDataSourceConfigurationSwapperTest {
         PoolConfiguration actualPool = actualDataSourceConfig.getPool();
         assertNotNull(actualPool);
         assertThat(actualPool.getConnectionTimeoutMilliseconds(), is(250L));
-        assertThat(actualPool.getIdleTimeoutMilliseconds(), is(2L));
-        assertThat(actualPool.getMaxLifetimeMilliseconds(), is(3L));
-        assertThat(actualPool.getMaxPoolSize(), is(4));
-        assertThat(actualPool.getMinPoolSize(), is(5));
+        assertThat(actualPool.getIdleTimeoutMilliseconds(), is(30000L));
+        assertThat(actualPool.getMaxLifetimeMilliseconds(), is(600000L));
+        assertThat(actualPool.getMaxPoolSize(), is(5));
+        assertThat(actualPool.getMinPoolSize(), is(4));
         assertTrue(actualPool.getReadOnly());
     }
 }
diff --git a/proxy/backend/core/src/test/resources/conf/swap/database-readwrite-splitting.yaml b/proxy/backend/core/src/test/resources/conf/swap/database-readwrite-splitting.yaml
index 8ef1cf762b4..687bddfcf95 100644
--- a/proxy/backend/core/src/test/resources/conf/swap/database-readwrite-splitting.yaml
+++ b/proxy/backend/core/src/test/resources/conf/swap/database-readwrite-splitting.yaml
@@ -24,10 +24,10 @@ dataSources:
     username: sa
     password: ""
     connectionTimeoutMilliseconds: 250
-    idleTimeoutMilliseconds: 2
-    maxLifetimeMilliseconds: 3
-    maxPoolSize:  4
-    minPoolSize: 5
+    idleTimeoutMilliseconds: 30000
+    maxLifetimeMilliseconds: 600000
+    maxPoolSize: 5
+    minPoolSize: 4
     readOnly: true
 
 rules: