This commit is contained in:
Clebert Suconic 2020-12-21 11:03:11 -05:00
commit 6d10724d05
2 changed files with 21 additions and 1 deletions

View File

@ -40,6 +40,7 @@ public class PagedMessageImpl implements PagedMessage {
private static final byte NONE = 0; private static final byte NONE = 0;
private static final byte CORE = 1; private static final byte CORE = 1;
private static final byte OLD_CORE = -1;
private static final byte NOT_CORE = 2; private static final byte NOT_CORE = 2;
public static boolean isLargeMessage(byte encodedValue) { public static boolean isLargeMessage(byte encodedValue) {
@ -47,6 +48,7 @@ public class PagedMessageImpl implements PagedMessage {
case LargeMessageType.NONE: case LargeMessageType.NONE:
return false; return false;
case LargeMessageType.CORE: case LargeMessageType.CORE:
case LargeMessageType.OLD_CORE:
case LargeMessageType.NOT_CORE: case LargeMessageType.NOT_CORE:
return true; return true;
default: default:
@ -59,7 +61,8 @@ public class PagedMessageImpl implements PagedMessage {
} }
public static boolean isCoreLargeMessageType(byte encodedValue) { public static boolean isCoreLargeMessageType(byte encodedValue) {
return encodedValue == LargeMessageType.CORE; return encodedValue == LargeMessageType.CORE ||
encodedValue == LargeMessageType.OLD_CORE;
} }
public static byte valueOf(Message message) { public static byte valueOf(Message message) {

View File

@ -110,6 +110,23 @@ public class JournalCompatibilityTest extends VersionedBase {
evaluate(receiverClassloader, "meshTest/sendMessages.groovy", server, receiver, "receiveMessages"); evaluate(receiverClassloader, "meshTest/sendMessages.groovy", server, receiver, "receiveMessages");
} }
@Test
public void testSendReceivePaging() throws Throwable {
setVariable(senderClassloader, "persistent", true);
startServer(serverFolder.getRoot(), senderClassloader, "journalTest", null, true);
evaluate(senderClassloader, "journalcompatibility/forcepaging.groovy");
evaluate(senderClassloader, "meshTest/sendMessages.groovy", server, sender, "sendAckMessages");
evaluate(senderClassloader, "journalcompatibility/ispaging.groovy");
stopServer(senderClassloader);
setVariable(receiverClassloader, "persistent", true);
startServer(serverFolder.getRoot(), receiverClassloader, "journalTest", null, false);
evaluate(receiverClassloader, "journalcompatibility/ispaging.groovy");
setVariable(receiverClassloader, "latch", null);
evaluate(receiverClassloader, "meshTest/sendMessages.groovy", server, receiver, "receiveMessages");
}
/** /**
* Test that the server starts properly using an old journal even though persistent size * Test that the server starts properly using an old journal even though persistent size
* metrics were not originaly stored * metrics were not originaly stored