public void assertServer(MiniRaftCluster cluster, ClientId clientId, long callId, long oldLastApplied) throws Exception { long leaderApplied = cluster.getLeader().getState().getLastAppliedIndex(); // make sure retry cache has the entry for (RaftServerImpl server : cluster.iterateServerImpls()) { LOG.info("check server " + server.getId()); if (server.getState().getLastAppliedIndex() < leaderApplied) { Thread.sleep(1000); } Assert.assertEquals(2, RaftServerTestUtil.getRetryCacheSize(server)); Assert.assertNotNull(RaftServerTestUtil.getRetryEntry(server, clientId, callId)); // make sure there is only one log entry committed Assert.assertEquals(1, count(server.getState().getLog(), oldLastApplied + 1)); } }
Objects.requireNonNull(reply.getStateMachineException()); RetryCache.CacheEntry oldEntry = RaftServerTestUtil.getRetryEntry( cluster.getLeader(), client.getId(), callId); Assert.assertNotNull(oldEntry); Objects.requireNonNull(reply.getStateMachineException()); RetryCache.CacheEntry currentEntry = RaftServerTestUtil.getRetryEntry( cluster.getLeader(), client.getId(), callId); Assert.assertNotNull(currentEntry);
Objects.requireNonNull(reply.getStateMachineException()); RetryCache.CacheEntry oldEntry = RaftServerTestUtil.getRetryEntry( leader, client.getId(), callId); Assert.assertNotNull(oldEntry); Objects.requireNonNull(reply.getStateMachineException()); RetryCache.CacheEntry currentEntry = RaftServerTestUtil.getRetryEntry( leader, client.getId(), callId); Assert.assertNotNull(currentEntry);
RaftServerTestUtil.getRetryEntry(server, client.getId(), callId)); Assert.assertEquals(oldLastApplied + 1, server.getState().getLastAppliedIndex());
RaftServerTestUtil.getRetryEntry(server, client.getId(), callId));
RaftServerTestUtil.getRetryEntry(server, client.getId(), callId)); final RaftLog log = server.getState().getLog(); RaftTestUtil.logEntriesContains(log, oldLastApplied + 1, log.getNextIndex(), message);