Skip to content

Commit

Permalink
fix: change retention to -1L instead of Long.MAX_VALUE (#5561)
Browse files Browse the repository at this point in the history
  • Loading branch information
agavra authored Jun 6, 2020
1 parent 68e4136 commit 35a6775
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static void ensureTopic(final String name,

final short minInsyncReplica =
ksqlConfig.getShort(KsqlConfig.KSQL_INTERNAL_TOPIC_MIN_INSYNC_REPLICAS_PROPERTY);
final long requiredTopicRetention = Long.MAX_VALUE;
final long requiredTopicRetention = -1L;

if (topicClient.isTopicExists(name)) {
final TopicDescription description = topicClient.describeTopic(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class KsqlInternalTopicUtilsTest {
private static final boolean ENABLE_UNCLEAN_ELECTION = false;

private final Map<String, ?> commandTopicConfig = ImmutableMap.of(
TopicConfig.RETENTION_MS_CONFIG, Long.MAX_VALUE,
TopicConfig.RETENTION_MS_CONFIG, -1L,
TopicConfig.CLEANUP_POLICY_CONFIG, TopicConfig.CLEANUP_POLICY_DELETE,
TopicConfig.MIN_IN_SYNC_REPLICAS_CONFIG, INSYNC_REPLICAS,
TopicConfig.UNCLEAN_LEADER_ELECTION_ENABLE_CONFIG, ENABLE_UNCLEAN_ELECTION);
Expand Down Expand Up @@ -117,7 +117,7 @@ public void shouldNotAttemptToCreateInternalTopicIfItExists() {
public void shouldEnsureInternalTopicHasInfiniteRetention() {
// Given:
final Map<String, Object> retentionConfig = ImmutableMap.of(
TopicConfig.RETENTION_MS_CONFIG, Long.MAX_VALUE
TopicConfig.RETENTION_MS_CONFIG, -1L
);
whenTopicExistsWith(1, NREPLICAS);

Expand Down

0 comments on commit 35a6775

Please sign in to comment.