Search code examples
javahazelcast

Hazelcast : Portable Serialization : Incompatible class-definitions with same class-id


I recently upgraded a cluster from 3.7.2 to 3.9.2; shutting down all the boxes.

I'm using Portable Serialization and the current version number in the config file is 6. Yet, after a cold start, the cluster indicates a incompatible class definition.

I've restarted the cluster several times since, yet the same error remains.

How is it possible for the system to remain out of sync for some fields in some classes, yet the version for the class was upgraded?

Log:

Caused by: 
com.hazelcast.nio.serialization.HazelcastSerializationException: 
Incompatible class-definitions with same class-id: 
ClassDefinition{factoryId=1, classId=8, version=6, fieldDefinitions=[
  FieldDefinitionImpl{index=0, fieldName='feature', type=UTF, classId=0, factoryId=0, version=6}, 
  FieldDefinitionImpl{index=1, fieldName='value', type=BOOLEAN, classId=0, factoryId=0, version=6}]}
VS 
ClassDefinition{factoryId=1, classId=8, version=6, fieldDefinitions=[
  FieldDefinitionImpl{index=0, fieldName='feature', type=UTF, classId=0, factoryId=0, version=0}, 
  FieldDefinitionImpl{index=1, fieldName='value', type=BOOLEAN, classId=0, factoryId=0, version=0}]}

Config:

<serialization>
    <portable-version>6</portable-version>
    <portable-factories>
        <portable-factory factory-id="1">
            com.MyPortableFactory
        </portable-factory>
    </portable-factories>
</serialization>

Solution

  • It is a bug in Hazelcast library that got fixed in 3.9.4 and 3.10+.

    Issue:
    https://github.com/hazelcast/hazelcast/issues/12733

    Fix for 3.10:
    https://github.com/hazelcast/hazelcast/pull/12734

    Fix for 3.9.4:
    https://github.com/hazelcast/hazelcast/pull/12735