@BreakpointHandler("removeProperty") public static void handleRemoveProperty( @BreakpointHandler("commitPropertyMaps") BreakPoint exitCommit, DebugInterface di) { if (readerThread == null) { removerThread = di.thread().suspend(null); } exitCommit.enable(); }
@Test public void rotateLogAtTheSameTimeInitializeIndexWriters() throws Exception { run(new CreateInitialStateTask()); restart(); commitIndexWriter.enable(); run(new LoadIndexesTask(2, false)); RotateIndexLogTask rotateTask = new RotateIndexLogTask(); runInThread(rotateTask); barrier1.await(); run(new LoadIndexesTask(3, true)); resumeFlushThread(); barrier2.await(); run(new Verifier()); }
/* * 1) Do a 2PC transaction, crash when both resource have been prepared and txlog * says "mark as committing" for that tx. * 2) Do recovery and then crash again. * 3) Do recovery and see so that all data is in there. * Also do an incremental backup just to make sure that the logs have gotten the * right records injected. */ @Test public void crashAfter2PCMarkAsCommittingThenCrashAgainAndRecover() throws Exception { String backupDirectory = "target/var/backup-db"; FileUtils.deleteRecursively(new File(backupDirectory)); OnlineBackup.from(InetAddress.getLocalHost().getHostAddress()).full(backupDirectory); for (BreakPoint bp : breakpoints(0)) bp.enable(); runInThread(new WriteTransaction()); afterWrite.await(); startSubprocesses(); runInThread(new Crash()); afterCrash.await(); startSubprocesses(); OnlineBackup.from(InetAddress.getLocalHost().getHostAddress()).incremental(backupDirectory); run(new Verification()); GraphDatabaseAPI db = (GraphDatabaseAPI) new GraphDatabaseFactory().newEmbeddedDatabase(backupDirectory); try { new Verification().run(db); } finally { db.shutdown(); } }
@Override protected BreakPoint[] breakpoints(int id) { return new BreakPoint[] {commitIndexWriter, resumeFlushThread.enable(), done.enable()}; }
@Override protected BreakPoint[] breakpoints(int id) { return new BreakPoint[] { doCommit, enableBreakPoint.enable(), resumeThread.enable(), done.enable() }; }
@Override protected void callback(DebugInterface debug) throws KillSubProcess { doCommit.enable(); }