Skip to content

Commit

Permalink
fix: set retention.ms to -1 instead of Long.MAX_VALUE (#5560)
Browse files Browse the repository at this point in the history
  • Loading branch information
agavra committed Jun 6, 2020
1 parent 50428c7 commit 22da8a0
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 @@ -35,7 +35,7 @@ public final class KsqlInternalTopicUtils {
private static final Logger log = LoggerFactory.getLogger(KsqlInternalTopicUtils.class);

private static final int INTERNAL_TOPIC_PARTITION_COUNT = 1;
private static final long INTERNAL_TOPIC_RETENTION_MS = Long.MAX_VALUE;
private static final long INTERNAL_TOPIC_RETENTION_MS = -1;

private static final ImmutableMap<String, ?> INTERNAL_TOPIC_CONFIG = ImmutableMap.of(
TopicConfig.RETENTION_MS_CONFIG, INTERNAL_TOPIC_RETENTION_MS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,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 @@ -119,7 +119,7 @@ public void shouldEnsureInternalTopicHasInfiniteRetentionAndDeleteCleanUpPolicy(

// Then:
verify(topicClient).addTopicConfig(TOPIC_NAME, ImmutableMap.of(
TopicConfig.RETENTION_MS_CONFIG, Long.MAX_VALUE,
TopicConfig.RETENTION_MS_CONFIG, -1L,
TopicConfig.CLEANUP_POLICY_CONFIG, TopicConfig.CLEANUP_POLICY_DELETE
));
}
Expand Down

0 comments on commit 22da8a0

Please sign in to comment.