add whiteliest in serialization rolling update instruction (#28313)

This commit is contained in:
Patrik Nordwall 2019-12-05 23:47:32 +01:00 committed by Helena Edelson
parent 25ad10f893
commit 517d2ae7b0

View file

@ -95,7 +95,7 @@ without bringing down the entire cluster.
The procedure for changing from Java serialization to Jackson would look like:
1. Rolling update from 2.5.24 (or later) to 2.6.0
* Use config `allow-java-serialization=on`.
* Use config `akka.actor.allow-java-serialization=on`.
* Roll out the change.
* Java serialization will be used as before.
* This step is optional and you could combine it with next step if you like, but could be good to
@ -104,18 +104,22 @@ The procedure for changing from Java serialization to Jackson would look like:
* Change message classes by adding the marker interface and possibly needed annotations as
described in @ref:[Serialization with Jackson](../serialization-jackson.md).
* Test the system with the new serialization in a new test cluster (no rolling update).
* Remove the binding for the marker interface, so that Jackson is not used for serialization yet.
* Remove the binding for the marker interface in `akka.actor.serialization-bindings`, so that Jackson is not used for serialization (toBinary) yet.
* Configure `akka.serialization.jackson.whitelist-class-prefix=["com.myapp"]`
* This is needed for Jackson deserialization when the `serialization-bindings` isn't defined.
* Replace `com.myapp` with the name of the root package of your application to trust all classes.
* Roll out the change.
* Java serialization is still used, but this version is prepared for next roll out.
1. Rolling update to enable serialization with Jackson.
* Add the binding to the marker interface to the Jackson serializer.
* Add the binding to the marker interface in `akka.actor.serialization-bindings` to the Jackson serializer.
* Remove `akka.serialization.jackson.whitelist-class-prefix`.
* Roll out the change.
* Old nodes will still send messages with Java serialization, and that can still be deserialized by new nodes.
* New nodes will send messages with Jackson serialization, and old node can deserialize those because they were
prepared in previous roll out.
1. Rolling update to disable Java serialization
* Remove `allow-java-serialization` config, to use the default `allow-java-serialization=off`.
* Remove `.warn-about-java-serializer-usage` config if you had changed that, to use the default `.warn-about-java-serializer-usage=on`.
* Remove `warn-about-java-serializer-usage` config if you had changed that, to use the default `warn-about-java-serializer-usage=on`.
* Roll out the change.
A similar approach can be used when changing between other serializers, for example between Jackson and Protobuf.