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

Even better log statement in Kafka #2293

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions crates/ingress-kafka/src/consumer_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,6 @@ impl ConsumerTask {
let topics: Vec<&str> = self.topics.iter().map(|x| &**x).collect();
consumer.subscribe(&topics)?;

debug!(
restate.subscription.id = %self.sender.subscription.id(),
messaging.consumer.group.name = consumer_group_id,
"Assigned topic/partitions/offset: {:?}",
consumer.assignment()?
);

Comment on lines -244 to -250
Copy link
Contributor Author

@slinkydeveloper slinkydeveloper Nov 14, 2024

Choose a reason for hiding this comment

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

This log statement is pointless because consumer.subscribe won't do anything until you recv from the stream the first time.

let mut topic_partition_tasks: HashMap<(String, i32), TaskId> = Default::default();

let result = loop {
Expand All @@ -269,6 +262,12 @@ impl ConsumerTask {
None => break Err(Error::TopicPartitionSplit(topic.clone(), partition))
};

debug!(
restate.subscription.id = %self.sender.subscription.id(),
messaging.consumer.group.name = consumer_group_id,
"Starting topic '{topic}' partition '{partition}' consumption loop from offset '{offset}'"
);

let task = topic_partition_queue_consumption_loop(
self.sender.clone(),
topic.clone(), partition,
Expand Down
Loading