204205206207208209210211212213214
op.setTransactionId(txid++); out.write(op); } out.setReadyToFlush(); out.flush(); out.abort(); out.close(); long numTrans = bkjm.getNumberOfTransactions(1, true); assertEquals((txid-1), numTrans); }
341342343344345346347348349350351
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));
209210211212213214215216217218219
355356357358359360361362363364365
267268269270271272273274275276277
EditLogOutputStream stm = qjm.startLogSegment(4, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION); try { waitForAllPendingCalls(qjm.getLoggerSetForTests()); } finally { stm.abort(); } // Make a new QJM qjm = closeLater(new QuorumJournalManager(
324325326327328329330331332333334
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);
479480481482483484485486487488489
// 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)
244245246247248249250251252253254
EditLogOutputStream stm = qjm.startLogSegment(4); try { waitForAllPendingCalls(qjm.getLoggerSetForTests()); } finally { stm.abort(); } // Make a new QJM qjm = new QuorumJournalManager(
300301302303304305306307308309310
453454455456457458459460461462463