Skip to content

Commit

Permalink
metadata: add two small logs
Browse files Browse the repository at this point in the history
This adds two logs on things that are problems. Other flows through this
function hit logs, but this was missing.
  • Loading branch information
twmb committed Aug 4, 2021
1 parent 4fadcde commit 278488b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/kgo/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,12 @@ func (cl *Client) mergeTopicPartitions(
if oldTP.loadErr == nil {
r.writablePartitions = append(r.writablePartitions, oldTP)
}

cl.cfg.logger.Log(LogLevelDebug, "metadata update is missing partition in topic, keeping old data",
"topic", topic,
"partition", part,
)

continue
}
newTP := r.partitions[part]
Expand All @@ -552,6 +558,14 @@ func (cl *Client) mergeTopicPartitions(
// information.
if newTP.leaderEpoch < oldTP.leaderEpoch {
*newTP = *oldTP

cl.cfg.logger.Log(LogLevelDebug, "metadata leader epoch went backwards, ignoring update",
"topic", topic,
"partition", part,
"old_epoch", oldTP.leaderEpoch,
"new_epoch", newTP.leaderEpoch,
)

continue
}

Expand Down

0 comments on commit 278488b

Please sign in to comment.