Ignore gossip desrialization failures (#29848)

* Ignore gossip desrialization failures

Only to happen suring a rolling upgrade. Gives us the option to do
incompatible things in Gossip and have the old nodes ignore the
deserialization error.

* Review feedback
This commit is contained in:
Christopher Batey 2020-12-02 18:50:16 +00:00 committed by GitHub
parent ffb21da246
commit 3602ffa4d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -324,7 +324,7 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh
val selfDc = cluster.selfDataCenter val selfDc = cluster.selfDataCenter
private val gossipLogger = private val gossipLogger: cluster.ClusterLogger =
new cluster.ClusterLogger( new cluster.ClusterLogger(
Logging.withMarker(context.system, ActorWithLogClass(this, ClusterLogClass.ClusterGossip))) Logging.withMarker(context.system, ActorWithLogClass(this, ClusterLogClass.ClusterGossip)))
@ -1015,9 +1015,15 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef, joinConfigCompatCh
* Receive new gossip. * Receive new gossip.
*/ */
def receiveGossip(envelope: GossipEnvelope): ReceiveGossipType = { def receiveGossip(envelope: GossipEnvelope): ReceiveGossipType = {
val from = envelope.from val from = envelope.from
val remoteGossip = envelope.gossip val remoteGossip = try {
envelope.gossip
} catch {
case NonFatal(t) =>
gossipLogger.logWarning("Invalid Gossip. This should only happen during a rolling upgrade. {}", t.getMessage)
Gossip.empty
}
val localGossip = latestGossip val localGossip = latestGossip
if (remoteGossip eq Gossip.empty) { if (remoteGossip eq Gossip.empty) {