This repository was archived by the owner on Apr 18, 2024. It is now read-only.
Rolling update steps for Classic -> Typed Sharding#110
Open
patriknw wants to merge 9 commits into
Open
Conversation
Contributor
Author
|
Another thing I will try is to have response messages that originally were sent to |
5294705 to
483f612
Compare
Contributor
Author
|
I have also tried messages with replies, and also |
This was referenced Jun 20, 2019
483f612 to
5d847f7
Compare
helena
reviewed
Jul 17, 2019
This was referenced Jul 18, 2019
* use ask for deviceId >= 40
* update to Akka 2.6.x first
* and add dependeny `akka-cluster-sharding-typed` although the actors remain untyped in first rollout
* define akka.cluster.sharding.number-of-shards config
* same value as you have used previously for number of shards
* same value as you will use for Typed
* otherwise Typed node will not be able to join in roll 2
* add akka.cluster.sharding.typed.ShardingEnvelope to message extractor
* sender and ask
* add replyTo ActorRef to the messages that are using sender for the reply
* change from `akka.pattern.ask` to `akka.pattern.extended.ask` to populate
the replyTo field in the messages
* use the replyTo field instead of sender() unless it is null
* convert actors to Typed * use custom ShardingMessageExtractor in ClusterSharding.init * use same akka.cluster.sharding.number-of-shards config as was in roll 1
* custom ShardingMessageExtractor can be removed
* update to Akka 2.6.x first
* and add dependeny `akka-cluster-sharding-typed` although the actors remain untyped in first rollout
* define akka.cluster.sharding.number-of-shards config
* same value as you have used previously for number of shards
* same value as you will use for Typed
* otherwise Typed node will not be able to join in roll 2
* add akka.cluster.sharding.typed.ShardingEnvelope to message extractor
* sender and ask
* add replyTo ActorRef to the messages that are using sender for the reply
* change from `akka.pattern.Patterns.ask` to `akka.pattern.Patterns.askWithReply` to populate
the replyTo field in the messages
* use the replyTo field instead of getSender() unless it is null
* convert actors to Typed * use custom ShardingMessageExtractor in ClusterSharding.init * use same akka.cluster.sharding.number-of-shards config as was in roll 1
* custom ShardingMessageExtractor can be removed
5d847f7 to
dc25a53
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DO NOT MERGE
This example illustrates how a rolling update from Classic to Typed Sharding can be performed.
Full cluster shutdown is of course easier but if zero downtime is needed it is possible with these steps.
See the commit diffs to see what needs to be done in this 3 phase rolling update.
roll 1 - Scala: 359e08d, Java: 47bf16a
akka-cluster-sharding-typedalthough the actors remain untyped in first rolloutakka.pattern.asktoakka.pattern.extended.askto populatethe replyTo field in the messages
roll 2 - Scala: 0ceac95, Java: b415647
roll 3 - Scala: b27976b, Java: dc25a53
Refs akka/akka-core#26718