// Find zxid for the second log
long secondStartZxid = Util.getZxidFromName(logFiles[1].getName(), "log");
FileTxnLog txnLog = new FileTxnLog(logDir);
TxnIterator itr = txnLog.read(1, false);
// Oldest log is already remove, so this should point to the start of
// of zxid on the second log
Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid());
itr = txnLog.read(secondStartZxid, false);
Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid());
Assert.assertTrue(itr.next());
// Trying to get a second txn on second txnlog give us the
// the start of second log, since the first one is removed
long nextZxid = itr.getHeader().getZxid();
itr = txnLog.read(nextZxid, false);
Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid());
// Trying to get a first txn on the third give us the
// the start of second log, since the first one is removed
long thirdStartZxid = Util.getZxidFromName(logFiles[2].getName(), "log");
itr = txnLog.read(thirdStartZxid, false);
Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid());
Assert.assertTrue(itr.next());
nextZxid = itr.getHeader().getZxid();
itr = txnLog.read(nextZxid, false);
Assert.assertEquals(secondStartZxid, itr.getHeader().getZxid());
}