ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Myron Chelyada <myron.chely...@gmail.com>
Subject Re: Version issue with concurrent cache updates (EntryProcessor)
Date Wed, 02 Mar 2016 15:55:36 GMT
Alexey,

Thanks for advice.

But could you also provide any timelines for listed issues?



2016-03-02 1:14 GMT+02:00 Alexey Goncharuk <alexey.goncharuk@gmail.com>:

> Oh, I see now what you mean, IGNITE-1018 has escaped my view. Then, until
> IGNITE-1018 is fixed, the only guaranteed approach is to wait on a CDL.
> Here is the pseudo-code that I have in mind:
>
> LifecycleBean or after Ignition.start():
> // Populate your node local map
> ....
>
> CountDownLatch init = nlm.get(INIT_KEY);
>
> if (init == null) {
>     CountDownLatch old = nlm.putIfAbsent(INIT_KEY, init = new CountDownLatch(1));
>
>     if (old != null)
>         init = old;
> }
>
> init.countDown();
>
>
> EntryProcessor:
>
> CountDownLatch init = nlm.get(INIT_KEY);
>
> if (init == null) {
>     CountDownLatch old = nlm.putIfAbsent(INIT_KEY, init = new CountDownLatch(1));
>
>     if (old != null)
>         init = old;
> }
>
> init.await();
>
> // Run entry procesor
>
>
> This approach has only one restriction - you should not call any cache operations on
the started node before you release the latch, otherwise this may lead to a distributed deadlock.
>
> Hope this helps!
>
> AG
>
>

Mime
View raw message