You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2017/10/31 15:41:01 UTC

[1/5] ignite git commit: IGNITE-6252 Cassandra Cache Store Session does not retry if statement failed

Repository: ignite
Updated Branches:
  refs/heads/ignite-6252 [created] 13cf04e79


IGNITE-6252 Cassandra Cache Store Session does not retry if statement failed

This patch will check to ensure that we retry any prepare statement failure when we submit the async request to Cassandra

Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/37620be6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/37620be6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/37620be6

Branch: refs/heads/ignite-6252
Commit: 37620be67fc9d882892964516c983efef1c34415
Parents: 86bd544
Author: sunnychanwork <su...@users.noreply.github.com>
Authored: Mon Sep 4 17:43:28 2017 +0800
Committer: GitHub <no...@github.com>
Committed: Mon Sep 4 17:43:28 2017 +0800

----------------------------------------------------------------------
 .../cache/store/cassandra/session/CassandraSessionImpl.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/37620be6/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
index 19b88c9..b2e5298 100644
--- a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
+++ b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
@@ -304,10 +304,10 @@ public class CassandraSessionImpl implements CassandraSession {
                     throw new IgniteException(errorMsg, unknownEx);
 
                 // If there are no errors occurred it means that operation successfully completed and we can return.
-                if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx == null)
+                if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx == null && error!=null)
                     return assistant.processedData();
 
