use of org.corfudb.protocols.wireprotocol.LayoutMsg in project CorfuDB by CorfuDB.
the class LayoutServerTest method commitReturnsAck.
private void commitReturnsAck(LayoutServer s1, Integer reboot, long baseEpoch) {
long newEpoch = baseEpoch + reboot;
sendMessage(new CorfuPayloadMsg<>(CorfuMsgType.SET_EPOCH, newEpoch));
Layout layout = TestLayoutBuilder.single(SERVERS.PORT_0);
layout.setEpoch(newEpoch);
sendPrepare(newEpoch, HIGH_RANK);
Assertions.assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.LAYOUT_PREPARE_ACK);
sendPropose(newEpoch, HIGH_RANK, layout);
Assertions.assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.ACK);
sendCommitted(newEpoch, layout);
Assertions.assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.ACK);
sendCommitted(newEpoch, layout);
Assertions.assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.ACK);
requestLayout(newEpoch);
Assertions.assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.LAYOUT_RESPONSE);
Assertions.assertThat(((LayoutMsg) getLastMessage()).getLayout()).isEqualTo(layout);
}
use of org.corfudb.protocols.wireprotocol.LayoutMsg in project CorfuDB by CorfuDB.
the class LayoutServerTest method bootstrapServerInstallsNewLayout.
/**
* Verifies that a server responds with a layout that the server was bootstrapped with.
* There are no layout changes between bootstrap and layout request.
*/
@Test
public void bootstrapServerInstallsNewLayout() {
Layout layout = TestLayoutBuilder.single(SERVERS.PORT_0);
bootstrapServer(layout);
requestLayout(layout.getEpoch());
Assertions.assertThat(getLastMessage().getMsgType()).isEqualTo(CorfuMsgType.LAYOUT_RESPONSE);
Assertions.assertThat(((LayoutMsg) getLastMessage()).getLayout()).isEqualTo(layout);
}