Sergey Kosarev created IGNITE-7674:

             Summary: It is possible to create BinaryObject with wrong field 
type and that can lead to broken Transaction (TransactionHeuristicException)
                 Key: IGNITE-7674
             Project: Ignite
          Issue Type: Bug
          Components: binary, sql
    Affects Versions: 2.3
            Reporter: Sergey Kosarev

Usuaully if we have any data in a cache, if we try to create BynaryObject with 
the same field name and another type we BinaryObjectException is thrown

Wrong value has been set [typeName=org.apache.ignite.internal.binary.Foo, 
fieldName=intField, fieldType=int, assignedValueType=String]

, but there are cases we can create an inconsistent BinaryObject

suppose we haveĀ 

class Foo {
    private String strField;

    private int intField;

    public Foo(String strField, int intField) {
        this.intField = intField;
        this.strField = strField;

case 1
    .setField("intField", "String")

case 2 (if we remove all fields schema flag is cleared )
fooCache.<Integer, BinaryObject>withKeepBinary().get(1)
    .setField("intField", "String")

It is especially bad when we have an index on this field and cache is 
if we put wrong BinaryObject into the cache, we got 
TransactionHeuristicException on commit and broken transaction (data can be 
comitted or not in some cases)

This message was sent by Atlassian JIRA

Reply via email to