* Allow entities to stop by terminating in sharding without remember entities #29383
We missed an allowed transition from running/active to stopped/NoState in shard.
when the logic was rewritten.
* Add a toggle to opt-in crash shard on illegal state transitions
Default is logging an error and not crashing shard and all other entities, our tests have the toggle enabled.
* A fix for passivation when not using remember entities fixing #29359 and possibly #27549
* The only sender of StartEntityAck to shard is RememberEntitiesStarter
That is not really needed, because the shard already knows if it started an entity, so we can drop that logic
* Separate command for the case where ids has been relocated by a new shard id extractor algo
* Store that entities were moved on shard id extractor change and cover with test
* Do'h. Can't mark entity as being remembered before checking if there are any entities being remembered
* Comment explaining test
* Logging cleanup
* Cherry pick of Chbateys fix for watch/termination of entity
* When write is in progress or in batch queue message needs to go in buffer (If it doesn't it can re-order delivery)
* Refactor shard to have a state for each entity
Rather than inferred from various maps and sets.
Unfortunately, we still have the by actor ref and by id but have moved
them to a class so they are always updated together.
* Avoid allocation on the message path
* Change Entities API to all OptionVals rather than a mixture
* Add spec for Entities
* Avoid multiple conversions of collection for handoff
* DData and Persistence based remember entitites refactored
* Order methods in the order of init in the shard.
* Some bad isolation between test cases causing problems
* Test coverage for remember entities store failures
* WithLogCapturing where applicable
* MiMa filters
* Timeouts from config for persistent remember entities
* Single method for deliver, less utf-8 encoding
* Include detail on write failure
* Don't send message to dead letter if it is actually handled in BackOffSupervisor
* Back off supervisor log format plus use warning for hitting max restarts
* actor/message based spi
* Missing assert that node had joined cluster
* Shard state.entities and idByRef properties incosistency in case of HandOffStopper creation
* Additional sharding debugging logs
(cherry picked from commit 70c2b571b9759e0441529fe107b8e8bf42825415)
* previous `schedule` method is trying to maintain a fixed average frequency
over time, but that can result in undesired bursts of scheduled tasks after a long
GC or if the JVM process has been suspended, same with all other periodic
scheduled message sending via various Timer APIs
* most of the time "fixed delay" is more desirable
* we can't just change because it's too big behavioral change and some might
depend on previous behavior
* deprecate the old `schedule` and introduce new `scheduleWithFixedDelay`
and `scheduleAtFixedRate`, when fixing the deprecation warning users should
make a concious decision of which behavior to use (scheduleWithFixedDelay in
most cases)
* Streams
* SchedulerSpec
* test both fixed delay and fixed rate
* TimerSpec
* FSM and PersistentFSM
* mima
* runnable as second parameter list, also in typed.Scheduler
* IllegalStateException vs SchedulerException
* deprecated annotations
* api and reference docs, all places
* migration guide
* This problem was introduced in the optimization in PR #26878,
and that regression has not been released.
* While waiting for the ddata update response it buffers messages
for the entity that is stopped/started and in the case of passivation
those buffered messages were not delivered afterwards. Therefore
the test failed when waiting for the expected response.
* While waiting for update to comple it will now deliver messages to other
already started entities immediately, instead of stashing
* Unstash one message at a time, instead of unstashAll
* Append messageBuffer for messages to the entity that we are waiting for,
instead of stashing
* Test to confirm the improvements
* Fixing a few other missing things
* receiveStartEntity should process the change before starting the entity
* lastMessageTimestamp should be touched from overridden deliverTo
* handle StoreFailure
* lease api
* Cluster singleton manager with lease
* Refactor OldestData to use option for actor reference
* Sharding with lease
* Docs for singleton and sharding lease + config for sharding lease
* Have ddata shard wait until lease is acquired before getting state
* ⇒, →, ←
* because we don't want to show them in documentation snippets and
then it's complicated to avoid that when snippets are
located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala