AndrewJSchofield commented on code in PR #22257:
URL: https://github.com/apache/kafka/pull/22257#discussion_r3247123663
##########
share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorShard.java:
##########
@@ -777,7 +777,8 @@ private
Optional<CoordinatorResult<WriteShareGroupStateResponseData, Coordinator
Optional<CoordinatorMetadataImage.TopicMetadata> topicMetadataOp =
metadataImage.topicMetadata(topicId);
if (topicMetadataOp.isEmpty() ||
topicMetadataOp.get().partitionCount() <= partitionId) {
- log.error("Topic/TopicPartition not found in metadata image.");
+ log.error("Topic or partition not found in metadata image when
writing: {}:{}-{}.", topicId,
+
topicMetadataOp.map(CoordinatorMetadataImage.TopicMetadata::name).orElse("null"),
partitionId);
Review Comment:
I've taken a look at this and I don't think it helps. If I just make the
`log.error` line a private method, it probably harms the readability because
it's a trivial method and I can't see what it does without going to the method.
If I instead take the entire if block, that is also tricky because the
construction of the error response is operation-dependent.
So I prefer to leave as is in this case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]