You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by amitpa <am...@nrifintech.com> on 2016/05/03 11:49:09 UTC

Ignite WRite Behind

I am trying to write behind with Ignite Transactions.

I have enabled Ignite Write Behind. However I am seeing that only the write
method is called with one entry, and the writeAll method is never called in
spite of me overriding it.

My Cache is Transactional and I am using Ignite Transactions. Does using
transactions with Transactional cache mandate that only WRite will be called
? 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-WRite-Behind-tp4741.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite WRite Behind

Posted by Alexei Scherbakov <al...@gmail.com>.
Hi,

Your understanding is correct.
All saved entities will be batched according to write behind setings.

2016-05-06 9:20 GMT+03:00 amitpa <am...@nrifintech.com>:

> Can anyone please answer the query, I am kind f stuck with this
>
> Regards
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-WRite-Behind-tp4741p4805.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 

Best regards,
Alexei Scherbakov

Re: Ignite WRite Behind

Posted by amitpa <am...@nrifintech.com>.
Can anyone please answer the query, I am kind f stuck with this

Regards



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-WRite-Behind-tp4741p4805.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite WRite Behind

Posted by amitpa <am...@nrifintech.com>.
does write behind work without this setting :- 
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC);

Here is my cache setting :- 

            cacheCfg.setReadThrough(true);
            cacheCfg.setWriteThrough(true);
            cacheCfg.setWriteBehindEnabled(true);
            cacheCfg.setWriteBehindFlushThreadCount(1);
            cacheCfg.setAtomicityMode(TRANSACTIONAL);
            cacheCfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
            cacheCfg.setCacheMode(CacheMode.PARTITIONED);
            cacheCfg.setBackups(0);
            cacheCfg.setSwapEnabled(false);
            cacheCfg.setWriteBehindFlushFrequency(5000);
            cacheCfg.setOffHeapMaxMemory(0);

Do I need to add something to it? 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-WRite-Behind-tp4741p4797.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite WRite Behind

Posted by amitpa <am...@nrifintech.com>.
I undrestand that WriteAll will be called per cache.

But my undrestanding is this :-

1) There are two configs for write behind  1) No of Entries and Time

2) SO if I make three cache entries in three transaction before the time
(which is configured to lets say 4000 ms ) then the writeAll should be
called for the 3 entries.

My transaction level is Optimistic with Serializable. Does this affect
something?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-WRite-Behind-tp4741p4796.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite WRite Behind

Posted by Vladimir Ozerov <vo...@gridgain.com>.
Hi,

writeAll() method is only executed for entries located in the same cache.
As you have only 1 entry per cache in transaction, this is expected
behavior that writeAll() is not called. Normally, you should make your
logic dependent on whether write() or writeAll() is called, because it is
up to Ignite to decide which method to call.

Vladimir.

On Wed, May 4, 2016 at 5:54 AM, amitpa <am...@nrifintech.com> wrote:

> Hi,
>
> I have 2 nodes setup and there are around 5 different caches involved, with
> 1 entry per cache per transaction.
>
> I have writeThrough set to true and writeBehindEnabled set to true.
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-WRite-Behind-tp4741p4748.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: Ignite WRite Behind

Posted by amitpa <am...@nrifintech.com>.
Hi,

I have 2 nodes setup and there are around 5 different caches involved, with
1 entry per cache per transaction. 

I have writeThrough set to true and writeBehindEnabled set to true.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-WRite-Behind-tp4741p4748.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite WRite Behind

Posted by Alexey Goncharuk <al...@gmail.com>.
Hi,

How many entries do you have in your transaction and how many nodes do you
have in your set up? Note that for write-behind cache store is always
invoked from the primary node. May it be the case that your transaction is
small enough so that all entries go to different nodes?

Re: Ignite WRite Behind

Posted by amitpa <am...@nrifintech.com>.
Can anyone please look into this? 
I am stuck with this problem. Is there any reason that this might happen?

It does work fine when I am using only writeThrough. But when enabling
writeBehind it seems that only writeThrough behavior is enabled, and write
behind is not called.





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-WRite-Behind-tp4741p4742.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.