-                if (tblAbsenceEx != null) {
+                if (tblAbsenceEx != null && CassandraHelper.isTableAbsenceError(error)) {
                     // If there are table absence error and it is not required for the operation we can return.
                     if (!assistant.tableExistenceRequired())
                         return assistant.processedData();


[5/5] ignite git commit: IGNITE-6252 Code style, minor notes.

Posted by nt...@apache.org.
IGNITE-6252 Code style, minor notes.

Signed-off-by: nikolay_tikhonov <nt...@gridgain.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/13cf04e7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/13cf04e7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/13cf04e7

Branch: refs/heads/ignite-6252
Commit: 13cf04e7957ae0de344eadfbfc667c9282cbf24e
Parents: 469e4e5
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Oct 31 18:40:55 2017 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Oct 31 18:40:55 2017 +0300

----------------------------------------------------------------------
 .../store/cassandra/session/CassandraSessionImpl.java   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/13cf04e7/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
index 29bbab6..215351c 100644
--- a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
+++ b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
@@ -192,7 +192,7 @@ public class CassandraSessionImpl implements CassandraSession {
 
         int attempt = 0;
         String errorMsg = "Failed to execute Cassandra " + assistant.operationName() + " operation";
-        Throwable error = new IgniteException(errorMsg);
+        Throwable error = null;
 
         RandomSleeper sleeper = newSleeper();
 
@@ -209,11 +209,11 @@ public class CassandraSessionImpl implements CassandraSession {
                 }
 
                 //clean errors info before next communication with Cassandra
+                error = null;
                 Throwable unknownEx = null;
                 Throwable tblAbsenceEx = null;
                 Throwable hostsAvailEx = null;
                 Throwable prepStatEx = null;
-                boolean retry = false;
 
                 List<Cache.Entry<Integer, ResultSetFuture>> futResults = new LinkedList<>();
 
@@ -268,15 +268,12 @@ public class CassandraSessionImpl implements CassandraSession {
 
                 // Remembering any of last errors.
                 if (tblAbsenceEx != null) {
-                    retry = true;
                     error = tblAbsenceEx;
                 }
                 else if (hostsAvailEx != null) {
-                    retry = true;
                     error = hostsAvailEx;
                 }
                 else if (prepStatEx != null) {
-                    retry = true;
                     error = prepStatEx;
                 }
                 
@@ -311,7 +308,7 @@ public class CassandraSessionImpl implements CassandraSession {
                     throw new IgniteException(errorMsg, unknownEx);
 
                 // If there are no errors occurred it means that operation successfully completed and we can return.
-                if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx == null && !retry)
+                if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx == null && error == null)
                     return assistant.processedData();
 
                 if (tblAbsenceEx != null) {
@@ -346,6 +343,9 @@ public class CassandraSessionImpl implements CassandraSession {
             decrementSessionRefs();
         }
 
+        if (error == null)
+            error = new IgniteException(errorMsg);
+
         errorMsg = "Failed to process " + (dataSize - assistant.processedCount()) +
             " of " + dataSize + " elements, during " + assistant.operationName() +
             " operation with Cassandra";


[2/5] ignite git commit: Remove Table Absence Check

Posted by nt...@apache.org.
Remove Table Absence Check

Already done previously

Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8cfacebf
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8cfacebf
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8cfacebf

Branch: refs/heads/ignite-6252
Commit: 8cfacebfc49edf28847acd4ccabe03b8287f2e5a
Parents: 37620be
Author: sunnychanwork <su...@users.noreply.github.com>
Authored: Mon Sep 4 18:01:05 2017 +0800
Committer: GitHub <no...@github.com>
Committed: Mon Sep 4 18:01:05 2017 +0800

----------------------------------------------------------------------
 .../ignite/cache/store/cassandra/session/CassandraSessionImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8cfacebf/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
index b2e5298..9e42477 100644
--- a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
+++ b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
@@ -307,7 +307,7 @@ public class CassandraSessionImpl implements CassandraSession {
                 if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx == null && error!=null)
                     return assistant.processedData();
 
-                if (tblAbsenceEx != null && CassandraHelper.isTableAbsenceError(error)) {
+                if (tblAbsenceEx != null) {
                     // If there are table absence error and it is not required for the operation we can return.
                     if (!assistant.tableExistenceRequired())
                         return assistant.processedData();


[4/5] ignite git commit: Merge branch 'patch-1' of https://github.com/sunnychanwork/ignite into ignite-rev

Posted by nt...@apache.org.
Merge branch 'patch-1' of https://github.com/sunnychanwork/ignite into ignite-rev


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/469e4e5b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/469e4e5b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/469e4e5b

Branch: refs/heads/ignite-6252
Commit: 469e4e5bbfa20fee1a81996f28e50774eb84a753
Parents: 94dd19d 9c9b375
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Oct 31 17:08:14 2017 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Oct 31 17:08:14 2017 +0300

----------------------------------------------------------------------
 .../cassandra/session/CassandraSessionImpl.java    | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[3/5] ignite git commit: Fix retrying logic

Posted by nt...@apache.org.
Fix retrying logic

Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9c9b375a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9c9b375a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9c9b375a

Branch: refs/heads/ignite-6252
Commit: 9c9b375a317755e1d063a59b16ec696fc9116070
Parents: 8cfaceb
Author: sunnychanwork <su...@users.noreply.github.com>
Authored: Thu Sep 7 10:10:20 2017 +0800
Committer: GitHub <no...@github.com>
Committed: Thu Sep 7 10:10:20 2017 +0800

----------------------------------------------------------------------
 .../cassandra/session/CassandraSessionImpl.java    | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9c9b375a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
index 9e42477..29bbab6 100644
--- a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
+++ b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
@@ -213,6 +213,7 @@ public class CassandraSessionImpl implements CassandraSession {
                 Throwable tblAbsenceEx = null;
                 Throwable hostsAvailEx = null;
                 Throwable prepStatEx = null;
+                boolean retry = false;
 
                 List<Cache.Entry<Integer, ResultSetFuture>> futResults = new LinkedList<>();
 
@@ -266,13 +267,19 @@ public class CassandraSessionImpl implements CassandraSession {
                     throw new IgniteException(errorMsg, unknownEx);
 
                 // Remembering any of last errors.
-                if (tblAbsenceEx != null)
+                if (tblAbsenceEx != null) {
+                    retry = true;
                     error = tblAbsenceEx;
-                else if (hostsAvailEx != null)
+                }
+                else if (hostsAvailEx != null) {
+                    retry = true;
                     error = hostsAvailEx;
-                else if (prepStatEx != null)
+                }
+                else if (prepStatEx != null) {
+                    retry = true;
                     error = prepStatEx;
-
+                }
+                
                 // Clean errors info before next communication with Cassandra.
                 unknownEx = null;
                 tblAbsenceEx = null;
@@ -304,7 +311,7 @@ public class CassandraSessionImpl implements CassandraSession {
                     throw new IgniteException(errorMsg, unknownEx);
 
                 // If there are no errors occurred it means that operation successfully completed and we can return.
-                if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx == null && error!=null)
+                if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx == null && !retry)
                     return assistant.processedData();
 
                 if (tblAbsenceEx != null) {