Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set retention.ms to -1 instead of Long.MAX_VALUE #5560

Merged
merged 1 commit into from
Jun 6, 2020

Conversation

agavra
Copy link
Contributor

@agavra agavra commented Jun 6, 2020

Description

There may be a bug with Kafka's handling of Long.MAX_VALUE as a topic retention. This PR is defensive in setting it to the documented value for infinite retention: -1

Testing done

Unit testing, and spun up a new ksql server:

Topic: _confluent-ksql-default__command_topic	PartitionCount: 1	ReplicationFactor: 1	Configs: min.insync.replicas=1,cleanup.policy=delete,segment.bytes=1073741824,retention.ms=-1,unclean.leader.election.enable=false

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@agavra agavra requested a review from apurvam June 6, 2020 20:28
@agavra agavra requested a review from a team as a code owner June 6, 2020 20:28
@apurvam
Copy link
Contributor

apurvam commented Jun 6, 2020

can you verify the behavior for when you have this patch and restart the server with a non -1 value? Say the old LONG_MAX? Does it switch to -1?

@agavra
Copy link
Contributor Author

agavra commented Jun 6, 2020

At t=0 spun it up with 0.9.0:

Topic: _confluent-ksql-default__command_topic	PartitionCount: 1	ReplicationFactor: 1	Configs: min.insync.replicas=1,cleanup.policy=delete,segment.bytes=1073741824,retention.ms=9223372036854775807,unclean.leader.election.enable=false

Tore down ksql and spun up my custom one:

Topic: _confluent-ksql-default__command_topic	PartitionCount: 1	ReplicationFactor: 1	Configs: min.insync.replicas=1,cleanup.policy=delete,segment.bytes=1073741824,retention.ms=-1,unclean.leader.election.enable=false
	Topic: _confluent-ksql-default__command_topic	Partition: 0	Leader: 1	Replicas: 1	Isr: 1

Copy link
Contributor

@rodesai rodesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@agavra agavra merged commit 22da8a0 into confluentinc:master Jun 6, 2020
@agavra agavra deleted the retention branch June 6, 2020 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants