[ https://issues.apache.org/jira/browse/IGNITE-6252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16333849#comment-16333849 ]
Sunny Chan edited comment on IGNITE-6252 at 1/22/18 4:09 AM: ------------------------------------------------------------- [~irudyak] Let me walk you through this: # block around [231|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L231] throws InvalidQueryException. data item is not processed and not added to the list of future # prepStatEx record the exception in [251|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L251] # error set to keep the exception throw (line [276|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L276]) # line [282|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L282] resets the prepStatEx to null # line [309|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L309] didn't check the cached "error", so the error in 231 is ignored and it will not retry and return [310|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L310] [~ntikhonov] has previously updated my patch - I have merged his changes along with updated unit test provided in [PR 3088|https://github.com/apache/ignite/pull/3088] into my PR branch was (Author: sunnychanclsa): [~irudyak] Let me walk you through this: # block around [231|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L231] throws InvalidQueryException. data item is not processed and not added to the list of future # prepStatEx record the exception in [251|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L251] # error set to keep the exception throw (line [276|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L276]) # line [282|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L282] resets the prepStatEx to null # line [309|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L309] didn't check the cached "error", so the error in 231 is ignored and it will not retry and return [310|https://github.com/apache/ignite/blob/6330f0bb74d6b986d040a8017f3dfbde361d5457/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L310] [~ntikhonov] has previously updated my patch - I have merged his changes along with updated unit test provided in [PR 3088|https://github.com/apache/ignite/pull/3088] > Cassandra Cache Store Session does not retry if prepare statement failed > ------------------------------------------------------------------------ > > Key: IGNITE-6252 > URL: https://issues.apache.org/jira/browse/IGNITE-6252 > Project: Ignite > Issue Type: Bug > Components: cassandra > Affects Versions: 2.0, 2.1 > Reporter: Sunny Chan > Assignee: Igor Rudyak > Priority: Major > > During our testing, we have found that certain warning about prepared > statement: > 2017-08-31 11:27:19.479 > org.apache.ignite.cache.store.cassandra.CassandraCacheStore > flusher-0-#265%xxxx% WARN CassandraCacheStore - Prepared statement cluster > error detected, refreshing Cassandra session > com.datastax.driver.core.exceptions.InvalidQueryException: Tried to execute > unknown prepared query : 0xc7647611fd755386ef63478ee7de577b. You may have > used a PreparedStatement that was created with another Cluster instance. > We notice that after this warning occurs some of the data didn't persist > properly in cassandra cache. After further examining the Ignite's > CassandraSessionImpl code in method > execute(BatchExecutionAssistance,Iterable), we found that at around [line > 283|https://github.com/apache/ignite/blob/86bd544a557663bce497134f7826be6b24d53330/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L283], > if the prepare statement fails in the asnyc call, it will not retry the > operation as the error is stored in [line > 269|https://github.com/apache/ignite/blob/86bd544a557663bce497134f7826be6b24d53330/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L269] > and cleared in [line > 277|https://github.com/apache/ignite/blob/86bd544a557663bce497134f7826be6b24d53330/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L277] > but it was not checked again after going through the [ResultSetFuture > |https://github.com/apache/ignite/blob/86bd544a557663bce497134f7826be6b24d53330/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java#L307]. > I believe in line 307 you should check for error != null such that any > failure will be retry. -- This message was sent by Atlassian JIRA (v7.6.3#76005)