From 00d224895d0b75f36a094cf22801072c77105665 Mon Sep 17 00:00:00 2001 From: Zhi-Mao Teng Date: Wed, 6 Nov 2024 17:36:22 +0800 Subject: [PATCH] HDDS-11623. Improve OM Ratis Configuration change log message (#7388) (cherry picked from commit c0458398a8f1ae73e08f12a844125be7439b79db) --- .../ozone/om/ratis/OzoneManagerStateMachine.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java index aa7211fa036a..6a5274ca01f5 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java @@ -215,8 +215,15 @@ public void notifyConfigurationChanged(long term, long index, RaftProtos.RaftConfigurationProto newRaftConfiguration) { List newPeers = newRaftConfiguration.getPeersList(); - LOG.info("Received Configuration change notification from Ratis. New Peer" + - " list:\n{}", newPeers); + final StringBuilder logBuilder = new StringBuilder(1024) + .append("notifyConfigurationChanged from Ratis: term=").append(term) + .append(", index=").append(index) + .append(", New Peer list: "); + newPeers.forEach(peer -> logBuilder.append(peer.getId().toStringUtf8()) + .append("(") + .append(peer.getAddress()) + .append("), ")); + LOG.info(logBuilder.substring(0, logBuilder.length() - 2)); List newPeerIds = new ArrayList<>(); for (RaftProtos.RaftPeerProto raftPeerProto : newPeers) {