You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Lucky <wa...@163.com> on 2017/07/20 06:36:24 UTC

about write behind problems

Hi:  
     I startup an Ignite server node by running ignite.sh and the default-config.xml did not modifiy (using the default file).     
     Then  I registered a lifeCycleBean to set configure and load all data to cache.
     just like this:
          
      In the DefaultCacheConfiguration class ,I set these:
          cacheCfg.setWriteBehindEnabled(true);
          cacheCfg.setWriteBehindFlushSize(10240);
        cacheCfg.setWriteBehindFlushFrequency(5000);
        cacheCfg.setWriteBehindBatchSize(10000);
        cacheCfg.setWriteBehindFlushThreadCount(3);


      the client node update data code is like this:
       String sql = "insert into "mycache1".tableA(_key,fid,fname) select(fid,fid,orgid) from "mycache2".tableB";
       cache.query(new SqlFieldQuery(sql));
      
      But there are two problems:
      1.write behind parameters is not work. it wait until all data is persisted.
     2.the writeBehindBatchSize is set to 10000,bu I see this:
           
          this is not 10000 each time,and There is no interval of 10 seconds.


    Thanks for any suggestion.
    Thanks
      Lucky



 





 

Re: Re:Re: Re:Re: about write behind problems

Posted by vkulichenko <va...@gmail.com>.
Can you provide a reproducer?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/about-write-behind-problems-tp15160p15255.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re:Re: Re:Re: about write behind problems

Posted by Lucky <wa...@163.com>.
Of cource I did.
cacheCfg.setWriteThrough(true);








At 2017-07-21 10:38:00, "vkulichenko" <va...@gmail.com> wrote:
>Did you set the writeThrough property? It's needed to enable write to cache
>store, regardless of whether it's write-behind mode or not.
>
>cacheCfg.setWriteThrough(true);
>
>-Val
>
>
>
>--
>View this message in context: http://apache-ignite-users.70518.x6.nabble.com/about-write-behind-problems-tp15160p15219.html
>Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Re:Re: about write behind problems

Posted by vkulichenko <va...@gmail.com>.
Did you set the writeThrough property? It's needed to enable write to cache
store, regardless of whether it's write-behind mode or not.

cacheCfg.setWriteThrough(true);

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/about-write-behind-problems-tp15160p15219.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re:Re: about write behind problems

Posted by Lucky <wa...@163.com>.
Ok, in this case,I did not tell about loading cache.
It is about persistent data.
I want to insert 500000 records into DB.
my setting is:
          cacheCfg.setWriteBehindEnabled(true);
          cacheCfg.setWriteBehindFlushSize(10240);
        cacheCfg.setWriteBehindFlushFrequency(10000);
        cacheCfg.setWriteBehindBatchSize(10000);
        cacheCfg.setWriteBehindFlushThreadCount(3);




My question is:
1.WriteBehindEnabled parameter is set to true,but it seems not work.
       String sql = "insert into "mycache1".tableA(_key,fid,fname) select(fid,fid,orgid) from "mycache2".tableB";
       cache.query(new SqlFieldQuery(sql));


       this is update data to DB.
       but it wait until all data has finished  persistent to DB.
I just hope the flow can run continue when the cache is updated ,but not need to wait persistent .

2. setWriteBehindBatchSize is set to 10000 and setWriteBehindFlushFrequency is set to 5 seconds,but in the log ,I see  that is not 10000 each time,and There is no interval of 10 seconds


Thanks.
Lucky



At 2017-07-21 03:18:06, "vkulichenko" <va...@gmail.com> wrote:
>Hi Lucky,
>
>Write behind affects the way how underlying store is updated when you update
>the cache. Load cache process is different and is not related to this. More
>information here: https://apacheignite.readme.io/docs/persistent-store
>
>-Val
>
>
>
>--
>View this message in context: http://apache-ignite-users.70518.x6.nabble.com/about-write-behind-problems-tp15160p15205.html
>Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: about write behind problems

Posted by vkulichenko <va...@gmail.com>.
Hi Lucky,

Write behind affects the way how underlying store is updated when you update
the cache. Load cache process is different and is not related to this. More
information here: https://apacheignite.readme.io/docs/persistent-store

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/about-write-behind-problems-tp15160p15205.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.