Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions akka-docs/src/main/paradox/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ RedirectMatch 301 ^(.*)/stream/operators/Source-or-Flow/UnzipWith\.html$ $1/stre
RedirectMatch 301 ^(.*)/stream/operators/Source-or-Flow/apply\.html$ $1/stream/operators/Source/from.html

RedirectMatch 301 ^(.*[^d])/guide/(.*) $1/typed/guide/$2

RedirectMatch 301 ^(.*)/additional/rolling-deploys\.html$ $1/additional/rolling-updates.html
2 changes: 1 addition & 1 deletion akka-docs/src/main/paradox/additional/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* [Packaging](packaging.md)
* [Deploying](deploying.md)
* [Rolling Deploys](rolling-deploys.md)
* [Rolling Updates](rolling-updates.md)
Comment thread
helena marked this conversation as resolved.

@@@

Expand Down
39 changes: 0 additions & 39 deletions akka-docs/src/main/paradox/additional/rolling-deploys.md

This file was deleted.

90 changes: 90 additions & 0 deletions akka-docs/src/main/paradox/additional/rolling-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Rolling Updates

A rolling update is the process of replacing one version of the system with another without downtime.
The changes can be new code, changed dependencies such as new Akka version, or modified configuration.

In Akka, rolling updates are typically used for a stateful Akka Cluster where you can't run two separate clusters in
parallel during the update, for example in blue green deployments.

For rolling updates related to Akka dependency version upgrades and the migration guides, please see

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth an extra section below with some basic information similar to the other ones.

@helena helena Jul 24, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would but Patrik wanted to be sure we do not duplicate content here, and I fear adding basic info like that would possibly do that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be the same style as the other sections below with general information / explanations + links.

@ref:[Rolling Updates and Akka versions](../project/rolling-update.md)

