for(Long l : sessionsRestarted) {
assertTrue("Should have same set of sessions in both servers, did not expect: " + l, sessionsNotRestarted.contains(l));
}
assertEquals("Should have same number of sessions", sessionsNotRestarted.size(), sessionsRestarted.size());
ZKDatabase restarted = qu.getPeer(index).peer.getActiveServer().getZKDatabase();
ZKDatabase clean = qu.getPeer(3).peer.getActiveServer().getZKDatabase();
ZKDatabase lead = qu.getPeer(leaderIndex).peer.getActiveServer().getZKDatabase();
for(Long l : sessionsRestarted) {
assertTrue("Should have same set of sessions in both servers, did not expect: " + l, sessionsNotRestarted.contains(l));
HashSet ephemerals = restarted.getEphemerals(l);
HashSet cleanEphemerals = clean.getEphemerals(l);
for(Object o : cleanEphemerals) {
if(!ephemerals.contains(o)) {
LOG.info("Restarted follower doesn't contain ephemeral " + o);
}
}
HashSet leadEphemerals = lead.getEphemerals(l);
for(Object o : leadEphemerals) {
if(!cleanEphemerals.contains(o)) {
LOG.info("Follower doesn't contain ephemeral from leader " + o);
}
}
assertEquals("Should have same number of ephemerals in both followers", ephemerals.size(), cleanEphemerals.size());
assertEquals("Leader should equal follower", lead.getEphemerals(l).size(), cleanEphemerals.size());
}
}