Resolve missing internal state update in EventSourcedRememberEntities… (#30217)

This commit is contained in:
Jens Neumaier 2021-05-04 14:59:24 +02:00 committed by GitHub
parent 43d97e90c0
commit 73d74dfc69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -101,7 +101,7 @@ private[akka] final class EventSourcedRememberEntitiesShardStore(
left -= 1
if (left == 0) {
sender() ! RememberEntitiesShardStore.UpdateDone(started, stopped)
state.copy(state.entities.union(started).diff(stopped))
state = state.copy(state.entities.union(started).diff(stopped))
saveSnapshotWhenNeeded()
}
}

View file

@ -4,6 +4,8 @@
package akka.cluster.sharding.internal
import java.util.UUID
import akka.actor.Props
import akka.cluster.ddata.{ Replicator, ReplicatorSettings }
import akka.cluster.sharding.ClusterShardingSettings
@ -17,17 +19,23 @@ import org.scalatest.wordspec.AnyWordSpecLike
* Covers the interaction between the shard and the remember entities store
*/
object RememberEntitiesShardStoreSpec {
def config = ConfigFactory.parseString("""
def config =
ConfigFactory.parseString(s"""
akka.loglevel=DEBUG
akka.loggers = ["akka.testkit.SilenceAllTestEventListener"]
akka.actor.provider = cluster
akka.remote.artery.canonical.port = 0
akka.remote.classic.netty.tcp.port = 0
akka.cluster.sharding.state-store-mode = ddata
akka.cluster.sharding.snapshot-after = 2
akka.cluster.sharding.remember-entities = on
# no leaks between test runs thank you
akka.cluster.sharding.distributed-data.durable.keys = []
akka.persistence.journal.plugin = "akka.persistence.journal.inmem"
akka.persistence.snapshot-store.plugin = "akka.persistence.snapshot-store.local"
akka.persistence.snapshot-store.local.dir = "target/${classOf[RememberEntitiesShardStoreSpec].getName}-${UUID
.randomUUID()
.toString}"
""".stripMargin)
}