Skip to content

Commit 87d01fa

Browse files
author
Daniil Zulin
committed
Bugfix: set max_active_partitions on topic creation
1 parent 583dc0e commit 87d01fa

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

topic/src/main/java/tech/ydb/topic/impl/TopicClientImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public CompletableFuture<Status> createTopic(String path, CreateTopicSettings se
107107
if (partitioningSettings != null) {
108108
requestBuilder.setPartitioningSettings(YdbTopic.PartitioningSettings.newBuilder()
109109
.setMinActivePartitions(partitioningSettings.getMinActivePartitions())
110+
.setMaxActivePartitions(partitioningSettings.getMaxActivePartitions())
110111
.setPartitionCountLimit(partitioningSettings.getPartitionCountLimit())
111112
.setAutoPartitioningSettings(YdbTopic.AutoPartitioningSettings.newBuilder()
112113
.setStrategy(toProto(partitioningSettings.getAutoPartitioningStrategy()))));

topic/src/test/java/tech/ydb/topic/impl/YdbTopicsIntegrationTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.junit.BeforeClass;
1414
import org.junit.ClassRule;
1515
import org.junit.FixMethodOrder;
16-
import org.junit.Ignore;
1716
import org.junit.Test;
1817
import org.junit.runners.MethodSorters;
1918
import org.slf4j.Logger;
@@ -244,12 +243,13 @@ public void onMessages(DataReceivedEvent dre) {
244243
}
245244
}
246245

247-
@Ignore("remove ignore once :latest YDB container tag moves onto version 25.1")
248246
@Test
249247
public void step07_alterTopicWithAutoPartitioning() {
250248
client.alterTopic(TEST_TOPIC, AlterTopicSettings.newBuilder()
251249
.setAlterPartitioningSettings(AlterPartitioningSettings.newBuilder()
252250
.setAutoPartitioningStrategy(AutoPartitioningStrategy.SCALE_UP)
251+
.setMaxActivePartitions(10)
252+
.setMinActivePartitions(5)
253253
.setWriteStrategySettings(AlterAutoPartitioningWriteStrategySettings.newBuilder()
254254
.setStabilizationWindow(Duration.ofMinutes(1))
255255
.setUpUtilizationPercent(80)
@@ -267,8 +267,8 @@ public void step07_alterTopicWithAutoPartitioning() {
267267
.setUpUtilizationPercent(80)
268268
.setDownUtilizationPercent(20)
269269
.build())
270-
.setMinActivePartitions(1)
271-
.setMaxActivePartitions(1)
270+
.setMinActivePartitions(5)
271+
.setMaxActivePartitions(10)
272272
.build();
273273

274274
Assert.assertEquals(expectedPartitioningSettings, actualPartitioningSettings);

0 commit comments

Comments
 (0)