diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/FinalCheckPassedMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/FinalCheckPassedMessage.java index 3f3b27871059..b64917d4b4fe 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/FinalCheckPassedMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/FinalCheckPassedMessage.java @@ -28,6 +28,8 @@ public class FinalCheckPassedMessage extends HighPriorityDistributionMessage { private InternalDistributedMember suspect; + public FinalCheckPassedMessage() {} + public FinalCheckPassedMessage(InternalDistributedMember recipient, InternalDistributedMember suspect) { super(); diff --git a/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java b/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java index 31887efb053b..d60a9135b19d 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java +++ b/geode-core/src/main/java/org/apache/geode/internal/DSFIDFactory.java @@ -96,6 +96,7 @@ import org.apache.geode.distributed.internal.membership.gms.locator.FindCoordinatorResponse; import org.apache.geode.distributed.internal.membership.gms.locator.GetViewRequest; import org.apache.geode.distributed.internal.membership.gms.locator.GetViewResponse; +import org.apache.geode.distributed.internal.membership.gms.messages.FinalCheckPassedMessage; import org.apache.geode.distributed.internal.membership.gms.messages.HeartbeatMessage; import org.apache.geode.distributed.internal.membership.gms.messages.HeartbeatRequestMessage; import org.apache.geode.distributed.internal.membership.gms.messages.InstallViewMessage; @@ -475,6 +476,7 @@ public static void registerTypes() { } private static void registerDSFIDTypes() { + registerDSFID(FINAL_CHECK_PASSED_MESSAGE, FinalCheckPassedMessage.class); registerDSFID(NETWORK_PARTITION_MESSAGE, NetworkPartitionMessage.class); registerDSFID(REMOVE_MEMBER_REQUEST, RemoveMemberMessage.class); registerDSFID(HEARTBEAT_REQUEST, HeartbeatRequestMessage.class); diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java index 2d0d0cd92c30..e7109ca8bafa 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java @@ -14,6 +14,7 @@ */ package org.apache.geode.distributed.internal.membership.gms.fd; +import org.apache.geode.DataSerializer; import org.apache.geode.distributed.internal.*; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.NetView; @@ -30,6 +31,7 @@ import org.apache.geode.distributed.internal.membership.gms.messages.HeartbeatRequestMessage; import org.apache.geode.distributed.internal.membership.gms.messages.SuspectMembersMessage; import org.apache.geode.distributed.internal.membership.gms.messages.SuspectRequest; +import org.apache.geode.internal.HeapDataOutputStream; import org.apache.geode.internal.net.SocketCreator; import org.apache.geode.internal.Version; import org.apache.geode.internal.net.SocketCreatorFactory; @@ -529,6 +531,21 @@ public void testExonerationMessageIsSentAfterSuccessfulFinalCheck() { } } + @Test + public void testFinalCheckPassedMessageCanBeSerializedAndDeserialized() + throws IOException, ClassNotFoundException { + HeapDataOutputStream heapDataOutputStream = new HeapDataOutputStream(500, Version.CURRENT); + FinalCheckPassedMessage message = + new FinalCheckPassedMessage(mockMembers.get(0), mockMembers.get(1)); + DataSerializer.writeObject(message, heapDataOutputStream); + ByteArrayInputStream byteArrayInputStream = + new ByteArrayInputStream(heapDataOutputStream.toByteArray()); + DataInputStream dataInputStream = new DataInputStream(byteArrayInputStream); + message = DataSerializer.readObject(dataInputStream); + assertEquals(mockMembers.get(1), message.getSuspect()); + } + + @Test public void testInitiatorRewatchesSuspectAfterSuccessfulFinalCheck() {