175176177178179180181182183184185
op.setTransactionId(txid++); out.write(op); } out.setReadyToFlush(); out.flush(); out.abort(); out.close(); long numTrans = bkjm.getNumberOfTransactions(1, true); assertEquals((txid-1), numTrans); }
296297298299300301302303304305306
out.write(op); } out.setReadyToFlush(); out.flush(); out.abort(); out.close(); assertNull(zkc.exists(bkjm.finalizedLedgerZNode(1, 100), false)); assertNotNull(zkc.exists(bkjm.inprogressZNode(1), false));
261262263264265266267268269270271
EditLogOutputStream stm = qjm.startLogSegment(4); try { waitForAllPendingCalls(qjm.getLoggerSetForTests()); } finally { stm.abort(); } // Make a new QJM qjm = closeLater(new QuorumJournalManager(
317318319320321322323324325326327
fail("Did not fail even though 2/3 failed"); } catch (QuorumException qe) { GenericTestUtils.assertExceptionContains("mock failure", qe); } } finally { stm.abort(); } // Bring back the down JN. cluster.restartJournalNode(nodeMissingSegment);
470471472473474475476477478479480
// Should fail, because logger 1 had an injected fault and // logger 0 should detect writer out of sync GenericTestUtils.assertExceptionContains("Writer out of sync", qe); } finally { stm.abort(); qjm.close(); } // State: // Logger 0: 1-3 in-progress (since it missed finalize)
257258259260261262263264265266267
378379380381382383384385386387388
out.write(op); } out.setReadyToFlush(); out.flush(); out.abort(); out.close(); assertNull(zkc.exists(bkjm.finalizedLedgerZNode(1, 100), false)); assertNotNull(zkc.exists(bkjm.inprogressZNode(), false));