sbtourist/Journal.IO — Issue #11: java.io.IOException: Bad checksum for location on Journal.recoveryCheck
Author: chrismongillo
Created: 2012-02-17 11:16:20+00:00
State: open

Hi Sergio,
during our first tests with your amazing Journal.IO we face this exception on journal reopening. After some analysis it seems the problem is not related with compact operation as we thought, but it occurs always at reopening after a previous delete. That's a simple test I did on the 1.1-snapshot

```

@Test
public void test_bad_checksum_issue_after_delete() throws IOException {
Journal journal = new Journal();
String basePath = this.getClass().getClassLoader().getResource(".").getFile();
journal.setDirectory(new File(basePath));
journal.setFilePrefix(UUID.randomUUID().toString());
journal.open();
journal.write(String.valueOf("bad checksum issue").getBytes(Charset.forName("UTF-8")), true);
Iterator locationsIterator = journal.redo().iterator();
while (locationsIterator.hasNext()) {
Location location = locationsIterator.next();
journal.delete(location);
}
journal.compact();
journal.close();
journal.open();

}

```