=per #18497 Handle large deleteMessages ranges in leveldb journal

* creating a large scala range is very inefficient and also impossible
  above Int.MaxValue, which can happen if deleteMessages(Long.MaxValue)
  is used
* solved by capping the upper seq nr by the highest know seq nr
* similar issue in inmem journal
This commit is contained in:
Patrik Nordwall 2015-09-17 08:32:26 +02:00
parent 6a4291e83e
commit d2cc69e65a
3 changed files with 26 additions and 3 deletions

View file

@ -1053,6 +1053,18 @@ abstract class PersistentActorSpec(config: Config) extends PersistenceSpec(confi
expectMsg(List("b-1", "b-2"))
}
"be able to delete all events" in {
val persistentActor = namedPersistentActor[Behavior1PersistentActor]
persistentActor ! Cmd("b")
persistentActor ! GetState
expectMsg(List("a-1", "a-2", "b-1", "b-2"))
persistentActor ! Delete(Long.MaxValue)
persistentActor ! "boom" // restart, recover
expectMsgType[DeleteMessagesSuccess]
persistentActor ! GetState
expectMsg(Nil)
}
}
}