Ignite crashes when I use composite BinaryObject as a key and also include it
into the value object.

Here is the BinaryObject scenario:

// create a new composite key
BinaryObjectBuilder key1Builder =
Ignition.ignite().binary().builder(EmployeeId.class.getName());
key1Builder.setField("employeeNumber", 65348765, Integer.class);
key1Builder.setField("departmentNumber", 123, Integer.class);
BinaryObject key1 = key1Builder.build();

// create a new value
BinaryObjectBuilder emp1Builder =
Ignition.ignite().binary().builder(Employee.class.getName());
emp1Builder.setField("firstName", "John", String.class);
emp1Builder.setField("lastName", "Smith", String.class);
emp1Builder.setField("id", key1); // The composite key is also a part of the
value!
BinaryObject emp1 = emp1Builder.build();

// put the record to the DB - OK
employeeCache.put(key1, emp1);
// read it back - OK
BinaryObject emp2 = employeeCache.get(key1);
assertThat(emp2).isNotNull();
assertThat(emp2).isEqualTo(emp1);

// put the same key and value back to the DB - OK
employeeCache.put(key1, emp1); // OK!

// extract a key from the value
BinaryObject key2 = emp1.field("id");

// try to put a record with the extracted key - CRASH
employeeCache.put(key2, emp1); // CRASH!!! CorruptedTreeException: B+Tree is
corrupted ...

// try to put a record with the extracted key clone - CRASH
employeeCache.put(key2.clone(), emp1); // CRASH!!! CorruptedTreeException:
B+Tree is corrupted ...

// try to put a record with the extracted key rebuilt - OK
employeeCache.put(key2.toBuilder().build(), emp1); // OK!

This is clearly a bug as Ignite node crashes on a such basic use case!
I expect the scenario should work in all three cases, not only when I
explicitly rebuild the extracted key.
I verified it fails in both Ignite 2.8.0 and 2.7.6 (with a different error
though).
I can provide all the stack traces upon request.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to