This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.2 by this push:
new 109d15eb972 branch-4.2: [improvement](connection) Make
max_user_connections upper bound follow qe_max_connection #67622 (#70040)
109d15eb972 is described below
commit 109d15eb972a8a3bb27a17b3026cc5d0ceccbf44
Author: morrySnow <[email protected]>
AuthorDate: Thu Nov 5 09:41:17 2026 +0800
branch-4.2: [improvement](connection) Make max_user_connections upper bound
follow qe_max_connection #67622 (#70040)
picked from master #67622
Co-authored-by: HonestManXin <[email protected]>
---
.../org/apache/doris/mysql/privilege/UserProperty.java | 5 +++--
.../java/org/apache/doris/catalog/UserPropertyTest.java | 14 ++++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java
index 62306ab5f67..21b3f9c49f0 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserProperty.java
@@ -223,8 +223,9 @@ public class UserProperty {
throw new DdlException(PROP_MAX_USER_CONNECTIONS + " is
not number");
}
- if (newMaxConn <= 0 || newMaxConn > 10000) {
- throw new DdlException(PROP_MAX_USER_CONNECTIONS + " is
not valid, must between 1 and 10000");
+ // No need to set a hard-coded upper bound for the per-user
max connections.
+ if (newMaxConn <= 0) {
+ throw new DdlException(PROP_MAX_USER_CONNECTIONS + " is
not valid, must be greater than 0");
}
} else if (keyArr[0].equalsIgnoreCase(DEFAULT_CLOUD_CLUSTER)) {
newDefaultCloudCluster = checkCloudDefaultCluster(keyArr,
value, DEFAULT_CLOUD_CLUSTER, isReplay);
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/catalog/UserPropertyTest.java
b/fe/fe-core/src/test/java/org/apache/doris/catalog/UserPropertyTest.java
index dbd161c7914..397ea6aa7c5 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/catalog/UserPropertyTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/UserPropertyTest.java
@@ -228,4 +228,18 @@ public class UserPropertyTest {
ConnectContext.remove();
}
}
+
+ @Test
+ public void testMaxConnectionsWithoutLegacyLimit() throws UserException {
+ UserProperty property = new UserProperty();
+ property.update(Lists.newArrayList(Pair.of("max_user_connections",
"10001")));
+ Assert.assertEquals(10001, property.getMaxConn());
+ property.update(Lists.newArrayList(Pair.of("max_user_connections",
Long.toString(Long.MAX_VALUE))));
+ Assert.assertEquals(Long.MAX_VALUE, property.getMaxConn());
+ for (String invalid : new String[] {"0", "-1", "9223372036854775808"})
{
+ Assert.assertThrows(UserException.class,
+ () ->
property.update(Lists.newArrayList(Pair.of("max_user_connections", invalid))));
+ }
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]