Maybe the "crashed" word is a bit strong here, we can change it to "stop"
and add a message that this is valid if Ignite is stopped by "close()"
method.

2017-08-04 10:54 GMT+03:00 Ivan Rakov <ivan.glu...@gmail.com>:

> Dmitriy,
>
> From my point of view, invoking stop(true) is correct behaviour.
>
> Stopping node in the middle of checkpoint is absolutely valid case. That's
> how persistence works - node will restore memory state if stopped at any
> moment.
> On the other hand, checkpoint may last for a long time. Thread hanging on
> Ignite.close() may confuse user much more than "crashed in the middle of
> checkpoint" message.
>
> Best Regards,
> Ivan Rakov
>
>
> On 03.08.2017 22:34, Dmitry Pavlov wrote:
>
>> Hi Igniters,
>>
>> I’ve created the simplest example using Ignite 2.1 and persistence (see
>> the
>> code below). I've included Ignite instance into try-with-resources (I
>> think
>> it is default approach for AutoCloseable inheritors).
>>
>> But next time when I started this server I got message: “Ignite node
>> crashed in the middle of checkpoint. Will restore memory state and enforce
>> checkpoint on node start.”
>>
>> This happens because in close() method we don’t wait checkpoint to end. I
>> am afraid this behaviour may confuse users on the first use of the
>> product.
>>
>> What do you think if we change Ignite.close() functioning from stop(true)
>> to stop(false)? This will allow to wait checkpoints to finish by default.
>>
>> Alternatively, we may improve example to show how to shutdown server node
>> correctly. Current PersistentStoreExample does not cover server node
>> shutdown.
>>
>> Any concerns on close() method change?
>>
>> Sincerely,
>> Dmitriy Pavlov
>>
>>
>> IgniteConfiguration cfg = new IgniteConfiguration();
>> cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration());
>>
>> try (Ignite ignite = Ignition.start(cfg)){
>>     ignite.active(true);
>>     IgniteCache<String, String> cache = ignite.getOrCreateCache("test");
>>
>>     for (int i = 0; i < 1000; i++)
>>           cache.put("Key" + i, "Value" + i);
>> }
>>
>>
>

Reply via email to