anton-vinogradov commented on a change in pull request #7852:
URL: https://github.com/apache/ignite/pull/7852#discussion_r433077180
##########
File path:
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccConfigurationValidationTest.java
##########
@@ -322,6 +325,33 @@ public void testTransactionalSnapshotLimitations() throws
Exception {
);
}
+ /**
+ * Check that node in client mode (filtered by AttributeNodeFilter)
correctly works with MVCC.
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testMvccEnabledForClientMode() throws Exception {
+ String attrName = "has_cache";
+ Object attrVal = Boolean.TRUE;
+
+ final IgniteEx crd = (IgniteEx)
startGrid(getTestIgniteInstanceName(0), getConfiguration());
+
+ // Do not start cache on non-affinity node.
+ CacheConfiguration ccfg = defaultCacheConfiguration()
Review comment:
Do we really need to specify near, backups, and atomicity mode here?
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
##########
@@ -1350,6 +1350,9 @@ else if (!crd && grp != null &&
grp.localStartVersion().equals(fut.initialVersio
Collection<DynamicCacheDescriptor> descs
) throws IgniteCheckedException {
IgniteInternalFuture<?> res = cachesRegistry.addUnregistered(descs);
+ for (DynamicCacheDescriptor d: descs) {
Review comment:
newline required before "for"
see
https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-SemanticUnits
for details
##########
File path:
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccConfigurationValidationTest.java
##########
@@ -322,6 +325,33 @@ public void testTransactionalSnapshotLimitations() throws
Exception {
);
}
+ /**
+ * Check that node in client mode (filtered by AttributeNodeFilter)
correctly works with MVCC.
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testMvccEnabledForClientMode() throws Exception {
+ String attrName = "has_cache";
+ Object attrVal = Boolean.TRUE;
+
+ final IgniteEx crd = (IgniteEx)
startGrid(getTestIgniteInstanceName(0), getConfiguration());
+
+ // Do not start cache on non-affinity node.
+ CacheConfiguration ccfg = defaultCacheConfiguration()
+ .setNearConfiguration(null)
+ .setNodeFilter(new AttributeNodeFilter(attrName, attrVal))
+ .setBackups(0)
+ .setAtomicityMode(TRANSACTIONAL_SNAPSHOT);
+
+ final Ignite node = startGrid(getTestIgniteInstanceName(1),
getConfiguration()
+ .setCacheConfiguration(ccfg)
+ .setUserAttributes(F.asMap(attrName, attrVal)));
+
+ checkTopology(2);
+
+ assertTrue(crd.context().coordinators().mvccEnabled());
Review comment:
The better case is to check every node.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]