Program: 132306
Project: 132306
Buggy source:
@Test public void testReplayAfterCrash() throws Exception {
  database=BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir,baseDir,1,0,0,SyncMode.SYNC_WRITE,0,0,compression,maxNumRecs,maxBlockFileSize));
  Database db=database.getDatabaseManager().createDatabase("String_Node_Str",2);
  db.singleInsert(0,"String_Node_Str".getBytes(),"String_Node_Str".getBytes(),null).get();
  database.getCheckpointer().checkpoint();
  byte[] result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  String value=new String(result);
  assertEquals(value,"String_Node_Str");
  db.singleInsert(0,"String_Node_Str".getBytes(),"String_Node_Str".getBytes(),null).get();
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  db.singleInsert(0,"String_Node_Str".getBytes(),"String_Node_Str".getBytes(),null).get();
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  ((BabuDBImpl)database).__test_killDB_dangerous();
  Thread.sleep(500);
  database=BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir,baseDir,2,0,0,SyncMode.SYNC_WRITE,0,0,compression,maxNumRecs,maxBlockFileSize));
  db=database.getDatabaseManager().getDatabase("String_Node_Str");
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  assertNotNull(result);
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  assertNotNull(result);
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  assertNotNull(result);
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  System.out.println("String_Node_Str");
  database.shutdown();
}

Fixed version (ground truth):
@Test public void testReplayAfterCrash() throws Exception {
  database=BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir,baseDir,1,0,0,SyncMode.SYNC_WRITE,0,0,compression,maxNumRecs,maxBlockFileSize,true,0,Logging.LEVEL_DEBUG));
  Database db=database.getDatabaseManager().createDatabase("String_Node_Str",2);
  db.singleInsert(0,"String_Node_Str".getBytes(),"String_Node_Str".getBytes(),null).get();
  database.getCheckpointer().checkpoint();
  byte[] result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  String value=new String(result);
  assertEquals(value,"String_Node_Str");
  db.singleInsert(0,"String_Node_Str".getBytes(),"String_Node_Str".getBytes(),null).get();
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  db.singleInsert(0,"String_Node_Str".getBytes(),"String_Node_Str".getBytes(),null).get();
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  ((BabuDBImpl)database).__test_killDB_dangerous();
  Thread.sleep(500);
  database=BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir,baseDir,2,0,0,SyncMode.SYNC_WRITE,0,0,compression,maxNumRecs,maxBlockFileSize));
  db=database.getDatabaseManager().getDatabase("String_Node_Str");
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  assertNotNull(result);
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  assertNotNull(result);
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  result=db.lookup(0,"String_Node_Str".getBytes(),null).get();
  assertNotNull(result);
  value=new String(result);
  assertEquals(value,"String_Node_Str");
  System.out.println("String_Node_Str");
  database.shutdown();
}