ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: fixed recovery
Date Sun, 11 Sep 2016 20:28:46 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-comm-opts1 6700f93e9 -> deb4979c3


fixed recovery


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

Branch: refs/heads/ignite-comm-opts1
Commit: deb4979c37e9ee5d73b370313333a5aca0d1c067
Parents: 6700f93
Author: sboikov <sboikov@gridgain.com>
Authored: Sun Sep 11 23:08:46 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Sun Sep 11 23:24:57 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/nio/GridNioServer.java     | 16 ++++++++--------
 .../spi/communication/tcp/TcpCommunicationSpi.java  |  5 +++++
 .../GridTcpCommunicationSpiRecoverySelfTest.java    |  6 +++---
 3 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/deb4979c/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index 32cca7b..450c2a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -1909,9 +1909,10 @@ public class GridNioServer<T> {
                 // Since ses is in closed state, no write requests will be added.
                 NioOperationFuture<?> fut = ses.removeMeta(NIO_OPERATION.ordinal());
 
-                GridNioRecoveryDescriptor recovery = ses.outRecoveryDescriptor();
+                GridNioRecoveryDescriptor outRecovery = ses.outRecoveryDescriptor();
+                GridNioRecoveryDescriptor inRecovery = ses.inRecoveryDescriptor();
 
-                if (recovery != null) {
+                if (outRecovery != null || inRecovery != null) {
                     try {
                         // Poll will update recovery data.
                         while ((fut = (NioOperationFuture<?>)ses.pollFuture()) != null)
{
@@ -1920,7 +1921,11 @@ public class GridNioServer<T> {
                         }
                     }
                     finally {
-                        recovery.release();
+                        if (outRecovery != null)
+                            outRecovery.release();
+
+                        if (inRecovery != null && inRecovery != outRecovery)
+                            inRecovery.release();
                     }
                 }
                 else {
@@ -1931,11 +1936,6 @@ public class GridNioServer<T> {
                         fut.connectionClosed();
                 }
 
-                GridNioRecoveryDescriptor inRecovery = ses.inRecoveryDescriptor();
-
-                if (inRecovery != null && inRecovery != recovery)
-                    inRecovery.release();
-
                 try {
                     filterChain.onSessionClosed(ses);
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/deb4979c/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index f9a8d9c..e99b899 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -732,6 +732,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
 
                         nioSrvr.sendSystem(ses, new RecoveryLastReceivedMessage(recoveryDesc.received()),
lsnr);
                     }
+                    else
+                        nioSrvr.sendSystem(ses, new RecoveryLastReceivedMessage(-1));
                 }
             }
 
@@ -3271,6 +3273,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                 long idleTime = client.getIdleTime();
 
                 if (idleTime >= idleConnTimeout) {
+                    if (recovery == null && useTwoConnections(node))
+                        recovery = outRecDescs.get(new ClientKey(node.id(), node.order()));
+
                     if (recovery != null &&
                         recovery.nodeAlive(getSpiContext().node(nodeId)) &&
                         !recovery.messagesFutures().isEmpty()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/deb4979c/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
index be6ed0c..d2b0ecd 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
@@ -307,7 +307,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
 
                     IgniteInternalFuture<?> sndFut = GridTestUtils.runAsync(new Callable<Void>()
{
                         @Override public Void call() throws Exception {
-                            for (int i = 0; i < 5000; i++) {
+                            for (int i = 0; i < 6000; i++) {
                                 spi0.sendMessage(node1, new GridTestMessage(node0.id(), msgId.incrementAndGet(),
0));
 
                                 sentCnt.incrementAndGet();
@@ -417,7 +417,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
 
                     IgniteInternalFuture<?> sndFut = GridTestUtils.runAsync(new Callable<Void>()
{
                         @Override public Void call() throws Exception {
-                            for (int i = 0; i < 5000; i++) {
+                            for (int i = 0; i < 6000; i++) {
                                 spi0.sendMessage(node1, new GridTestMessage(node0.id(), msgId.incrementAndGet(),
0));
 
                                 expCnt1.incrementAndGet();
@@ -534,7 +534,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
 
                     IgniteInternalFuture<?> sndFut = GridTestUtils.runAsync(new Callable<Void>()
{
                         @Override public Void call() throws Exception {
-                            for (int i = 0; i < 5000; i++) {
+                            for (int i = 0; i < 6000; i++) {
                                 spi0.sendMessage(node1, new GridTestMessage(node0.id(), msgId.incrementAndGet(),
0));
 
                                 sentCnt.incrementAndGet();


Mime
View raw message