From 229a8438a2e22d950c45fde299293fc17027d7cd Mon Sep 17 00:00:00 2001 From: svenkataramanasam Date: Sun, 26 Jan 2025 22:05:39 -0500 Subject: [PATCH] When one of the Ozone OM falls back and bootstraps, the logs are printed very frequently and it rolls off 30 log files (of 200MB each) in 15 mins. Since logs are rolled off too quick, troubleshooting cause of bootstrap is becoming difficult. --- .../org/apache/ratis/grpc/server/GrpcLogAppender.java | 2 +- .../ratis/grpc/server/GrpcServerProtocolService.java | 4 ++-- .../ratis/server/impl/SnapshotInstallationHandler.java | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java index 1544975a45..424784f5ad 100644 --- a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java +++ b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java @@ -534,7 +534,7 @@ private void onNextImpl(AppendEntriesRequest request, AppendEntriesReplyProto re break; case INCONSISTENCY: grpcServerMetrics.onRequestInconsistency(getFollowerId().toString()); - LOG.warn("{}: received {} reply with nextIndex {}, errorCount={}, request={}", + LOG.debug("{}: received {} reply with nextIndex {}, errorCount={}, request={}", this, reply.getResult(), reply.getNextIndex(), errorCount, request); final long requestFirstIndex = request != null? request.getFirstIndex(): RaftLog.INVALID_LOG_INDEX; updateNextIndex(getNextIndexForInconsistency(requestFirstIndex, reply.getNextIndex())); diff --git a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcServerProtocolService.java b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcServerProtocolService.java index 451d74c64a..985e64f23d 100644 --- a/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcServerProtocolService.java +++ b/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcServerProtocolService.java @@ -197,9 +197,9 @@ public void onNext(REQUEST request) { @Override public void onCompleted() { if (isClosed.compareAndSet(false, true)) { - LOG.info("{}: Completed {}, lastRequest: {}", getId(), op, getPreviousRequestString()); + LOG.debug("{}: Completed {}, lastRequest: {}", getId(), op, getPreviousRequestString()); requestFuture.get().thenAccept(reply -> { - LOG.info("{}: Completed {}, lastReply: {}", getId(), op, reply); + LOG.debug("{}: Completed {}, lastReply: {}", getId(), op, reply); responseObserver.onCompleted(); }); releaseLast(); diff --git a/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java b/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java index 70027e6dda..ee11fa0f3a 100644 --- a/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java +++ b/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java @@ -93,8 +93,8 @@ long getInProgressInstallSnapshotIndex() { } InstallSnapshotReplyProto installSnapshot(InstallSnapshotRequestProto request) throws IOException { - if (LOG.isInfoEnabled()) { - LOG.info("{}: receive installSnapshot: {}", getMemberId(), + if (LOG.isDebugEnabled()) { + LOG.debug("{}: receive installSnapshot: {}", getMemberId(), ServerStringUtils.toInstallSnapshotRequestString(request)); } final InstallSnapshotReplyProto reply; @@ -104,8 +104,8 @@ InstallSnapshotReplyProto installSnapshot(InstallSnapshotRequestProto request) t LOG.error("{}: installSnapshot failed", getMemberId(), e); throw e; } - if (LOG.isInfoEnabled()) { - LOG.info("{}: reply installSnapshot: {}", getMemberId(), + if (LOG.isDebugEnabled()) { + LOG.debug("{}: reply installSnapshot: {}", getMemberId(), ServerStringUtils.toInstallSnapshotReplyString(reply)); } return reply;