Skip to content

Commit

Permalink
Fix default kafka retention.bytes config
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhuw committed Dec 11, 2024
1 parent 98bba5e commit f757097
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/log/kafka.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ impl LogClient for KafkaLogClient {
}

async fn create_log(&self, name: &str, retention: ByteSize) -> Result<()> {
let retention_bytes = retention.0.to_compact_string();
let retention_bytes =
if retention == ByteSize::default() { "-1".to_compact_string() } else { retention.0.to_compact_string() };
let topics = [new_topic_config(name, self.replication, &retention_bytes)];
let mut results = self.client.create_topics(&topics, &AdminOptions::default()).await?;
let topic_result = results.pop().ok_or_else(|| anyhow!("no topic results in topic creation"))?;
Expand Down

0 comments on commit f757097

Please sign in to comment.