Re: same cache cannot update twice in one transaction
1. why do we need the storage (whether native or 3rd party)? I need the storage because 1) down time for production deployment. 2) the data in the cache may be crashed and All ignite clusters are completed down (sorry) 2. So I need a storage to store the data that have been committed when transactions are committed. Do I have to care MVCC query in 3rd party storage? No. It's very difficult (if not possible) to achieve this goal given people are using distributed NoSQL databases. Can we directly query Ignite native storage with MVCC without the caching layer running on top of it? 3. Comparing to the other database storage, Ignite native storage is relative new. The features to support ML, data mining are provided, but not comprehensive like Apach Spark... So questions are raised when the integration of Ignite native storage or 3rd party storage with Spark - which storage is better? 4. I think that Ignite should specialize in caching, MVCC on cache layer (grid). Provide own native storage, ML, data mining feature are great, but there is limited resource for this community to complete this mission. Leave the other specialized groups (exports) focusing on storage store, ML, data mining, Block Chain... 5. Instead Ignite might focus on to integrate these things together to build data-ecosystem. I think that there are many dis-integrated, separated data storage, cache, ML, Deep Learning, blockchain. To put these things together, it needs visionary leaders, high skilled engineers. Why can we make our world life easier? 6. Igniters, please focus the grid computing (cache), ACID-compliant transaction, MVCC-enabled SQL in cache layer, and provide services to integrate with the other storage, spark (ML), hyper ledge fabric or ethereum or bitcoin (block chain). -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: same cache cannot update twice in one transaction
Hi, MVCC in Ignite is targeted to provide transactional consistency guarantees. I suppose that with eventually consistent 3rd party store it would be impossible to give much guarantees in general. Do think that such eventually consistent store will be widely used? What kind of guarantees should it provide? Is it easy to use it properly? Currently we do not have answers to these questions. Feedback is appreciated. Also I must say that MVCC feature is currently in beta stage and limitations are listed in documentation [1]. [1] https://apacheignite.readme.io/docs/multiversion-concurrency-control#section-other-limitations чт, 28 февр. 2019 г. в 22:34, xmw45688 : > > Hi Ilya, > > It'd better if this was mentioned in Ignite Doc. > > It seems very limited if MVCC only supports the Ignite native persistence. > Yes, supporting MVCC in 3rd party persistence is challenging. However, do > we really need MVCC when the data from Cache (where MVCC already enabled) is > ready to write to a 3rd party persistence store. I think that an "eventual > consistence" for writing cached data into a 3rd persistence layer seems > sufficient when Ignite is used as cache stored, and the data in cache store > is persistent. > > Does Ignite have a plan to support MVCC in cache layer and write the data > from the cached store into a 3rd party persistence store with some limited > feature like "eventual consistence". > > Can some gurus shed some lights on this subject? > > > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ -- Best regards, Ivan Pavlukhin
Re: same cache cannot update twice in one transaction
Hi Ilya, It'd better if this was mentioned in Ignite Doc. It seems very limited if MVCC only supports the Ignite native persistence. Yes, supporting MVCC in 3rd party persistence is challenging. However, do we really need MVCC when the data from Cache (where MVCC already enabled) is ready to write to a 3rd party persistence store. I think that an "eventual consistence" for writing cached data into a 3rd persistence layer seems sufficient when Ignite is used as cache stored, and the data in cache store is persistent. Does Ignite have a plan to support MVCC in cache layer and write the data from the cached store into a 3rd party persistence store with some limited feature like "eventual consistence". Can some gurus shed some lights on this subject? -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: same cache cannot update twice in one transaction
Hello! Yes, unfortunately MVCC does not support 3rd party persistence (and I'm not sure that it is possible by design). Regards, -- Ilya Kasnacheev чт, 28 февр. 2019 г. в 00:29, xmw45688 : > Hi Ilya, > > Since I'm using Cassandra as data store, it raises the following exceptions > once MVCC is enabled - > > > > class org.apache.ignite.IgniteCheckedException: Grid configuration > parameter > invalid: readThrough cannot be used with TRANSACTIONAL_SNAPSHOT atomicity > mode > at > > org.apache.ignite.internal.processors.GridProcessorAdapter.assertParameter(GridProcessorAdapter.java:140) > at > > org.apache.ignite.internal.processors.cache.GridCacheProcessor.validate(GridCacheProcessor.java:527) > at > > org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCacheContext(GridCacheProcessor.java:1543) > at > > org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheContext(GridCacheProcessor.java:2324) > at > > org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$null$fd62dedb$1(GridCacheProcessor.java:2163) > at > > org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$prepareStartCaches$5(GridCacheProcessor.java:2086) > at > > org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$prepareStartCaches$937cbe24$1(GridCacheProcessor.java:2160) > > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
Re: same cache cannot update twice in one transaction
Hi Ilya, Since I'm using Cassandra as data store, it raises the following exceptions once MVCC is enabled - class org.apache.ignite.IgniteCheckedException: Grid configuration parameter invalid: readThrough cannot be used with TRANSACTIONAL_SNAPSHOT atomicity mode at org.apache.ignite.internal.processors.GridProcessorAdapter.assertParameter(GridProcessorAdapter.java:140) at org.apache.ignite.internal.processors.cache.GridCacheProcessor.validate(GridCacheProcessor.java:527) at org.apache.ignite.internal.processors.cache.GridCacheProcessor.createCacheContext(GridCacheProcessor.java:1543) at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheContext(GridCacheProcessor.java:2324) at org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$null$fd62dedb$1(GridCacheProcessor.java:2163) at org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$prepareStartCaches$5(GridCacheProcessor.java:2086) at org.apache.ignite.internal.processors.cache.GridCacheProcessor.lambda$prepareStartCaches$937cbe24$1(GridCacheProcessor.java:2160) -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: same cache cannot update twice in one transaction
Hello! Are you sure that you have enabled MVCC for your cache? Regards, -- Ilya Kasnacheev ср, 27 февр. 2019 г. в 10:31, xmw45688 : > It seems that this enhancement has not been implemented yet for the > following > cases: > trx.start() { > 1. update t1 set col1='a' where col2='c'; > 2. update the same table t1 with cache API. > > } > trx.end(); > > Can someone confirm? > many thanks, Xinmin > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
Re: same cache cannot update twice in one transaction
It seems that this enhancement has not been implemented yet for the following cases: trx.start() { 1. update t1 set col1='a' where col2='c'; 2. update the same table t1 with cache API. } trx.end(); Can someone confirm? many thanks, Xinmin -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: same cache cannot update twice in one transaction
OK,Thanks for reply. -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: same cache cannot update twice in one transaction
No, this is not implemented yet. Here is the ticket where you can track the progress: https://issues.apache.org/jira/browse/IGNITE-3478 -Val -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: same cache cannot update twice in one transaction
Hi, val,is 2.3.0 version fix this problem? when I update to 2.3.0 and I get IgniteSQLException: Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to update some keys because they had been modified concurrently [keys=[Ljava.lang.Object;@2d6f11] at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:597) at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:560) at org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.query(GatewayProtectedCacheProxy.java:382) at cn.eboss.paas.exec.TestDemo.reservedSku(TestDemo.java:104) at cn.eboss.paas.exec.TestDemo.main(TestDemo.java:149) Caused by: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to update some keys because they had been modified concurrently [keys=[Ljava.lang.Object;@2d6f11] at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.checkUpdateResult(DmlStatementsProcessor.java:1171) at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFieldsDistributed(DmlStatementsProcessor.java:231) at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1453) at org.apache.ignite.internal.processors.query.GridQueryProcessor$5.applyx(GridQueryProcessor.java:1909) at org.apache.ignite.internal.processors.query.GridQueryProcessor$5.applyx(GridQueryProcessor.java:1907) at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36) at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2445) at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:1914) at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:585) ... 4 more Caused by: java.sql.SQLException: Failed to update some keys because they had been modified concurrently [keys=[Ljava.lang.Object;@2d6f11] at org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode.createJdbcSqlException(IgniteQueryErrorCode.java:116) at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.checkUpdateResult(DmlStatementsProcessor.java:1169) ... 12 more -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: same cache cannot update twice in one transaction
I got it。thanks! vkulichenko wrote > SQL queries are currently not enlisted in transactions. You should use > key-value API if you need full transactional support. For SQL it will be > added in future versions, hopefully by the end of this year. > > -Val -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/same-cache-cannot-update-twice-in-one-transaction-tp14639p15270.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: same cache cannot update twice in one transaction
SQL queries are currently not enlisted in transactions. You should use key-value API if you need full transactional support. For SQL it will be added in future versions, hopefully by the end of this year. -Val -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/same-cache-cannot-update-twice-in-one-transaction-tp14639p15258.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: same cache cannot update twice in one transaction
Hi,vkulichenko Thanks your replying, I had been add tx.close() on my code. "not working" when I update same cache data more than one time on same transactional, the update will failure because query return cache data still the old data,not the updated dirty data. code is not working in demo project as below: // update cache multiple time on one transactional igniteTLS.txStart(); result = testDemo.reservedSku(cacheInfo.getSkuId(), 1); // --- first time to update cache,it is success System.out.println(String.format("#2-1 return %d row updated", result)); // --- second time to update cache,it is failure because igniteCache.query return cache is old data, not the first time update dirty data. result = testDemo.reservedSku(cacheInfo.getSkuId(), 2); System.out.println(String.format("#2-2 return %d row updated", result)); // --- third time to update cache,it is failure because igniteCache.query return cache is old data, not the first time update dirty data. result = testDemo.reservedSku(cacheInfo.getSkuId(), 3); System.out.println(String.format("#2-3 return %d row updated", result)); igniteTLS.commit(); -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/same-cache-cannot-update-twice-in-one-transaction-tp14639p15225.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: same cache cannot update twice in one transaction
Your code works for me. What exactly do you mean by 'not working'? And btw, you should ALWAYS call Transaction#close() in the finally block after transaction is finished. Your current code cause unfinished transactions and hangs. -Val -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/same-cache-cannot-update-twice-in-one-transaction-tp14639p15145.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: same cache cannot update twice in one transaction
Hi,Mikhail I am the first time to mail-list,thanks for your suggestion. I had upload demo project, it is seem the problem is cache after update,requery cache with return the old value, not the update dirty data. IgniteDemoV2-log4j.zip <http://apache-ignite-users.70518.x6.nabble.com/file/n15108/IgniteDemoV2-log4j.zip> -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/same-cache-cannot-update-twice-in-one-transaction-tp14639p15108.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: same cache cannot update twice in one transaction
Please properly subscribe to the mailing list so that the community can receive email notifications for your messages. To subscribe, send empty email to user-subscr...@ignite.apache.org and follow simple instructions in the reply. Also transactional guarantees are fully supported only for key-based access. SQL isn't transactional. But any way, second update should work fine as I can see, Could you please send me a small pom based reproducer to check and debug it locally? Thanks, Mikhail. -- View this message in context: http://apache-ignite-users.70518.x6.nabble.com/same-cache-cannot-update-twice-in-one-transaction-tp14639p14888.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.