fix(rds): accept SessionPinningFilters on non-MySQL DB proxies (#8606)

This commit is contained in:
Allen Sanborn authored and GitHub committed 2026-11-16 17:10:52 -04:00
1 parent 5f77b841a2
commit bda82cc98d
3 files changed
+39 -12

No files matched your search

@@ -7583,7 +7583,7 @@ public class RdsService implements Resettable, ResourceProvider {
DbProxy proxy = getDbProxy(dbProxyName, effectiveRegion);
DbProxyTargetGroup targetGroup = getDefaultProxyTargetGroup(
dbProxyName, targetGroupName, effectiveRegion);
validatePoolConfiguration(proxy, maxConnectionsPercent, maxIdleConnectionsPercent,
validatePoolConfiguration(maxConnectionsPercent, maxIdleConnectionsPercent,
connectionBorrowTimeout, sessionPinningFilters);
DbProxyTargetGroup updatedTargetGroup = copyProxyTargetGroup(targetGroup);
if (maxConnectionsPercent != null) {
@@ -7634,7 +7634,7 @@ public class RdsService implements Resettable, ResourceProvider {
List<String> instanceIds = dbInstanceIdentifiers != null
? dbInstanceIdentifiers : List.of();
validateProxyTargetSelection(proxy, clusterIds, instanceIds, effectiveRegion);
validatePoolConfiguration(proxy, maxConnectionsPercent, maxIdleConnectionsPercent,
validatePoolConfiguration(maxConnectionsPercent, maxIdleConnectionsPercent,
connectionBorrowTimeout, sessionPinningFilters);
DbProxyTarget currentTarget = original.getTargets().isEmpty()
@@ -9707,12 +9707,12 @@ public class RdsService implements Resettable, ResourceProvider {
private void validatePoolConfiguration(Integer maxConnectionsPercent,
Integer maxIdleConnectionsPercent) {
validatePoolConfiguration(null, maxConnectionsPercent, maxIdleConnectionsPercent,
validatePoolConfiguration(maxConnectionsPercent, maxIdleConnectionsPercent,
null, null);
}
private void validatePoolConfiguration(
DbProxy proxy, Integer maxConnectionsPercent, Integer maxIdleConnectionsPercent,
Integer maxConnectionsPercent, Integer maxIdleConnectionsPercent,
Integer connectionBorrowTimeout, List<String> sessionPinningFilters) {
if (maxConnectionsPercent != null) {
validatePercent("MaxConnectionsPercent", maxConnectionsPercent, 1, 100);
@@ -9729,10 +9729,6 @@ public class RdsService implements Resettable, ResourceProvider {
validatePercent("ConnectionBorrowTimeout", connectionBorrowTimeout, 0, 300);
}
if (sessionPinningFilters != null && !sessionPinningFilters.isEmpty()) {
if (proxy == null || !"MYSQL".equals(proxy.getEngineFamily())) {
throw new AwsException("InvalidParameterValue",
"SessionPinningFilters are supported only for MYSQL DB proxies.", 400);
}
if (sessionPinningFilters.stream()
.anyMatch(filter -> !"EXCLUDE_VARIABLE_SETS".equals(filter))) {
throw new AwsException("InvalidParameterValue",