From 3c6876ece61880dbe1a5ea0f50f43e13b803dded Mon Sep 17 00:00:00 2001 From: andytaylor Date: Fri, 9 Mar 2018 10:19:34 +0000 Subject: [PATCH] ARTEMIS-1741 - log warning if a node isnt configured for quorum voting https://issues.apache.org/jira/browse/ARTEMIS-1741 --- .../activemq/artemis/core/server/ActiveMQServerLogger.java | 5 +++++ .../artemis/core/server/cluster/ClusterController.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java index ce04f149d8..4d25c58a24 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java @@ -1918,4 +1918,9 @@ public interface ActiveMQServerLogger extends BasicLogger { @LogMessage(level = Logger.Level.WARN) @Message(id = 224089, value = "Failed to calculate persistent size", format = Message.Format.MESSAGE_FORMAT) void errorCalculatePersistentSize(@Cause Throwable e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 224090, value = "This node is not configured for Quorum Voting, all nodes must be configured for HA", format = Message.Format.MESSAGE_FORMAT) + void noVoteHandlerConfigured(); + } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java index 464e945675..c77b297019 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterController.java @@ -378,6 +378,10 @@ public class ClusterController implements ActiveMQComponent { } else if (packet.getType() == PacketImpl.QUORUM_VOTE) { QuorumVoteMessage quorumVoteMessage = (QuorumVoteMessage) packet; QuorumVoteHandler voteHandler = quorumManager.getVoteHandler(quorumVoteMessage.getHandler()); + if (voteHandler == null) { + ActiveMQServerLogger.LOGGER.noVoteHandlerConfigured(); + return; + } quorumVoteMessage.decode(voteHandler); ActiveMQServerLogger.LOGGER.receivedQuorumVoteRequest(quorumVoteMessage.getVote().toString()); Vote vote = quorumManager.vote(quorumVoteMessage.getHandler(), quorumVoteMessage.getVote());