@@ -60,9 +60,22 @@ void addServerIfNeeded(@Nonnull WlsServerConfig serverConfig, WlsClusterConfig c
60
60
servers .add (serverName );
61
61
addStartupInfo (new ServerStartupInfo (serverConfig , clusterName , server ));
62
62
addToCluster (clusterName );
63
+ } else {
64
+ logIfReplicaExceeds (clusterConfig );
63
65
}
64
66
}
65
67
68
+ boolean exceedsMaxConfiguredClusterSize (WlsClusterConfig clusterConfig ) {
69
+ if (clusterConfig != null ) {
70
+ String clusterName = clusterConfig .getClusterName ();
71
+ int configClusterSize = clusterConfig .getMaxDynamicClusterSize ();
72
+ return clusterConfig .hasDynamicServers ()
73
+ && getReplicaCount (clusterName ) == configClusterSize
74
+ && domain .getReplicaCount (clusterName ) > configClusterSize ;
75
+ }
76
+ return false ;
77
+ }
78
+
66
79
private Step createNextStep (Step next ) {
67
80
if (servers .isEmpty ()) return next ;
68
81
else return new ManagedServerUpIteratorStep (getStartupInfos (), next );
@@ -84,6 +97,17 @@ private void addToCluster(String clusterName) {
84
97
private Integer getReplicaCount (String clusterName ) {
85
98
return Optional .ofNullable (replicas .get (clusterName )).orElse (0 );
86
99
}
100
+
101
+ private void logIfReplicaExceeds (WlsClusterConfig clusterConfig ) {
102
+ if (exceedsMaxConfiguredClusterSize (clusterConfig )) {
103
+ String clusterName = clusterConfig .getClusterName ();
104
+ LOGGER .warning (
105
+ "******* The replica count {1} exceeds the configured maximum dynamic cluster size {2} for cluster {0}" ,
106
+ clusterName ,
107
+ domain .getReplicaCount (clusterName ),
108
+ clusterConfig .getMaxDynamicClusterSize ());
109
+ }
110
+ }
87
111
}
88
112
89
113
public ManagedServersUpStep (Step next ) {
0 commit comments