You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "jsancio (via GitHub)" <gi...@apache.org> on 2023/04/18 17:20:36 UTC

[GitHub] [kafka] jsancio commented on a diff in pull request #13540: MINOR: improve QuorumController logging

jsancio commented on code in PR #13540:
URL: https://github.com/apache/kafka/pull/13540#discussion_r1170345743


##########
metadata/src/main/java/org/apache/kafka/controller/ControllerPurgatory.java:
##########
@@ -65,6 +81,7 @@ void failAll(Exception exception) {
         while (iter.hasNext()) {
             Entry<Long, List<DeferredEvent>> entry = iter.next();
             for (DeferredEvent event : entry.getValue()) {
+                log.info("failAll({}): failing {}.", exception.getClass().getSimpleName(), event);

Review Comment:
   I see. We don't log the stacktrace because `failAll` is only called with `NotControllerException`. Should we change the signature of this method to `void failAll(ApiException)`?



##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -977,16 +969,8 @@ public void handleSnapshot(SnapshotReader<ApiMessageAndVersion> reader) {
                         long offset = batch.lastOffset();
                         List<ApiMessageAndVersion> messages = batch.records();
 
-                        if (log.isDebugEnabled()) {
-                            if (log.isTraceEnabled()) {
-                                log.trace("Replaying snapshot ({}) batch with last offset of {}: {}",
-                                    reader.snapshotId(), offset, messages.stream().map(ApiMessageAndVersion::toString).
-                                        collect(Collectors.joining(", ")));
-                            } else {
-                                log.debug("Replaying snapshot ({}) batch with last offset of {}",
-                                    reader.snapshotId(), offset);
-                            }
-                        }
+                        log.debug("Replaying snapshot {} batch with last offset of {}",
+                            reader.snapshotId(), offset);

Review Comment:
   Do you want to use `snapshotName` here to make it consistent with the rest of the log messages?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org