Skip to content

Commit 512efbf

Browse files
committed
Upgrade to Kafka 3.7.0
1 parent 9f96cb5 commit 512efbf

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

kareldb-server/src/main/java/io/kareldb/server/leader/ClientConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class ClientConfig extends AbstractConfig {
4040
public static final long RECONNECT_BACKOFF_MS_DEFAULT = 50L;
4141
public static final long RECONNECT_BACKOFF_MAX_MS_DEFAULT = 1000L;
4242
public static final long RETRY_BACKOFF_MS_DEFAULT = 100L;
43+
public static final long RETRY_BACKOFF_MAX_MS_DEFAULT = 1000L;
4344
public static final int REQUEST_TIMEOUT_MS_DEFAULT = 305000;
4445
public static final long CONNECTIONS_MAX_IDLE_MS_DEFAULT = 9 * 60 * 1000;
4546

@@ -88,6 +89,12 @@ class ClientConfig extends AbstractConfig {
8889
atLeast(0L),
8990
ConfigDef.Importance.LOW,
9091
CommonClientConfigs.RETRY_BACKOFF_MS_DOC)
92+
.define(CommonClientConfigs.RETRY_BACKOFF_MAX_MS_CONFIG,
93+
ConfigDef.Type.LONG,
94+
RETRY_BACKOFF_MAX_MS_DEFAULT,
95+
atLeast(0L),
96+
ConfigDef.Importance.LOW,
97+
CommonClientConfigs.RETRY_BACKOFF_MAX_MS_DOC)
9198
.define(CommonClientConfigs.REQUEST_TIMEOUT_MS_CONFIG,
9299
ConfigDef.Type.INT,
93100
// chosen to be higher than the default of max.poll.interval.ms

kareldb-server/src/main/java/io/kareldb/server/leader/KarelDbCoordinator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public KarelDbCoordinator(
6767
String metricGrpPrefix,
6868
Time time,
6969
long retryBackoffMs,
70+
long retryBackoffMaxMs,
7071
KarelDbIdentity identity,
7172
KarelDbRebalanceListener listener) {
7273
super(
@@ -77,6 +78,7 @@ public KarelDbCoordinator(
7778
groupId,
7879
Optional.empty(),
7980
retryBackoffMs,
81+
retryBackoffMaxMs,
8082
true
8183
),
8284
logContext,

kareldb-server/src/main/java/io/kareldb/server/leader/KarelDbLeaderElector.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class KarelDbLeaderElector implements KarelDbRebalanceListener, UrlProvid
7777
private final Metrics metrics;
7878
private final Metadata metadata;
7979
private final long retryBackoffMs;
80+
private final long retryBackoffMaxMs;
8081
private final KarelDbCoordinator coordinator;
8182
private final List<URI> listeners;
8283
private final KarelDbIdentity myIdentity;
@@ -110,11 +111,13 @@ public KarelDbLeaderElector(KarelDbConfig config, KarelDbEngine engine) throws K
110111

111112
this.metrics = new Metrics(metricConfig, reporters, time, metricsContext);
112113
this.retryBackoffMs = clientConfig.getLong(CommonClientConfigs.RETRY_BACKOFF_MS_CONFIG);
114+
this.retryBackoffMaxMs = clientConfig.getLong(CommonClientConfigs.RETRY_BACKOFF_MAX_MS_CONFIG);
113115
String groupId = config.getString(KarelDbConfig.CLUSTER_GROUP_ID_CONFIG);
114116
LogContext logContext = new LogContext("[KarelDB clientId=" + clientId + ", groupId="
115117
+ groupId + "] ");
116118
this.metadata = new Metadata(
117119
retryBackoffMs,
120+
retryBackoffMaxMs,
118121
clientConfig.getLong(CommonClientConfigs.METADATA_MAX_AGE_CONFIG),
119122
logContext,
120123
new ClusterResourceListeners()
@@ -169,6 +172,7 @@ public KarelDbLeaderElector(KarelDbConfig config, KarelDbEngine engine) throws K
169172
metricGrpPrefix,
170173
time,
171174
retryBackoffMs,
175+
retryBackoffMaxMs,
172176
myIdentity,
173177
this
174178
);

kareldb-server/src/test/java/io/kareldb/server/leader/KarelDbCoordinatorTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class KarelDbCoordinatorTest {
7777
private int rebalanceTimeoutMs = 60;
7878
private int heartbeatIntervalMs = 2;
7979
private long retryBackoffMs = 100;
80+
private long retryBackoffMaxMs = 1000;
8081
private MockTime time;
8182
private MockClient client;
8283
private Cluster cluster = TestUtils.singletonCluster("topic", 1);
@@ -90,7 +91,8 @@ public class KarelDbCoordinatorTest {
9091
@Before
9192
public void setup() {
9293
this.time = new MockTime();
93-
this.metadata = new Metadata(0, Long.MAX_VALUE, new LogContext(), new ClusterResourceListeners());
94+
this.metadata = new Metadata(
95+
0, Long.MAX_VALUE, Long.MAX_VALUE, new LogContext(), new ClusterResourceListeners());
9496
this.client = new MockClient(time, new MockClient.MockMetadataUpdater() {
9597
@Override
9698
public List<Node> fetchNodes() {
@@ -124,6 +126,7 @@ public void update(Time time, MockClient.MetadataUpdate update) {
124126
"kdb-" + groupId,
125127
time,
126128
retryBackoffMs,
129+
retryBackoffMaxMs,
127130
LEADER_INFO,
128131
rebalanceListener
129132
);

0 commit comments

Comments
 (0)