Reza Taroosheh created IGNITE-29241:
---------------------------------------

             Summary: An interrupted ATOMIC put of a new Externalizable class 
is reported as a corrupted B+Tree and stops the node
                 Key: IGNITE-29241
                 URL: https://issues.apache.org/jira/browse/IGNITE-29241
             Project: Ignite
          Issue Type: Bug
            Reporter: Reza Taroosheh
            Assignee: Reza Taroosheh


If a thread is interrupted while an {{ATOMIC}} cache update writes a value of 
an {{Externalizable}} class (or a class with its own 
{{writeObject}}/{{readObject}}) that the node has not used yet, the update 
fails with {{CorruptedTreeException: B+Tree is corrupted}}. This is a 
{{CRITICAL_ERROR}}, and the default {{StopNodeOrHaltFailureHandler}} halts the 
JVM.

Nothing is corrupted: the interrupt only ends the wait for the class name 
registration. An interrupt is an ordinary event on a pooled thread, for example 
at {{ExecutorService.shutdownNow()}}. It should fail the operation, not stop 
the node.

Steps:
# Start a server node with an {{ATOMIC}} cache.
# Interrupt a thread, then call {{cache.put(1, value)}} from it, where 
{{value}} is of an {{Externalizable}} class not used in the cluster before.

Actual: the put fails, and the failure handler is called with 
{{CorruptedTreeException: B+Tree is corrupted [... msg=Runtime failure on 
search row ...]}}, caused by {{BinaryObjectException: Failed to register 
class}}, caused by {{IgniteInterruptedCheckedException: Got interrupted while 
waiting for future to complete}}.
Expected: the put fails with an exception, the failure handler is not called, 
and the node keeps running.

The same interrupt fails the operation cleanly, without a failure handler call, 
when the value's class is handled by the binary marshaller, when the 
{{Externalizable}} class is nested in a binary value, or when the cache is 
{{TRANSACTIONAL}}, and the write is in a transaction.

Workaround: write each such class once, on a thread that is not interrupted, 
before any thread that may be interrupted writes it. 
{{IgniteBinary.registerClass}} and {{IgniteBinary.toBinary}} do not help.

Reproduced on 2.18.0 (reported on the dev list: 
https://lists.apache.org/thread.html/qqyp941vb5vmxlzz0d18yglzjyrw3t7r), and on 
master by a new test.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to