property("record rewriting") {
withStore { store =>
val key = byteString("A")
val valA = byteString("1")
val valB = byteString("2")
store.insert(Seq(key -> valA))
store.get(key).toBs shouldBe Some(valA).toBs
store.insert(Seq(key -> valB))
store.get(key).toBs shouldBe Some(valB).toBs
store.getAll.size shouldBe 1
}
}
Store is a wrapper over RocksDb:
final class LDBKVStore(protected val db: RocksDB) extends KVStore {
type K = Array[Byte]
type V = Array[Byte]
def get(key: K): Option[V] =
Option(db.get(key))
def update(toInsert: Seq[(K, V)], toRemove: Seq[K]): Unit = {
val wo = new WriteOptions()
val batch = new WriteBatch()
try {
toInsert.foreach { case (k, v) => batch.put(k, v) }
toRemove.foreach(batch.delete)
db.write(wo, batch)
} finally {
batch.close()
}
}
def insert(values: Seq[(K, V)]): Unit = update(values, Seq.empty)
def remove(keys: Seq[K]): Unit = update(Seq.empty, keys)
}
Actual behavior
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000012b63ecf9, pid=55918, tid=9731
#
# JRE version: Java(TM) SE Runtime Environment (10.0.2+13) (build 10.0.2+13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (10.0.2+13, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# C [librocksdbjni10791814389570132172.jnilib+0x121cf9] rocksdb::MemTable::GetMinLogContainingPrepSection()+0x1259
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /path/to/my/project/hs_err_pid55918.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
RocksDB Java, Version 6.0.1
Expected behavior
The test looks like:
Store is a wrapper over RocksDb:
Actual behavior
Steps to reproduce the behavior