Skip to content

Commit 893a17e

Browse files
authored
Merge pull request #2 from ksampath8/remove-db-count-per-subscription-limit
Remove limitation blocking autoscaling when multiple databases exist in a subscription
2 parents b63b312 + 9c7cbe7 commit 893a17e

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

README.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ Rule To Scale Redis up 3 GB:
125125
== Limitations
126126

127127
* The Redis Cloud Autoscaler is currently only available for Redis Cloud Pro Subscriptions
128-
* The Redis Cloud Autoscaler will currently only operate on Subscriptions with as single database
129128
* The Redis Cloud Autoscaler will currently only scale a database in (down) deterministically (`Deterministic` is the only valid setting for `DecreaseMemory` and `DecreaseThroughput`)
130129

131130
== Availability

autoscaler/redis-cloud-autoscaler/src/main/java/com/redis/autoscaler/services/RedisCloudDatabaseService.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,6 @@ public Optional<Task> applyRule(Rule rule) throws IOException, InterruptedExcept
129129

130130
RedisCloudDatabase db = dbOpt.get();
131131

132-
int numDatabases = getDatabaseCount();
133-
if(numDatabases > 1){
134-
LOG.warn("Database count for subscription {} is greater than 1, using autoscaler is not supported, skipping rule: {}", config.getSubscriptionId(), rule);
135-
return Optional.empty();
136-
}
137-
138132

139133
ScaleRequest scaleRequest;
140134
switch (rule.getRuleType()){

autoscaler/redis-cloud-autoscaler/src/test/java/com/redis/autoscaler/RedisCloudDatabaseServiceTests.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ void testScaleDatabaseCRDBMemory() throws Exception {
147147
// Set up the sequence of responses
148148
when(httpClient.send(any(), any()))
149149
.thenReturn(httpResponse) // First call - get database
150-
.thenReturn(countResponse) // Second call - get database count
151150
.thenReturn(scaleResponse); // Third call - scale database
152151

153152
// Execute the rule
@@ -207,9 +206,8 @@ void testScaleDatabaseCRDBThroughput() throws Exception {
207206
// Set up the sequence of responses
208207
when(httpClient.send(any(), any()))
209208
.thenReturn(httpResponse) // First call - get database
210-
.thenReturn(countResponse) // Second call - get database count
211209
.thenReturn(scaleResponse); // Third call - scale database
212-
210+
213211
// Execute the rule
214212
Optional<Task> taskOpt = service.applyRule(rule);
215213

@@ -274,7 +272,6 @@ void testRoundUpToNearestTenth() throws Exception {
274272
// Set up the sequence of responses
275273
when(httpClient.send(any(), any()))
276274
.thenReturn(httpResponse) // First call - get database
277-
.thenReturn(countResponse) // Second call - get database count
278275
.thenReturn(scaleResponse); // Third call - scale database
279276

280277
// Execute the rule
@@ -332,7 +329,6 @@ void testRoundUpToNearest500() {
332329
// Set up the sequence of responses
333330
when(httpClient.send(any(), any()))
334331
.thenReturn(httpResponse) // First call - get database
335-
.thenReturn(countResponse) // Second call - get database count
336332
.thenReturn(scaleResponse); // Third call - scale database
337333

338334
// Execute the rule

0 commit comments

Comments
 (0)