#### This document covers:
Comment thread
helena marked this conversation as resolved.
Outdated
* [Serialization Compatibility](#serialization-compatibility)
* [Cluster Sharding](#cluster-sharding)
* [Cluster Singleton](#cluster-singleton)
* [Migrating Untyped to Typed](#migrating-untyped-to-typed)
* [Cluster Shutdown](#cluster-shutdown)
* [Cluster Configuration Compatibility Check](#cluster-configuration-compatibility-check)

## Serialization Compatibility

There are two parts of Akka that need careful consideration when performing an rolling update.

1. Compatibility of remote message protocols. Old nodes may send messages to new nodes and vice versa.
1. Serialization format of persisted events and snapshots. New nodes must be able to read old data, and
during the update old nodes must be able to read data stored by new nodes.

There are many more application specific aspects for serialization changes during rolling upgrades to consider.
For example, whether to allow dropped messages or tear down the TCP connection when the manifest is unknown.

* When some message loss during a rolling upgrade is acceptable versus a full shutdown and restart, assuming the application recovers afterwards

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not quite clear to me what these bullets refer to. Is it in relation to "many more application specific aspects" above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That is pre-existing content.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bullets just feel a bit thrown together without any obvious connection to previous paragraph. Is it an explanation or a recommendation or a choice for the user? I can somehow puzzle together what is meant but if you read it for the first time, you'll probably be confused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this is now clarified and pushed.

- If a `java.io.NotSerializableException` is thrown in `fromBinary` this is treated as a transient problem, the issue logged and the message is dropped
- If other exceptions are thrown it can be an indication of corrupt bytes from the underlying transport, and the connection is broken
* For more zero-impact rolling upgrades, it is important to consider a strategy for serialization format that can be evolved. You can find advice in
Comment thread
helena marked this conversation as resolved.
Outdated
@ref:[Persistence - Schema Evolution](../persistence-schema-evolution.md), which also applies to
Comment thread
helena marked this conversation as resolved.
Outdated
remote messages when deploying with rolling updates.

One approach to retiring a serializer without downtime is carried out in @ref:[two rolling upgrade steps to switch to the new serializer](../serialization.md#rolling-upgrades).
Comment thread
raboof marked this conversation as resolved.
Outdated

## Cluster Sharding

During a rolling upgrade, sharded entities receiving traffic may be moved during @ref:[shard rebalancing](../cluster-sharding.md#shard-rebalancing),
to an old or new node in the cluster, based on the pluggable allocation strategy and settings.
When an old node is stopped the shards that were running on it may be allocated to one of the
Comment thread
helena marked this conversation as resolved.
Outdated
other old nodes remaining in the cluster. See @ref[ClusterSingleton](#cluster-singleton) for a useful `ShardCoordinator` optimization.
Comment thread
helena marked this conversation as resolved.
Outdated
Comment thread
helena marked this conversation as resolved.
Outdated

There are some cases when @ref:[a full cluster restart is needed](../cluster-sharding.md#rolling-upgrades).
Comment thread
helena marked this conversation as resolved.
Outdated

## Cluster Singleton

It's more efficient to avoid moving a `ClusterSingleton` more than necessary because they typically have to recover their state

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewording suggestion for the whole section:

Cluster singletons are always running on the oldest node. To avoid moving cluster singletons more than necessary during a rolling upgrade, it is recommended to upgrade the oldest node last. This way cluster singletons are only moved once during a full rolling upgrade. Otherwise, in the worst case cluster singletons may be migrated from node to node which requires coordination and initialization overhead several times.

and it might introduce unnecessary delays.

An optional optimization is to leave the oldest node running a `ClusterSingleton` until last
to avoid it having to move more than once.

## Migrating Untyped to Typed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Migrating Untyped to Typed
## Migrating from Classic to Typed Actors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the challenges here?


It is recommended with a two step approach:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is recommended with a two step approach:
A two step approach is recommended:


* Deploy with the new nodes set to `akka.cluster.configuration-compatibility-check.enforce-on-join = off`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear to me how these steps relate to the migration from classic to typed actors?

and ensure all nodes are in this state
* Deploy again and with the new nodes set to `akka.cluster.configuration-compatibility-check.enforce-on-join = on`.

The configuration from existing nodes should pass the @ref:[Cluster Configuration Compatibility Checks](#cluster-configuration-compatibility-check).
Find out more about coexisting and @ref:[untyped to typed](../typed/coexisting.md#untyped-to-typed).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Find out more about coexisting and @ref:[untyped to typed](../typed/coexisting.md#untyped-to-typed).
Find out more about classic and typed actors coexisting and the migration from @ref:[classic to typed actors](../typed/coexisting.md#untyped-to-typed).


### With Cluster Sharding and Persistence

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section related to and could be updated with #27342. And samples from @patriknw's work in akka/akka-samples#110 linked when merged.


Rolling upgrades where shards on old nodes are running untyped persistent actors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does that mean exactly? Is that about migrating persistent entities from classic to typed? Or that on new nodes you could have new entities written with typed style?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing it for adding when samples are done, but this is something user verified #26718

and new ones are running typed persistent behaviors have been tested successfully by the team and users.
Samples coming soon.

## Cluster Shutdown

@ref:[Coordinated Shutdown](../actors.md#coordinated-shutdown) will automatically run on SIGTERM when the cluster node sees itself as Exiting.
Thus running shutdown tasks in a JVM shutdown hook is not recommended.
Comment thread
helena marked this conversation as resolved.
Outdated
@ref:[Graceful shutdown](../cluster-sharding.md#graceful-shutdown) of Cluster Singletons and Cluster Sharding similarly happen automatically.

In case of network failures it may still be necessary to set the node’s status to Down in order to complete the removal.
Comment thread
helena marked this conversation as resolved.
Outdated

Find out more about
* @ref:[Cluster Downing](../cluster-usage.md#downing) and providers
* [Cluster Bootstrap](https://doc.akka.io/docs/akka-management/current/bootstrap/index.html#rolling-updates) and Rolling updates
* [Split Brain Resolver](https://doc.akka.io/docs/akka-enhancements/current/split-brain-resolver.html)

## Cluster Configuration Compatibility Checks

Relevant information on rolling updates and enforcing @ref:[Akka Cluster configuration compatibility checks](../cluster-usage.md#configuration-compatibility-check)
Comment thread
helena marked this conversation as resolved.
Outdated
on joining nodes.