Skip to content

Commit

Permalink
HDDS-11623. Improve OM Ratis Configuration change log message (apache…
Browse files Browse the repository at this point in the history
…#7388)

(cherry picked from commit c045839)
  • Loading branch information
harryteng9527 authored Nov 6, 2024
1 parent b1f0498 commit 00d2248
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,15 @@ public void notifyConfigurationChanged(long term, long index,
RaftProtos.RaftConfigurationProto newRaftConfiguration) {
List<RaftProtos.RaftPeerProto> 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<String> newPeerIds = new ArrayList<>();
for (RaftProtos.RaftPeerProto raftPeerProto : newPeers) {
Expand Down

0 comments on commit 00d2248

Please sign in to comment.