Revert Support for rolling upgrade of ORSet[ActorRef], #25336

This reverts commit b72312d428.
This commit is contained in:
Patrik Nordwall 2018-09-11 15:01:14 +02:00
parent 84deea70f6
commit 61e7365678
2 changed files with 16 additions and 60 deletions

View file

@ -2,3 +2,9 @@
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.cluster.ddata.PNCounter.increment")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.cluster.ddata.PNCounter.decrement")
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.cluster.ddata.PNCounter.change")
# #25336 Revert Support for rolling upgrade of ORSet[ActorRef]
ProblemFilters.exclude[MissingClassProblem]("akka.cluster.ddata.protobuf.ReplicatedDataSerializer$BothOldAndNewActorRefFormat$")
ProblemFilters.exclude[MissingClassProblem]("akka.cluster.ddata.protobuf.ReplicatedDataSerializer$NewActorRefFormat$")
ProblemFilters.exclude[MissingClassProblem]("akka.cluster.ddata.protobuf.ReplicatedDataSerializer$OldActorRefFormat$")
ProblemFilters.exclude[MissingClassProblem]("akka.cluster.ddata.protobuf.ReplicatedDataSerializer$ActorRefFormat")

View file

@ -28,7 +28,6 @@ import java.io.NotSerializableException
import akka.actor.ActorRef
import akka.cluster.ddata.protobuf.msg.ReplicatorMessages.OtherMessage
import akka.serialization.Serialization
import akka.util.Helpers.toRootLowerCase
private object ReplicatedDataSerializer {
/*
@ -168,16 +167,6 @@ private object ReplicatedDataSerializer {
override def getValue(entry: rd.ORMapDeltaGroup.MapEntry): dm.OtherMessage = entry.getValue
}
// Optimized serializer for ORSet[ActorRef] was added in 2.5.14.
// To support rolling upgrades from Akka 2.5.13 to 2.5.14 and then to 2.5.15 those elements
// are by default sent as both old and new elements in 2.5.14.
// The old is used by 2.5.13 receivers. The new is used by 2.5.14 and 2.5.15 receivers.
// FIXME Remove this in 2.5.15
private sealed trait ActorRefFormat
private case object OldActorRefFormat extends ActorRefFormat
private case object BothOldAndNewActorRefFormat extends ActorRefFormat
private case object NewActorRefFormat extends ActorRefFormat
}
/**
@ -188,20 +177,6 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
import ReplicatedDataSerializer._
private val actorRefFormat: ActorRefFormat = {
val conf = system.settings.config
val confKey = "akka.cluster.distributed-data.actor-ref-format"
// this config is not in reference.conf because it's only temporary for the 2.5.14 release
if (conf.hasPath(confKey)) {
toRootLowerCase(conf.getString(confKey)) match {
case "old" OldActorRefFormat
case "both" BothOldAndNewActorRefFormat
case "new" NewActorRefFormat
}
} else
BothOldAndNewActorRefFormat
}
private val DeletedDataManifest = "A"
private val GSetManifest = "B"
private val GSetKeyManifest = "b"
@ -353,16 +328,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
case s: String stringElements.add(s)
case i: Int intElements.add(i)
case l: Long longElements.add(l)
case ref: ActorRef
actorRefFormat match {
case BothOldAndNewActorRefFormat
actorRefElements.add(Serialization.serializedActorPath(ref))
otherElements.add(otherMessageToProto(ref))
case OldActorRefFormat
otherElements.add(otherMessageToProto(ref))
case NewActorRefFormat
actorRefElements.add(Serialization.serializedActorPath(ref))
}
case ref: ActorRef actorRefElements.add(Serialization.serializedActorPath(ref))
case other otherElements.add(otherMessageToProto(other))
}
if (!stringElements.isEmpty) {
@ -418,23 +384,7 @@ class ReplicatedDataSerializer(val system: ExtendedActorSystem)
case s: String stringElements.add(s)
case i: Int intElements.add(i)
case l: Long longElements.add(l)
case ref: ActorRef
actorRefFormat match {
case BothOldAndNewActorRefFormat
actorRefElements.add(ref)
val enclosedMsg = otherMessageToProto(ref)
otherElements.add(enclosedMsg)
// need the mapping back to the `other` when adding dots
otherElementsMap = otherElementsMap.updated(enclosedMsg, ref)
case OldActorRefFormat
otherElements.add(otherMessageToProto(ref))
val enclosedMsg = otherMessageToProto(ref)
otherElements.add(enclosedMsg)
// need the mapping back to the `other` when adding dots
otherElementsMap = otherElementsMap.updated(enclosedMsg, ref)
case NewActorRefFormat
actorRefElements.add(ref)
}
case ref: ActorRef actorRefElements.add(ref)
case other
val enclosedMsg = otherMessageToProto(other)
otherElements.add(enclosedMsg)