dain / leveldb

Port of LevelDB to Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Background-Compaction fails

pulsar256 opened this issue · comments

Test-Scenario:

        Options options = new Options();
        options.maxOpenFiles(100);
        options.createIfMissing(true);
        File f = new File("/tmp/leveldb");
        org.iq80.leveldb.util.FileUtils.deleteRecursively(f);
        db = new DbImpl(options, f);
        int i=0;
        while(true)
        {
            db.put(RandomStringUtils.random(64).getBytes(), new byte[]{0x01}, new WriteOptions().sync(false));
            db.get(RandomStringUtils.random(64).getBytes());
            if (++i%1000==0) log.info(i+" rows written");
        }

output:

11/12/06 19:27:59 INFO impl.Foo: 43000 rows written
11/12/06 19:27:59 INFO impl.Foo: 44000 rows written
java.lang.NullPointerException
    at org.iq80.leveldb.impl.Compaction.totalFileSize(Compaction.java:127)
    at org.iq80.leveldb.impl.Compaction.isTrivialMove(Compaction.java:118)
    at org.iq80.leveldb.impl.DbImpl.backgroundCompaction(DbImpl.java:434)
    at org.iq80.leveldb.impl.DbImpl.backgroundCall(DbImpl.java:395)
    at org.iq80.leveldb.impl.DbImpl.access$100(DbImpl.java:79)
    at org.iq80.leveldb.impl.DbImpl$2.call(DbImpl.java:370)
    at org.iq80.leveldb.impl.DbImpl$2.call(DbImpl.java:364)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
    at org.iq80.leveldb.impl.Compaction.totalFileSize(Compaction.java:127)
    at org.iq80.leveldb.impl.Compaction.isTrivialMove(Compaction.java:118)
    at org.iq80.leveldb.impl.DbImpl.backgroundCompaction(DbImpl.java:434)
    at org.iq80.leveldb.impl.DbImpl.backgroundCall(DbImpl.java:395)
    at org.iq80.leveldb.impl.DbImpl.access$100(DbImpl.java:79)
    at org.iq80.leveldb.impl.DbImpl$2.call(DbImpl.java:370)
    at org.iq80.leveldb.impl.DbImpl$2.call(DbImpl.java:364)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
and so on...
and so on...
and some time later OOE

hope that helps, thanks!
Paul.

P.S. trying to fix that Nullpointer (grandchildren == null return 0 in totalFileSize or false in isTrivialMove()) caused IndexArrayOutOfBounds exceptions.

Hi Pulsar I think this is fixed now. Could you double check? Thanks!