You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2017/07/21 14:05:36 UTC
[1/6] ignite git commit: IGNITE-4728 Web Console: Saved last
succeeded state and redirect to it on reload.
Repository: ignite
Updated Branches:
refs/heads/master 0adaf6e4a -> ca496f6e9
IGNITE-4728 Web Console: Saved last succeeded state and redirect to it on reload.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/70d0f991
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/70d0f991
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/70d0f991
Branch: refs/heads/master
Commit: 70d0f9918c708cb117e69163cc7b7c119c9a693c
Parents: 23f26af
Author: Dmitriy Shabalin <ds...@gridgain.com>
Authored: Thu Jul 20 15:08:20 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Thu Jul 20 15:08:20 2017 +0700
----------------------------------------------------------------------
modules/web-console/frontend/app/app.js | 14 ++++++++++++++
.../frontend/app/modules/states/errors.state.js | 6 ++++--
.../frontend/app/modules/states/signin.state.js | 10 +++++++++-
3 files changed, 27 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/70d0f991/modules/web-console/frontend/app/app.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/app.js b/modules/web-console/frontend/app/app.js
index c707810..dc5c6e9 100644
--- a/modules/web-console/frontend/app/app.js
+++ b/modules/web-console/frontend/app/app.js
@@ -289,6 +289,20 @@ angular
$root.$on('$stateChangeStart', () => {
_.forEach(angular.element('.modal'), (m) => angular.element(m).scope().$hide());
});
+
+ if (!$root.IgniteDemoMode) {
+ $root.$on('$stateChangeSuccess', (event, {name, unsaved}, params) => {
+ try {
+ if (unsaved)
+ localStorage.removeItem('lastStateChangeSuccess');
+ else
+ localStorage.setItem('lastStateChangeSuccess', JSON.stringify({name, params}));
+ }
+ catch (ignored) {
+ // No-op.
+ }
+ });
+ }
}])
.run(['$rootScope', '$http', '$state', 'IgniteMessages', 'User', 'IgniteNotebookData',
($root, $http, $state, Messages, User, Notebook) => { // eslint-disable-line no-shadow
http://git-wip-us.apache.org/repos/asf/ignite/blob/70d0f991/modules/web-console/frontend/app/modules/states/errors.state.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/errors.state.js b/modules/web-console/frontend/app/modules/states/errors.state.js
index e816ff8..e3d4d41 100644
--- a/modules/web-console/frontend/app/modules/states/errors.state.js
+++ b/modules/web-console/frontend/app/modules/states/errors.state.js
@@ -31,13 +31,15 @@ angular
templateUrl: templateNotFoundPage,
metaTags: {
title: 'Page not found'
- }
+ },
+ unsaved: true
})
.state('403', {
url: '/403',
templateUrl: templateNotAuthorizedPage,
metaTags: {
title: 'Not authorized'
- }
+ },
+ unsaved: true
});
}]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/70d0f991/modules/web-console/frontend/app/modules/states/signin.state.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/states/signin.state.js b/modules/web-console/frontend/app/modules/states/signin.state.js
index 5155bde..b7be51d 100644
--- a/modules/web-console/frontend/app/modules/states/signin.state.js
+++ b/modules/web-console/frontend/app/modules/states/signin.state.js
@@ -33,7 +33,15 @@ angular
resolve: {
user: ['$state', 'User', ($state, User) => {
return User.read()
- .then(() => $state.go('base.configuration.tabs'))
+ .then(() => {
+ try {
+ const {name, params} = JSON.parse(localStorage.getItem('lastStateChangeSuccess'));
+
+ $state.go(name, params);
+ } catch (ignored) {
+ $state.go('base.configuration.tabs');
+ }
+ })
.catch(() => {});
}]
},
[3/6] ignite git commit: IGNITE-5752 Fixed updateSequence updating in
GridDhtPartitionMap. - Fixes #2297.
Posted by pt...@apache.org.
IGNITE-5752 Fixed updateSequence updating in GridDhtPartitionMap. - Fixes #2297.
Signed-off-by: Alexey Goncharuk <al...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/199b9543
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/199b9543
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/199b9543
Branch: refs/heads/master
Commit: 199b954345f179851718acd131188506668cd4f3
Parents: 02a1bdc
Author: Pavel Kovalenko <jo...@gmail.com>
Authored: Fri Jul 21 16:29:15 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Fri Jul 21 16:29:15 2017 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/preloader/GridDhtPartitionMap.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/199b9543/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
index cfd4400..735ca1e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionMap.java
@@ -24,7 +24,6 @@ import java.io.ObjectOutput;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
-
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
@@ -202,9 +201,13 @@ public class GridDhtPartitionMap implements Comparable<GridDhtPartitionMap>, Ext
* @return Old update sequence value.
*/
public long updateSequence(long updateSeq, AffinityTopologyVersion topVer) {
+ assert topVer.compareTo(top) >= 0 : "Invalid topology version [cur=" + top + ", new=" + topVer + "]";
+
long old = this.updateSeq;
- assert updateSeq >= old : "Invalid update sequence [cur=" + old + ", new=" + updateSeq + ']';
+ // Overwrite update sequence without checking in case of greater topology version
+ if (topVer.compareTo(top) == 0)
+ assert updateSeq >= old : "Invalid update sequence [cur=" + old + ", new=" + updateSeq + ']';
this.updateSeq = updateSeq;
[4/6] ignite git commit: IGNITE-5772 - Fixed race between WAL segment
rollover and a concurrent log. Closes #2313
Posted by pt...@apache.org.
IGNITE-5772 - Fixed race between WAL segment rollover and a concurrent log. Closes #2313
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6de0571c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6de0571c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6de0571c
Branch: refs/heads/master
Commit: 6de0571c21ffdb77af7bb1d18e9659126d7f321b
Parents: 199b954
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Fri Jul 21 16:35:43 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Fri Jul 21 16:35:43 2017 +0300
----------------------------------------------------------------------
.../wal/FileWriteAheadLogManager.java | 93 +++++++++++++-------
1 file changed, 61 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/6de0571c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
index 897f903..b655ddf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
@@ -319,7 +319,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
try {
if (mode == WALMode.BACKGROUND) {
if (currHnd != null)
- currHnd.flush((FileWALPointer)null);
+ currHnd.flush((FileWALPointer)null, true);
}
if (currHnd != null)
@@ -526,7 +526,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
return;
if (mode == WALMode.LOG_ONLY || forceFlush) {
- cur.flushOrWait(filePtr);
+ cur.flushOrWait(filePtr, false);
return;
}
@@ -535,7 +535,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
if (filePtr != null && !cur.needFsync(filePtr))
return;
- cur.fsync(filePtr);
+ cur.fsync(filePtr, false);
}
/** {@inheritDoc} */
@@ -1700,12 +1700,29 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
this.maxSegmentSize = maxSegmentSize;
this.serializer = serializer;
- head.set(new FakeRecord(new FileWALPointer(idx, (int)pos, 0)));
+ head.set(new FakeRecord(new FileWALPointer(idx, (int)pos, 0), false));
written = pos;
lastFsyncPos = pos;
}
/**
+ * Checks if current head is a close fake record and returns {@code true} if so.
+ *
+ * @return {@code true} if current head is close record.
+ */
+ private boolean stopped() {
+ return stopped(head.get());
+ }
+
+ /**
+ * @param record Record to check.
+ * @return {@code true} if the record is fake close record.
+ */
+ private boolean stopped(WALRecord record) {
+ return record instanceof FakeRecord && ((FakeRecord)record).stop;
+ }
+
+ /**
* @param rec Record to be added to record chain as new {@link #head}
* @return Pointer or null if roll over to next segment is required or already started by other thread.
* @throws StorageException If failed.
@@ -1721,9 +1738,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
long nextPos = nextPosition(h);
- // It is important that we read `stop` after `head` in this loop for correct close,
- // because otherwise we will have a race on the last flush in close.
- if (nextPos + rec.size() >= maxSegmentSize || stop.get()) {
+ if (nextPos + rec.size() >= maxSegmentSize || stopped(h)) {
// Can not write to this segment, need to switch to the next one.
return null;
}
@@ -1731,7 +1746,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
int newChainSize = h.chainSize() + rec.size();
if (newChainSize > tlbSize && !flushed) {
- boolean res = h.previous() == null || flush(h);
+ boolean res = h.previous() == null || flush(h, false);
if (rec.size() > tlbSize)
flushed = res;
@@ -1770,7 +1785,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
* @param ptr Pointer.
* @throws IgniteCheckedException If failed.
*/
- private void flushOrWait(FileWALPointer ptr) throws IgniteCheckedException {
+ private void flushOrWait(FileWALPointer ptr, boolean stop) throws IgniteCheckedException {
long expWritten;
if (ptr != null) {
@@ -1783,7 +1798,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
else // We read head position before the flush because otherwise we can get wrong position.
expWritten = recordOffset(head.get());
- if (flush(ptr))
+ if (flush(ptr, stop))
return;
// Spin-wait for a while before acquiring the lock.
@@ -1810,18 +1825,20 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
* @throws IgniteCheckedException If failed.
* @throws StorageException If failed.
*/
- private boolean flush(FileWALPointer ptr) throws IgniteCheckedException, StorageException {
+ private boolean flush(FileWALPointer ptr, boolean stop) throws IgniteCheckedException, StorageException {
if (ptr == null) { // Unconditional flush.
for (; ; ) {
WALRecord expHead = head.get();
if (expHead.previous() == null) {
- assert expHead instanceof FakeRecord;
+ FakeRecord frHead = (FakeRecord)expHead;
- return false;
+ if (frHead.stop == stop || frHead.stop ||
+ head.compareAndSet(expHead, new FakeRecord(frHead.position(), stop)))
+ return false;
}
- if (flush(expHead))
+ if (flush(expHead, stop))
return true;
}
}
@@ -1835,7 +1852,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
if (chainBeginPosition(h) > ptr.fileOffset())
return false;
- if (flush(h))
+ if (flush(h, stop))
return true; // We are lucky.
}
}
@@ -1853,17 +1870,18 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
* @throws IgniteCheckedException If failed.
* @throws StorageException If failed.
*/
- private boolean flush(WALRecord expHead) throws StorageException, IgniteCheckedException {
+ private boolean flush(WALRecord expHead, boolean stop) throws StorageException, IgniteCheckedException {
if (expHead.previous() == null) {
- assert expHead instanceof FakeRecord;
+ FakeRecord frHead = (FakeRecord)expHead;
- return false;
+ if (stop == frHead.stop)
+ return false;
}
// Fail-fast before CAS.
checkEnvironment();
- if (!head.compareAndSet(expHead, new FakeRecord(new FileWALPointer(idx, (int)nextPosition(expHead), 0))))
+ if (!head.compareAndSet(expHead, new FakeRecord(new FileWALPointer(idx, (int)nextPosition(expHead), 0), stop)))
return false;
// At this point we grabbed the piece of WAL chain.
@@ -1976,7 +1994,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
* @param ptr Pointer to sync.
* @throws StorageException If failed.
*/
- private void fsync(FileWALPointer ptr) throws StorageException, IgniteCheckedException {
+ private void fsync(FileWALPointer ptr, boolean stop) throws StorageException, IgniteCheckedException {
lock.lock();
try {
@@ -1984,7 +2002,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
if (!needFsync(ptr))
return;
- if (fsyncDelay > 0 && !stop.get()) {
+ if (fsyncDelay > 0 && !stopped()) {
// Delay fsync to collect as many updates as possible: trade latency for throughput.
U.await(fsync, fsyncDelay, TimeUnit.NANOSECONDS);
@@ -1993,7 +2011,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
}
}
- flushOrWait(ptr);
+ flushOrWait(ptr, stop);
if (lastFsyncPos != written) {
assert lastFsyncPos < written; // Fsync position must be behind.
@@ -2031,13 +2049,14 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
* @throws StorageException If failed.
*/
private boolean close(boolean rollOver) throws IgniteCheckedException, StorageException {
- if (stop.compareAndSet(false, true)) {
- // Here we can be sure that no other records will be added and this fsync will be the last.
- if (mode == WALMode.DEFAULT)
- fsync(null);
- else
- flushOrWait(null);
+ if (mode == WALMode.DEFAULT)
+ fsync(null, true);
+ else
+ flushOrWait(null, true);
+
+ assert stopped() : "Segment is not closed after close flush: " + head.get();
+ if (stop.compareAndSet(false, true)) {
try {
int switchSegmentRecSize = RecordV1Serializer.REC_TYPE_SIZE + RecordV1Serializer.FILE_WAL_POINTER_SIZE;
@@ -2068,8 +2087,8 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
return true;
}
-
- return false;
+ else
+ return false;
}
/**
@@ -2271,17 +2290,27 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
* Fake record is allowed to have no previous record.
*/
private static final class FakeRecord extends WALRecord {
+ /** */
+ private final boolean stop;
+
/**
* @param pos Position.
*/
- FakeRecord(FileWALPointer pos) {
+ FakeRecord(FileWALPointer pos, boolean stop) {
position(pos);
+
+ this.stop = stop;
}
/** {@inheritDoc} */
@Override public RecordType type() {
return null;
}
+
+ /** {@inheritDoc} */
+ @Override public FileWALPointer position() {
+ return (FileWALPointer) super.position();
+ }
}
/**
@@ -2492,7 +2521,7 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
private void doFlush() {
final FileWriteHandle hnd = currentHandle();
try {
- hnd.flush(hnd.head.get());
+ hnd.flush(hnd.head.get(), false);
}
catch (Exception e) {
U.warn(log, "Failed to flush WAL record queue", e);
[2/6] ignite git commit: IGNITE-5788 Web Console: Fixed dependencies
for maven project with c3p0.
Posted by pt...@apache.org.
IGNITE-5788 Web Console: Fixed dependencies for maven project with c3p0.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/02a1bdca
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/02a1bdca
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/02a1bdca
Branch: refs/heads/master
Commit: 02a1bdca57ce6af7fe7636b0a9f99048c89b88b6
Parents: 70d0f99
Author: Andrey Novikov <an...@gridgain.com>
Authored: Thu Jul 20 15:47:49 2017 +0700
Committer: Andrey Novikov <an...@gridgain.com>
Committed: Thu Jul 20 15:47:49 2017 +0700
----------------------------------------------------------------------
modules/web-console/frontend/app/data/pom-dependencies.json | 5 ++++-
.../app/modules/configuration/generator/Maven.service.js | 9 +++------
modules/web-console/frontend/webpack/webpack.common.js | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/02a1bdca/modules/web-console/frontend/app/data/pom-dependencies.json
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/data/pom-dependencies.json b/modules/web-console/frontend/app/data/pom-dependencies.json
index 945e3f5..8d3fa81 100644
--- a/modules/web-console/frontend/app/data/pom-dependencies.json
+++ b/modules/web-console/frontend/app/data/pom-dependencies.json
@@ -11,7 +11,10 @@
"HadoopIgfsJcl": {"artifactId": "ignite-hadoop"},
"SLF4J": {"artifactId": "ignite-slf4j"},
- "Generic": {"groupId": "com.mchange", "artifactId": "c3p0", "version": "0.9.5.2"},
+ "Generic": [
+ {"groupId": "com.mchange", "artifactId": "c3p0", "version": "0.9.5.2"},
+ {"groupId": "com.mchange", "artifactId": "mchange-commons-java", "version": "0.2.11"}
+ ],
"MySQL": {"groupId": "mysql", "artifactId": "mysql-connector-java", "version": "5.1.40"},
"PostgreSQL": {"groupId": "org.postgresql", "artifactId": "postgresql", "version": "9.4.1212.jre7"},
"H2": {"groupId": "com.h2database", "artifactId": "h2", "version": [
http://git-wip-us.apache.org/repos/asf/ignite/blob/02a1bdca/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js b/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
index 81d7d10..abbada9 100644
--- a/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
+++ b/modules/web-console/frontend/app/modules/configuration/generator/Maven.service.js
@@ -47,12 +47,9 @@ export default class IgniteMavenGenerator {
return _.isArray(version) ? _.find(version, (v) => versionService.since(igniteVer, v.range)).version : version;
};
- if (!_.has(POM_DEPENDENCIES, key))
- return;
-
- const {groupId, artifactId, version, jar} = POM_DEPENDENCIES[key];
-
- this.addDependency(deps, groupId || 'org.apache.ignite', artifactId, extractVersion(version) || dfltVer, jar);
+ _.forEach(POM_DEPENDENCIES[key], ({groupId, artifactId, version, jar}) => {
+ this.addDependency(deps, groupId || 'org.apache.ignite', artifactId, extractVersion(version) || dfltVer, jar);
+ });
}
addResource(sb, dir, exclude) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/02a1bdca/modules/web-console/frontend/webpack/webpack.common.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/webpack/webpack.common.js b/modules/web-console/frontend/webpack/webpack.common.js
index a303d6e..5a3763e 100644
--- a/modules/web-console/frontend/webpack/webpack.common.js
+++ b/modules/web-console/frontend/webpack/webpack.common.js
@@ -138,7 +138,7 @@ export default {
},
{
test: /\.(jpe?g|png|gif)$/i,
- loader: 'file?name=assets/images/[name]_[hash].[ext]'
+ loader: 'file?name=assets/images/[name].[hash].[ext]'
},
{
test: require.resolve('jquery'),
@@ -178,7 +178,7 @@ export default {
new HtmlWebpackPlugin({
template: './views/index.pug'
}),
- new ExtractTextPlugin({filename: 'assets/css/[name].css', allChunks: true}),
+ new ExtractTextPlugin({filename: 'assets/css/[name].[hash].css', allChunks: true}),
new CopyWebpackPlugin([
{ context: 'public', from: '**/*.png' },
{ context: 'public', from: '**/*.svg' },
[6/6] ignite git commit: Merge branch 'ignite-2.1.3'
Posted by pt...@apache.org.
Merge branch 'ignite-2.1.3'
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ca496f6e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ca496f6e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ca496f6e
Branch: refs/heads/master
Commit: ca496f6e9e48a107abb72a4fea87b5b11da66806
Parents: 0adaf6e c1a3b37
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Jul 21 17:05:10 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Jul 21 17:05:10 2017 +0300
----------------------------------------------------------------------
.../dht/preloader/GridDhtPartitionMap.java | 7 +-
.../wal/FileWriteAheadLogManager.java | 93 +++++++++++++-------
.../dotnet/PlatformDotNetCacheStore.java | 31 +++++++
.../Apache.Ignite.Core.Tests.csproj | 5 ++
.../Cache/Store/CacheStoreSessionTest.cs | 90 +++++++++++++------
.../Store/CacheStoreSessionTestCodeConfig.cs | 68 ++++++++++++++
.../Store/CacheStoreSessionTestSharedFactory.cs | 48 ++++++++++
.../Cache/Store/CacheStoreTest.cs | 10 ++-
.../cache-store-session-shared-factory.xml | 76 ++++++++++++++++
.../Config/Cache/Store/cache-store-session.xml | 20 ++---
.../Impl/Cache/Store/CacheStoreInternal.cs | 14 ++-
modules/web-console/frontend/app/app.js | 14 +++
.../frontend/app/data/pom-dependencies.json | 5 +-
.../configuration/generator/Maven.service.js | 9 +-
.../frontend/app/modules/states/errors.state.js | 6 +-
.../frontend/app/modules/states/signin.state.js | 10 ++-
.../frontend/webpack/webpack.common.js | 4 +-
17 files changed, 422 insertions(+), 88 deletions(-)
----------------------------------------------------------------------
[5/6] ignite git commit: IGNITE-5786 .NET: Fix cache store session
handling for cross-cache transactions
Posted by pt...@apache.org.
IGNITE-5786 .NET: Fix cache store session handling for cross-cache transactions
This closes #2331
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c1a3b374
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c1a3b374
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c1a3b374
Branch: refs/heads/master
Commit: c1a3b3744f89e27906621e62e9d73281791fcf30
Parents: 6de0571
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Jul 21 17:04:39 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Jul 21 17:04:39 2017 +0300
----------------------------------------------------------------------
.../dotnet/PlatformDotNetCacheStore.java | 31 +++++++
.../Apache.Ignite.Core.Tests.csproj | 5 ++
.../Cache/Store/CacheStoreSessionTest.cs | 90 +++++++++++++-------
.../Store/CacheStoreSessionTestCodeConfig.cs | 68 +++++++++++++++
.../Store/CacheStoreSessionTestSharedFactory.cs | 48 +++++++++++
.../Cache/Store/CacheStoreTest.cs | 10 ++-
.../cache-store-session-shared-factory.xml | 76 +++++++++++++++++
.../Config/Cache/Store/cache-store-session.xml | 20 ++---
.../Impl/Cache/Store/CacheStoreInternal.cs | 14 ++-
9 files changed, 320 insertions(+), 42 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
index dd61a54..471eb01 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
@@ -47,6 +47,7 @@ import javax.cache.integration.CacheLoaderException;
import javax.cache.integration.CacheWriterException;
import java.util.Collection;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
/**
@@ -90,6 +91,9 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K, V>, Platfor
/** Key used to distinguish session deployment. */
private static final Object KEY_SES = new Object();
+ /** Key to designate a set of stores that share current session. */
+ private static final Object KEY_SES_STORES = new Object();
+
/** */
@CacheStoreSessionResource
private CacheStoreSession ses;
@@ -337,6 +341,23 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K, V>, Platfor
writer.writeLong(session());
writer.writeString(ses.cacheName());
writer.writeBoolean(commit);
+
+ // When multiple stores (caches) participate in a single transaction,
+ // they share a single session, but sessionEnd is called on each store.
+ // Same thing happens on platform side: session is shared; each store must be notified,
+ // then session should be closed.
+ Collection<Long> stores = (Collection<Long>) ses.properties().get(KEY_SES_STORES);
+ assert stores != null;
+
+ stores.remove(ptr);
+ boolean last = stores.isEmpty();
+
+ writer.writeBoolean(last);
+
+ if (last) {
+ // Session object has been released on platform side, remove marker.
+ ses.properties().remove(KEY_SES);
+ }
}
}, null);
}
@@ -415,6 +436,16 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K, V>, Platfor
ses.properties().put(KEY_SES, sesPtr);
}
+ // Keep track of all stores that use current session (cross-cache tx uses single session for all caches).
+ Collection<Long> stores = (Collection<Long>) ses.properties().get(KEY_SES_STORES);
+
+ if (stores == null) {
+ stores = new HashSet<>();
+ ses.properties().put(KEY_SES_STORES, stores);
+ }
+
+ stores.add(ptr);
+
return sesPtr;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
index 90b7970..e4f65bc 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj
@@ -89,6 +89,8 @@
<Compile Include="Cache\Query\Linq\CacheLinqTest.Misc.cs" />
<Compile Include="Cache\Query\Linq\CacheLinqTest.Custom.cs" />
<Compile Include="Cache\Query\Linq\CacheLinqTest.Contains.cs" />
+ <Compile Include="Cache\Store\CacheStoreSessionTestCodeConfig.cs" />
+ <Compile Include="Cache\Store\CacheStoreSessionTestSharedFactory.cs" />
<Compile Include="Deployment\CacheGetFunc.cs" />
<Compile Include="Deployment\GetAddressFunc.cs" />
<Compile Include="Deployment\PeerAssemblyLoadingAllApisTest.cs" />
@@ -314,6 +316,9 @@
<Content Include="Config\Cache\Affinity\affinity-function.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="Config\Cache\Store\cache-store-session-shared-factory.xml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="Config\Cache\Store\cache-store-session.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs
index 315e285..818948c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs
@@ -28,16 +28,13 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
/// <summary>
/// Tests for store session.
/// </summary>
- public sealed class CacheStoreSessionTest
+ public class CacheStoreSessionTest
{
- /** Grid name. */
- private const string IgniteName = "grid";
-
/** Cache 1 name. */
- private const string Cache1 = "cache1";
+ protected const string Cache1 = "cache1";
/** Cache 2 name. */
- private const string Cache2 = "cache2";
+ protected const string Cache2 = "cache2";
/** Operations. */
private static ConcurrentBag<ICollection<Operation>> _dumps;
@@ -48,11 +45,26 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
[TestFixtureSetUp]
public void BeforeTests()
{
- Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration())
+ Ignition.Start(GetIgniteConfiguration());
+ }
+
+ /// <summary>
+ /// Gets the ignite configuration.
+ /// </summary>
+ protected virtual IgniteConfiguration GetIgniteConfiguration()
+ {
+ return new IgniteConfiguration(TestUtils.GetTestConfiguration())
{
- IgniteInstanceName = IgniteName,
SpringConfigUrl = @"config\cache\store\cache-store-session.xml"
- });
+ };
+ }
+
+ /// <summary>
+ /// Gets the store count.
+ /// </summary>
+ protected virtual int StoreCount
+ {
+ get { return 2; }
}
/// <summary>
@@ -61,21 +73,29 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
[TestFixtureTearDown]
public void AfterTests()
{
- Ignition.StopAll(true);
+ try
+ {
+ TestUtils.AssertHandleRegistryHasItems(Ignition.GetIgnite(), 2, 1000);
+ }
+ finally
+ {
+ Ignition.StopAll(true);
+ }
}
/// <summary>
/// Test basic session API.
/// </summary>
[Test]
+ [Timeout(30000)]
public void TestSession()
{
_dumps = new ConcurrentBag<ICollection<Operation>>();
- var ignite = Ignition.GetIgnite(IgniteName);
+ var ignite = Ignition.GetIgnite();
- var cache1 = Ignition.GetIgnite(IgniteName).GetCache<int, int>(Cache1);
- var cache2 = Ignition.GetIgnite(IgniteName).GetCache<int, int>(Cache2);
+ var cache1 = ignite.GetCache<int, int>(Cache1);
+ var cache2 = ignite.GetCache<int, int>(Cache2);
// 1. Test rollback.
using (var tx = ignite.GetTransactions().TxStart())
@@ -86,11 +106,15 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
tx.Rollback();
}
- Assert.AreEqual(1, _dumps.Count);
- var ops = _dumps.First();
- Assert.AreEqual(1, ops.Count);
+ // SessionEnd is called once per store instance.
+ Assert.AreEqual(StoreCount, _dumps.Count);
- Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.SesEnd && !op.Commit));
+ foreach (var ops in _dumps)
+ {
+ var op = ops.Single();
+ Assert.AreEqual(OperationType.SesEnd, op.Type);
+ Assert.IsFalse(op.Commit);
+ }
_dumps = new ConcurrentBag<ICollection<Operation>>();
@@ -103,13 +127,17 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
tx.Commit();
}
- Assert.AreEqual(1, _dumps.Count);
- ops = _dumps.First();
- Assert.AreEqual(3, ops.Count);
+ Assert.AreEqual(StoreCount, _dumps.Count);
- Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.Write && Cache1.Equals(op.CacheName) && 1.Equals(op.Key) && 1.Equals(op.Value)));
- Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.Write && Cache2.Equals(op.CacheName) && 2.Equals(op.Key) && 2.Equals(op.Value)));
- Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.SesEnd && op.Commit));
+ foreach (var ops in _dumps)
+ {
+ Assert.AreEqual(2 + StoreCount, ops.Count);
+ Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.Write
+ && Cache1 == op.CacheName && 1 == op.Key && 1 == op.Value));
+ Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.Write
+ && Cache2 == op.CacheName && 2 == op.Key && 2 == op.Value));
+ Assert.AreEqual(StoreCount, ops.Count(op => op.Type == OperationType.SesEnd && op.Commit));
+ }
_dumps = new ConcurrentBag<ICollection<Operation>>();
@@ -122,13 +150,17 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
tx.Commit();
}
- Assert.AreEqual(1, _dumps.Count);
- ops = _dumps.First();
- Assert.AreEqual(3, ops.Count);
+ Assert.AreEqual(StoreCount, _dumps.Count);
+ foreach (var ops in _dumps)
+ {
+ Assert.AreEqual(2 + StoreCount, ops.Count);
- Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.Delete && Cache1.Equals(op.CacheName) && 1.Equals(op.Key)));
- Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.Delete && Cache2.Equals(op.CacheName) && 2.Equals(op.Key)));
- Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.SesEnd && op.Commit));
+ Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.Delete
+ && Cache1 == op.CacheName && 1 == op.Key));
+ Assert.AreEqual(1, ops.Count(op => op.Type == OperationType.Delete
+ && Cache2 == op.CacheName && 2 == op.Key));
+ Assert.AreEqual(StoreCount, ops.Count(op => op.Type == OperationType.SesEnd && op.Commit));
+ }
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTestCodeConfig.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTestCodeConfig.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTestCodeConfig.cs
new file mode 100644
index 0000000..0b5f474
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTestCodeConfig.cs
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Apache.Ignite.Core.Tests.Cache.Store
+{
+ using Apache.Ignite.Core.Cache.Configuration;
+ using Apache.Ignite.Core.Cache.Store;
+ using Apache.Ignite.Core.Common;
+ using NUnit.Framework;
+
+ /// <summary>
+ /// Tests store session with programmatic configuration (uses different store factory on Java side).
+ /// </summary>
+ [TestFixture]
+ public class CacheStoreSessionTestCodeConfig : CacheStoreSessionTest
+ {
+ /** <inheritdoc /> */
+ protected override IgniteConfiguration GetIgniteConfiguration()
+ {
+ return new IgniteConfiguration(TestUtils.GetTestConfiguration())
+ {
+ CacheConfiguration = new[]
+ {
+ new CacheConfiguration(Cache1)
+ {
+ AtomicityMode = CacheAtomicityMode.Transactional,
+ ReadThrough = true,
+ WriteThrough = true,
+ CacheStoreFactory = new StoreFactory()
+ },
+ new CacheConfiguration(Cache2)
+ {
+ AtomicityMode = CacheAtomicityMode.Transactional,
+ ReadThrough = true,
+ WriteThrough = true,
+ CacheStoreFactory = new StoreFactory()
+ }
+ }
+ };
+ }
+
+ /// <summary>
+ /// Store factory.
+ /// </summary>
+ private class StoreFactory : IFactory<ICacheStore>
+ {
+ /** <inheritdoc /> */
+ public ICacheStore CreateInstance()
+ {
+ return new Store();
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTestSharedFactory.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTestSharedFactory.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTestSharedFactory.cs
new file mode 100644
index 0000000..2af5915
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTestSharedFactory.cs
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Apache.Ignite.Core.Tests.Cache.Store
+{
+ using NUnit.Framework;
+
+ /// <summary>
+ /// Session test with shared PlatformDotNetCacheStoreFactory,
+ /// which causes the same store insance to be used for both caches.
+ /// </summary>
+ [TestFixture]
+ public class CacheStoreSessionTestSharedFactory : CacheStoreSessionTest
+ {
+ /** <inheritdoc /> */
+ protected override IgniteConfiguration GetIgniteConfiguration()
+ {
+ return new IgniteConfiguration(TestUtils.GetTestConfiguration())
+ {
+ SpringConfigUrl = @"config\cache\store\cache-store-session-shared-factory.xml"
+ };
+ }
+
+ /** <inheritdoc /> */
+ protected override int StoreCount
+ {
+ get
+ {
+ // Shared PlatformDotNetCacheStoreFactory results in a single store instance.
+ return 1;
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs
index e05f4bd..d3e4ab6 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreTest.cs
@@ -64,7 +64,15 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
[TestFixtureTearDown]
public void AfterTests()
{
- Ignition.StopAll(true);
+ try
+ {
+ // 3 stores are expected in HandleRegistry.
+ TestUtils.AssertHandleRegistryHasItems(Ignition.GetIgnite(), 3, 1000);
+ }
+ finally
+ {
+ Ignition.StopAll(true);
+ }
}
/// <summary>
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session-shared-factory.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session-shared-factory.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session-shared-factory.xml
new file mode 100644
index 0000000..05515c4
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session-shared-factory.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util.xsd">
+ <bean id="storeFactory" class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
+ <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheStoreSessionTest+Store, Apache.Ignite.Core.Tests"/>
+ </bean>
+
+ <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="localHost" value="127.0.0.1"/>
+ <property name="connectorConfiguration"><null/></property>
+
+ <property name="cacheConfiguration">
+ <list>
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="cache1"/>
+ <property name="cacheMode" value="LOCAL"/>
+ <property name="atomicityMode" value="TRANSACTIONAL"/>
+ <property name="writeThrough" value="true"/>
+ <property name="readThrough" value="true"/>
+
+ <property name="cacheStoreFactory" ref="storeFactory" />
+ </bean>
+
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="cache2"/>
+ <property name="cacheMode" value="LOCAL"/>
+ <property name="atomicityMode" value="TRANSACTIONAL"/>
+ <property name="writeThrough" value="true"/>
+ <property name="readThrough" value="true"/>
+
+ <property name="cacheStoreFactory" ref="storeFactory" />
+ </bean>
+ </list>
+ </property>
+
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="ipFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+ <property name="addresses">
+ <list>
+ <!-- In distributed environment, replace with actual host IP address. -->
+ <value>127.0.0.1:47500</value>
+ </list>
+ </property>
+ </bean>
+ </property>
+ <property name="socketTimeout" value="300" />
+ </bean>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
index 3cc9efa..14dc78e 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
@@ -25,18 +25,10 @@
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
- <bean id="storeFactory" class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
- <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheStoreSessionTest+Store, Apache.Ignite.Core.Tests"/>
- </bean>
-
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="localHost" value="127.0.0.1"/>
<property name="connectorConfiguration"><null/></property>
- <property name="includeEventTypes">
- <util:constant static-field="org.apache.ignite.events.EventType.EVTS_CACHE"/>
- </property>
-
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
@@ -46,7 +38,11 @@
<property name="writeThrough" value="true"/>
<property name="readThrough" value="true"/>
- <property name="cacheStoreFactory" ref="storeFactory" />
+ <property name="cacheStoreFactory">
+ <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
+ <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheStoreSessionTest+Store, Apache.Ignite.Core.Tests"/>
+ </bean>
+ </property>
</bean>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
@@ -56,7 +52,11 @@
<property name="writeThrough" value="true"/>
<property name="readThrough" value="true"/>
- <property name="cacheStoreFactory" ref="storeFactory" />
+ <property name="cacheStoreFactory">
+ <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
+ <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheStoreSessionTest+Store, Apache.Ignite.Core.Tests"/>
+ </bean>
+ </property>
</bean>
</list>
</property>
http://git-wip-us.apache.org/repos/asf/ignite/blob/c1a3b374/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStoreInternal.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStoreInternal.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStoreInternal.cs
index f147579..df4c1ae 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStoreInternal.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStoreInternal.cs
@@ -111,6 +111,8 @@ namespace Apache.Ignite.Core.Impl.Cache.Store
CacheStoreSession ses = grid.HandleRegistry.Get<CacheStoreSession>(sesId, true);
+ // Session cache name may change in cross-cache transaction.
+ // Single session is used for all stores in cross-cache transactions.
ses.CacheName = rawReader.ReadString();
_sesProxy.SetSession(ses);
@@ -223,11 +225,19 @@ namespace Apache.Ignite.Core.Impl.Cache.Store
break;
case OpSesEnd:
- grid.HandleRegistry.Release(sesId);
+ {
+ var commit = rawReader.ReadBoolean();
+ var last = rawReader.ReadBoolean();
- _store.SessionEnd(rawReader.ReadBoolean());
+ if (last)
+ {
+ grid.HandleRegistry.Release(sesId);
+ }
+
+ _store.SessionEnd(commit);
break;
+ }
default:
throw new IgniteException("Invalid operation type: " + opType);