You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2018/01/24 15:01:46 UTC
[01/11] ignite git commit: IGNITE-7500 Set clear flag on last supply
message - Fixes #3421. [Forced Update!]
Repository: ignite
Updated Branches:
refs/heads/ignite-6643 ca877b434 -> 38a488313 (forced update)
IGNITE-7500 Set clear flag on last supply message - Fixes #3421.
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/fb5b6134
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fb5b6134
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fb5b6134
Branch: refs/heads/ignite-6643
Commit: fb5b61347e74b7ee4d50e71d92470897446cefe2
Parents: 5216ac5
Author: Pavel Kovalenko <jo...@gmail.com>
Authored: Tue Jan 23 17:30:41 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Jan 23 17:33:52 2018 +0300
----------------------------------------------------------------------
.../dht/preloader/GridDhtPartitionSupplier.java | 10 +-
...idCacheRebalancingPartitionCountersTest.java | 178 +++++++++++++++++++
.../testsuites/IgniteCacheTestSuite3.java | 2 +
3 files changed, 185 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fb5b6134/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
index 6eb31ed..7194b24 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionSupplier.java
@@ -30,9 +30,9 @@ import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.cache.CacheGroupContext;
import org.apache.ignite.internal.processors.cache.GridCacheEntryInfo;
import org.apache.ignite.internal.processors.cache.IgniteRebalanceIterator;
-import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
+import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
import org.apache.ignite.internal.util.lang.GridCloseableIterator;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.T3;
@@ -303,11 +303,8 @@ class GridDhtPartitionSupplier {
iter = grp.offheap().rebalanceIterator(part, d.topologyVersion(),
d.isHistorical(part) ? d.partitionCounter(part) : null);
- if (!iter.historical()) {
+ if (!iter.historical())
assert !grp.persistenceEnabled() || !d.isHistorical(part);
-
- s.clean(part);
- }
else
assert grp.persistenceEnabled() && d.isHistorical(part);
}
@@ -416,6 +413,9 @@ class GridDhtPartitionSupplier {
// Mark as last supply message.
s.last(part, loc.updateCounter());
+ if (!d.isHistorical(part))
+ s.clean(part);
+
phase = SupplyContextPhase.NEW;
sctx = null;
http://git-wip-us.apache.org/repos/asf/ignite/blob/fb5b6134/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionCountersTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionCountersTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionCountersTest.java
new file mode 100644
index 0000000..0676c45
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/rebalancing/GridCacheRebalancingPartitionCountersTest.java
@@ -0,0 +1,178 @@
+/*
+ * 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.
+ */
+package org.apache.ignite.internal.processors.cache.distributed.rebalancing;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.cache.CacheGroupContext;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class GridCacheRebalancingPartitionCountersTest extends GridCommonAbstractTest {
+ /** */
+ private static final String CACHE_NAME = "cache";
+
+ /** */
+ private static final int PARTITIONS_CNT = 10;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ return super.getConfiguration(igniteInstanceName)
+ .setConsistentId(igniteInstanceName)
+ .setDataStorageConfiguration(
+ new DataStorageConfiguration()
+ .setCheckpointFrequency(3_000)
+ .setDefaultDataRegionConfiguration(
+ new DataRegionConfiguration()
+ .setPersistenceEnabled(true)
+ .setMaxSize(100L * 1024 * 1024)))
+ .setCacheConfiguration(new CacheConfiguration(CACHE_NAME)
+ .setBackups(2)
+ .setRebalanceBatchSize(4096) // Force to create several supply messages during rebalancing.
+ .setAffinity(
+ new RendezvousAffinityFunction(false, PARTITIONS_CNT)));
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ stopAllGrids();
+ deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
+ }
+
+ /**
+ *
+ */
+ private boolean contains(int[] arr, int a) {
+ for (int i : arr)
+ if (i == a)
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Tests that after rebalancing all partition update counters have the same value on all nodes.
+ */
+ public void test() throws Exception {
+ IgniteEx ignite = (IgniteEx)startGrids(3);
+
+ ignite.active(true);
+
+ IgniteCache cache = ignite.cache(CACHE_NAME);
+
+ for (int i = 0; i < 256; i++)
+ cache.put(i, i);
+
+ final int problemNode = 2;
+
+ IgniteEx node = (IgniteEx) ignite(problemNode);
+ int[] primaryPartitions = node.affinity(CACHE_NAME).primaryPartitions(node.cluster().localNode());
+
+ ignite.active(false);
+
+ boolean primaryRemoved = false;
+ for (int i = 0; i < PARTITIONS_CNT; i++) {
+ String nodeName = getTestIgniteInstanceName(problemNode);
+
+ Path dirPath = Paths.get(U.defaultWorkDirectory(), "db", nodeName.replace(".", "_"), CACHE_NAME + "-" + CACHE_NAME);
+
+ info("Path: " + dirPath.toString());
+
+ assertTrue(Files.exists(dirPath));
+
+ for (File f : dirPath.toFile().listFiles()) {
+ if (f.getName().equals("part-" + i + ".bin")) {
+ if (contains(primaryPartitions, i)) {
+ info("Removing: " + f.getName());
+
+ primaryRemoved = true;
+
+ f.delete();
+ }
+ }
+ else if (f.getName().equals("index.bin")) {
+ info("Removing: " + f.getName());
+
+ f.delete();
+ }
+ }
+ }
+
+ assertTrue(primaryRemoved);
+
+ ignite.active(true);
+ waitForRebalancing();
+
+ List<String> issues = new ArrayList<>();
+ HashMap<Integer, Long> partMap = new HashMap<>();
+
+ for (int i = 0; i < 3; i++)
+ checkUpdCounter((IgniteEx)ignite(i), issues, partMap);
+
+ for (String issue : issues)
+ error(issue);
+
+ assertTrue(issues.isEmpty());
+ }
+
+ /**
+ *
+ */
+ private void checkUpdCounter(IgniteEx ignite, List<String> issues, HashMap<Integer, Long> partMap) {
+ final CacheGroupContext grpCtx = ignite.context().cache().cacheGroup(CU.cacheId(CACHE_NAME));
+
+ assertNotNull(grpCtx);
+
+ GridDhtPartitionTopologyImpl top = (GridDhtPartitionTopologyImpl)grpCtx.topology();
+
+ List<GridDhtLocalPartition> locParts = top.localPartitions();
+
+ for (GridDhtLocalPartition part : locParts) {
+ Long cnt = partMap.get(part.id());
+
+ if (cnt == null)
+ partMap.put(part.id(), part.updateCounter());
+
+ if ((cnt != null && part.updateCounter() != cnt) || part.updateCounter() == 0)
+ issues.add("Node name " + ignite.name() + "Part = " + part.id() + " updCounter " + part.updateCounter());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fb5b6134/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
index a6be07e..674b6a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite3.java
@@ -52,6 +52,7 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridCachePut
import org.apache.ignite.internal.processors.cache.distributed.near.IgniteTxReentryNearSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRabalancingDelayedPartitionMapExchangeSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRebalancingAsyncSelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRebalancingPartitionCountersTest;
import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRebalancingSyncCheckDataTest;
import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRebalancingSyncSelfTest;
import org.apache.ignite.internal.processors.cache.distributed.rebalancing.GridCacheRebalancingUnmarshallingFailedSelfTest;
@@ -146,6 +147,7 @@ public class IgniteCacheTestSuite3 extends TestSuite {
suite.addTestSuite(GridCacheRebalancingUnmarshallingFailedSelfTest.class);
suite.addTestSuite(GridCacheRebalancingAsyncSelfTest.class);
suite.addTestSuite(GridCacheRabalancingDelayedPartitionMapExchangeSelfTest.class);
+ suite.addTestSuite(GridCacheRebalancingPartitionCountersTest.class);
// Test for byte array value special case.
suite.addTestSuite(GridCacheLocalByteArrayValuesSelfTest.class);
[09/11] ignite git commit: IGNITE-7443: Native batching for ODBC.
This closes #3422.
Posted by ag...@apache.org.
IGNITE-7443: Native batching for ODBC. This closes #3422.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4c4d70ef
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4c4d70ef
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4c4d70ef
Branch: refs/heads/ignite-6643
Commit: 4c4d70ef4de3cd34d19ae2fcdf890612efd5c23b
Parents: 992b025
Author: Igor Sapego <ig...@gmail.com>
Authored: Wed Jan 24 15:58:34 2018 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Wed Jan 24 15:58:34 2018 +0300
----------------------------------------------------------------------
.../odbc/odbc/OdbcRequestHandler.java | 77 +++++++++++---------
.../cpp/odbc-test/src/odbc_test_suite.cpp | 27 +++++--
.../cpp/odbc-test/src/sql_get_info_test.cpp | 2 +-
.../include/ignite/odbc/app/parameter_set.h | 26 ++++++-
.../cpp/odbc/include/ignite/odbc/message.h | 12 ---
.../cpp/odbc/src/app/parameter_set.cpp | 21 +++++-
.../cpp/odbc/src/config/connection_info.cpp | 2 +-
modules/platforms/cpp/odbc/src/connection.cpp | 8 ++
modules/platforms/cpp/odbc/src/message.cpp | 4 +-
.../cpp/odbc/src/query/batch_query.cpp | 13 +++-
modules/platforms/cpp/odbc/src/statement.cpp | 18 +++++
11 files changed, 149 insertions(+), 61 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java
index 4ce99e3..3d5d7f2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java
@@ -17,11 +17,11 @@
package org.apache.ignite.internal.processors.odbc.odbc;
+import java.sql.BatchUpdateException;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.Types;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -30,22 +30,21 @@ import java.util.concurrent.atomic.AtomicLong;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.cache.query.FieldsQueryCursor;
-import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.binary.BinaryWriterExImpl;
import org.apache.ignite.internal.binary.GridBinaryMarshaller;
import org.apache.ignite.internal.processors.cache.query.SqlFieldsQueryEx;
-import org.apache.ignite.internal.processors.cache.QueryCursorImpl;
import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
import org.apache.ignite.internal.processors.odbc.ClientListenerRequest;
import org.apache.ignite.internal.processors.odbc.ClientListenerRequestHandler;
import org.apache.ignite.internal.processors.odbc.ClientListenerResponse;
import org.apache.ignite.internal.processors.odbc.odbc.escape.OdbcEscapeUtils;
-import org.apache.ignite.internal.processors.query.GridQueryIndexing;
import org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor;
+import org.apache.ignite.internal.processors.query.IgniteSQLException;
import org.apache.ignite.internal.util.GridSpinBusyLock;
import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.U;
import static org.apache.ignite.internal.processors.odbc.odbc.OdbcRequest.META_COLS;
@@ -278,9 +277,6 @@ public class OdbcRequestHandler implements ClientListenerRequestHandler {
* @return Response.
*/
private ClientListenerResponse executeBatchQuery(OdbcQueryExecuteBatchRequest req) {
- List<Long> rowsAffected = new ArrayList<>(req.arguments().length);
- int currentSet = 0;
-
try {
String sql = OdbcEscapeUtils.parse(req.sqlQuery());
@@ -288,7 +284,7 @@ public class OdbcRequestHandler implements ClientListenerRequestHandler {
log.debug("ODBC query parsed [reqId=" + req.requestId() + ", original=" + req.sqlQuery() +
", parsed=" + sql + ']');
- SqlFieldsQuery qry = makeQuery(req.schema(), sql, req.arguments(), req.timeout());
+ SqlFieldsQueryEx qry = makeQuery(req.schema(), sql, null, req.timeout());
Object[][] paramSet = req.arguments();
@@ -297,19 +293,16 @@ public class OdbcRequestHandler implements ClientListenerRequestHandler {
+ paramSet.length + ']');
// Getting meta and do the checks for the first execution.
- qry.setArgs(paramSet[0]);
-
- QueryCursorImpl<List<?>> qryCur = (QueryCursorImpl<List<?>>)ctx.query()
- .querySqlFields(qry, true, true).get(0);
+ for (Object[] set : paramSet)
+ qry.addBatchedArgs(set);
- if (qryCur.isQuery())
- throw new IgniteException("Batching of parameters only supported for DML statements. [query=" +
- req.sqlQuery() + ']');
+ List<FieldsQueryCursor<List<?>>> qryCurs =
+ ctx.query().querySqlFields(qry, true, true);
- rowsAffected.add(OdbcUtils.rowsAffected(qryCur));
+ List<Long> rowsAffected = new ArrayList<>(req.arguments().length);
- for (currentSet = 1; currentSet < paramSet.length; ++currentSet)
- rowsAffected.add(executeQuery(qry, paramSet[currentSet]));
+ for (FieldsQueryCursor<List<?>> qryCur : qryCurs)
+ rowsAffected.add(OdbcUtils.rowsAffected(qryCur));
OdbcQueryExecuteBatchResult res = new OdbcQueryExecuteBatchResult(rowsAffected);
@@ -318,25 +311,11 @@ public class OdbcRequestHandler implements ClientListenerRequestHandler {
catch (Exception e) {
U.error(log, "Failed to execute SQL query [reqId=" + req.requestId() + ", req=" + req + ']', e);
- return exceptionToBatchResult(e, rowsAffected, currentSet);
+ return exceptionToBatchResult(e);
}
}
/**
- * Execute query.
- * @param qry Query
- * @param row Row
- * @return Affected rows.
- */
- private long executeQuery(SqlFieldsQuery qry, Object[] row) {
- qry.setArgs(row);
-
- QueryCursor<List<?>> cur = ctx.query().querySqlFields(qry, true, true).get(0);
-
- return OdbcUtils.rowsAffected(cur);
- }
-
- /**
* {@link OdbcQueryCloseRequest} command handler.
*
* @param req Execute query request.
@@ -658,9 +637,35 @@ public class OdbcRequestHandler implements ClientListenerRequestHandler {
* @param e Exception to convert.
* @return resulting {@link OdbcResponse}.
*/
- private OdbcResponse exceptionToBatchResult(Exception e, Collection<Long> rowsAffected, long currentSet) {
- OdbcQueryExecuteBatchResult res = new OdbcQueryExecuteBatchResult(rowsAffected, currentSet,
- OdbcUtils.tryRetrieveSqlErrorCode(e), OdbcUtils.tryRetrieveH2ErrorMessage(e));
+ private OdbcResponse exceptionToBatchResult(Exception e) {
+ int code;
+ String msg;
+ List<Long> rowsAffected = new ArrayList<>();
+
+ if (e instanceof IgniteSQLException) {
+ BatchUpdateException batchCause = X.cause(e, BatchUpdateException.class);
+
+ if (batchCause != null) {
+ for (long cnt : batchCause.getLargeUpdateCounts())
+ rowsAffected.add(cnt);
+
+ msg = batchCause.getMessage();
+
+ code = batchCause.getErrorCode();
+ }
+ else {
+ msg = OdbcUtils.tryRetrieveH2ErrorMessage(e);
+
+ code = ((IgniteSQLException)e).statusCode();
+ }
+ }
+ else {
+ msg = e.getMessage();
+
+ code = IgniteQueryErrorCode.UNKNOWN;
+ }
+
+ OdbcQueryExecuteBatchResult res = new OdbcQueryExecuteBatchResult(rowsAffected, -1, code, msg);
return new OdbcResponse(res);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc-test/src/odbc_test_suite.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/odbc_test_suite.cpp b/modules/platforms/cpp/odbc-test/src/odbc_test_suite.cpp
index a967b4f..970c77d 100644
--- a/modules/platforms/cpp/odbc-test/src/odbc_test_suite.cpp
+++ b/modules/platforms/cpp/odbc-test/src/odbc_test_suite.cpp
@@ -463,21 +463,38 @@ namespace ignite
{
Connect("DRIVER={Apache Ignite};ADDRESS=127.0.0.1:11110;SCHEMA=cache");
+ std::vector<SQLUSMALLINT> statuses(recordsNum, 42);
+
+ // Binding statuses array.
+ SQLRETURN ret = SQLSetStmtAttr(stmt, SQL_ATTR_PARAM_STATUS_PTR, &statuses[0], 0);
+
+ if (!SQL_SUCCEEDED(ret))
+ BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+
// Inserting values.
- int inserted = InsertTestBatch(splitAt, recordsNum, recordsNum - splitAt);
+ int setsProcessed = InsertTestBatch(splitAt, recordsNum, recordsNum - splitAt);
- BOOST_REQUIRE_EQUAL(inserted, recordsNum - splitAt);
+ BOOST_REQUIRE_EQUAL(setsProcessed, recordsNum - splitAt);
- inserted = InsertTestBatch(0, recordsNum, splitAt);
+ for (int i = 0; i < recordsNum - splitAt; ++i)
+ BOOST_REQUIRE_EQUAL(statuses[i], SQL_PARAM_SUCCESS);
- BOOST_REQUIRE_EQUAL(inserted, splitAt);
+ setsProcessed = InsertTestBatch(0, recordsNum, splitAt);
+
+ BOOST_REQUIRE_EQUAL(setsProcessed, recordsNum);
+
+ for (int i = 0; i < splitAt; ++i)
+ BOOST_REQUIRE_EQUAL(statuses[i], SQL_PARAM_SUCCESS);
+
+ for (int i = splitAt; i < recordsNum; ++i)
+ BOOST_REQUIRE_EQUAL(statuses[i], SQL_PARAM_ERROR);
int64_t key = 0;
char strField[1024] = {0};
SQLLEN strFieldLen = 0;
// Binding columns.
- SQLRETURN ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &key, 0, 0);
+ ret = SQLBindCol(stmt, 1, SQL_C_SLONG, &key, 0, 0);
if (!SQL_SUCCEEDED(ret))
BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc-test/src/sql_get_info_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/sql_get_info_test.cpp b/modules/platforms/cpp/odbc-test/src/sql_get_info_test.cpp
index ad1236c..f303e2c 100644
--- a/modules/platforms/cpp/odbc-test/src/sql_get_info_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/sql_get_info_test.cpp
@@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE(TestValues)
CheckIntInfo(SQL_SQL92_VALUE_EXPRESSIONS, SQL_SVE_CASE | SQL_SVE_CAST | SQL_SVE_COALESCE | SQL_SVE_NULLIF);
CheckIntInfo(SQL_STATIC_CURSOR_ATTRIBUTES1, SQL_CA1_NEXT);
CheckIntInfo(SQL_STATIC_CURSOR_ATTRIBUTES2, 0);
- CheckIntInfo(SQL_PARAM_ARRAY_ROW_COUNTS, SQL_PARC_NO_BATCH);
+ CheckIntInfo(SQL_PARAM_ARRAY_ROW_COUNTS, SQL_PARC_BATCH);
CheckIntInfo(SQL_PARAM_ARRAY_SELECTS, SQL_PAS_NO_SELECT);
CheckIntInfo(SQL_SCROLL_OPTIONS, SQL_SO_FORWARD_ONLY | SQL_SO_STATIC);
CheckIntInfo(SQL_ALTER_DOMAIN, 0);
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc/include/ignite/odbc/app/parameter_set.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/app/parameter_set.h b/modules/platforms/cpp/odbc/include/ignite/odbc/app/parameter_set.h
index 2ab5580..e30622d 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/app/parameter_set.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/app/parameter_set.h
@@ -225,7 +225,28 @@ namespace ignite
*
* @return Pointer to write number of parameters processed in batch.
*/
- SqlUlen* GetParamsProcessedPtr();
+ SqlUlen* GetParamsProcessedPtr() const;
+
+ /**
+ * Set pointer to array in which to return the status of each
+ * set of parameters.
+ * @param value Value.
+ */
+ void SetParamsStatusPtr(SQLUSMALLINT* value);
+
+ /**
+ * Get pointer to array in which to return the status of each
+ * set of parameters.
+ * @return Value.
+ */
+ SQLUSMALLINT* GetParamsStatusPtr() const;
+
+ /**
+ * Set parameter status.
+ * @param idx Parameter index.
+ * @param status Status to set.
+ */
+ void SetParamStatus(int64_t idx, SQLUSMALLINT status) const;
private:
/**
@@ -249,6 +270,9 @@ namespace ignite
/** Processed parameters. */
SqlUlen* processedParamRows;
+ /** Parameters status. */
+ SQLUSMALLINT* paramsStatus;
+
/** Parameter set size. */
SqlUlen paramSetSize;
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/message.h b/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
index 51c0b41..af03262 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/message.h
@@ -677,15 +677,6 @@ namespace ignite
}
/**
- * Get index of the set which caused an error.
- * @return Index of the set which caused an error.
- */
- int64_t GetErrorSetIdx() const
- {
- return static_cast<int64_t>(affectedRows.size());
- }
-
- /**
* Get error message.
* @return Error message.
*/
@@ -714,9 +705,6 @@ namespace ignite
/** Affected rows. */
std::vector<int64_t> affectedRows;
- /** Index of the set which caused an error. */
- int64_t errorSetIdx;
-
/** Error message. */
std::string errorMessage;
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc/src/app/parameter_set.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/app/parameter_set.cpp b/modules/platforms/cpp/odbc/src/app/parameter_set.cpp
index c110d05..55dd332 100644
--- a/modules/platforms/cpp/odbc/src/app/parameter_set.cpp
+++ b/modules/platforms/cpp/odbc/src/app/parameter_set.cpp
@@ -27,6 +27,7 @@ namespace ignite
parameters(),
paramTypes(),
paramBindOffset(0),
+ paramsStatus(0),
processedParamRows(0),
paramSetSize(1),
paramSetPos(0),
@@ -99,11 +100,29 @@ namespace ignite
processedParamRows = ptr;
}
- SqlUlen* ParameterSet::GetParamsProcessedPtr()
+ SqlUlen* ParameterSet::GetParamsProcessedPtr() const
{
return processedParamRows;
}
+ void ParameterSet::SetParamsStatusPtr(SQLUSMALLINT* value)
+ {
+ paramsStatus = value;
+ }
+
+ SQLUSMALLINT* ParameterSet::GetParamsStatusPtr() const
+ {
+ return paramsStatus;
+ }
+
+ void ParameterSet::SetParamStatus(int64_t idx, SQLUSMALLINT status) const
+ {
+ if (idx < 0 || !paramsStatus || idx >= static_cast<int64_t>(paramSetSize))
+ return;
+
+ paramsStatus[idx] = status;
+ }
+
void ParameterSet::SetParamsProcessed(SqlUlen processed) const
{
if (processedParamRows)
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc/src/config/connection_info.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/config/connection_info.cpp b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
index 0f8e50b..a70121d 100644
--- a/modules/platforms/cpp/odbc/src/config/connection_info.cpp
+++ b/modules/platforms/cpp/odbc/src/config/connection_info.cpp
@@ -1273,7 +1273,7 @@ namespace ignite
// resulting from the execution of the statement for the entire array of parameters. This is
// conceptually equivalent to treating the statement together with the complete parameter array as
// one atomic unit. Errors are handled the same as if one statement were executed.
- intParams[SQL_PARAM_ARRAY_ROW_COUNTS] = SQL_PARC_NO_BATCH;
+ intParams[SQL_PARAM_ARRAY_ROW_COUNTS] = SQL_PARC_BATCH;
#endif // SQL_PARAM_ARRAY_ROW_COUNTS
#ifdef SQL_PARAM_ARRAY_SELECTS
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/connection.cpp b/modules/platforms/cpp/odbc/src/connection.cpp
index 8b03876..4e8f4ab 100644
--- a/modules/platforms/cpp/odbc/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/src/connection.cpp
@@ -29,6 +29,9 @@
#include "ignite/odbc/message.h"
#include "ignite/odbc/config/configuration.h"
+// Uncomment for per-byte debug.
+//#define PER_BYTE_DEBUG
+
namespace
{
#pragma pack(push, 1)
@@ -39,6 +42,7 @@ namespace
#pragma pack(pop)
}
+
namespace ignite
{
namespace odbc
@@ -218,7 +222,9 @@ namespace ignite
if (res == OperationResult::FAIL)
throw OdbcError(SqlState::S08S01_LINK_FAILURE, "Can not send message due to connection failure");
+#ifdef PER_BYTE_DEBUG
LOG_MSG("message sent: (" << msg.GetSize() << " bytes)" << utility::HexDump(msg.GetData(), msg.GetSize()));
+#endif //PER_BYTE_DEBUG
return true;
}
@@ -285,7 +291,9 @@ namespace ignite
if (res == OperationResult::FAIL)
throw OdbcError(SqlState::S08S01_LINK_FAILURE, "Can not receive message body");
+#ifdef PER_BYTE_DEBUG
LOG_MSG("Message received: " << utility::HexDump(&msg[0], msg.size()));
+#endif //PER_BYTE_DEBUG
return true;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc/src/message.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/message.cpp b/modules/platforms/cpp/odbc/src/message.cpp
index 57b7210..93fc6bb 100644
--- a/modules/platforms/cpp/odbc/src/message.cpp
+++ b/modules/platforms/cpp/odbc/src/message.cpp
@@ -350,7 +350,6 @@ namespace ignite
QueryExecuteBatchResponse::QueryExecuteBatchResponse():
affectedRows(0),
- errorSetIdx(-1),
errorMessage(),
errorCode(1)
{
@@ -370,7 +369,8 @@ namespace ignite
if (!success)
{
- errorSetIdx = reader.ReadInt64();
+ // Ignoring error set idx. To be deleted in next major version.
+ reader.ReadInt64();
errorMessage = reader.ReadObject<std::string>();
if (ver >= ProtocolVersion::VERSION_2_1_5)
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc/src/query/batch_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/query/batch_query.cpp b/modules/platforms/cpp/odbc/src/query/batch_query.cpp
index a9db8d8..235daf8 100644
--- a/modules/platforms/cpp/odbc/src/query/batch_query.cpp
+++ b/modules/platforms/cpp/odbc/src/query/batch_query.cpp
@@ -72,7 +72,7 @@ namespace ignite
res = MakeRequestExecuteBatch(processed, processed + currentPageSize, lastPage);
processed += currentPageSize;
- } while (res == SqlResult::AI_SUCCESS && processed < rowNum);
+ } while ((res == SqlResult::AI_SUCCESS || res == SqlResult::AI_SUCCESS_WITH_INFO) && processed < rowNum);
params.SetParamsProcessed(static_cast<SqlUlen>(rowsAffected.size()));
@@ -187,7 +187,16 @@ namespace ignite
return SqlResult::AI_ERROR;
}
- rowsAffected.insert(rowsAffected.end(), rsp.GetAffectedRows().begin(), rsp.GetAffectedRows().end());
+ const std::vector<int64_t>& rowsLastTime = rsp.GetAffectedRows();
+
+ for (size_t i = 0; i < rowsLastTime.size(); ++i)
+ {
+ int64_t idx = static_cast<int64_t>(i + rowsAffected.size());
+
+ params.SetParamStatus(idx, rowsLastTime[i] < 0 ? SQL_PARAM_ERROR : SQL_PARAM_SUCCESS);
+ }
+
+ rowsAffected.insert(rowsAffected.end(), rowsLastTime.begin(), rowsLastTime.end());
LOG_MSG("Affected rows list size: " << rowsAffected.size());
if (!rsp.GetErrorMessage().empty())
http://git-wip-us.apache.org/repos/asf/ignite/blob/4c4d70ef/modules/platforms/cpp/odbc/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/statement.cpp b/modules/platforms/cpp/odbc/src/statement.cpp
index 898d44d..332487e 100644
--- a/modules/platforms/cpp/odbc/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/src/statement.cpp
@@ -285,6 +285,12 @@ namespace ignite
break;
}
+ case SQL_ATTR_PARAM_STATUS_PTR:
+ {
+ parameters.SetParamsStatusPtr(reinterpret_cast<SQLUSMALLINT*>(value));
+ break;
+ }
+
case SQL_ATTR_QUERY_TIMEOUT:
{
SqlUlen uTimeout = reinterpret_cast<SqlUlen>(value);
@@ -435,6 +441,18 @@ namespace ignite
break;
}
+ case SQL_ATTR_PARAM_STATUS_PTR:
+ {
+ SQLUSMALLINT** val = reinterpret_cast<SQLUSMALLINT**>(buf);
+
+ *val = parameters.GetParamsStatusPtr();
+
+ if (valueLen)
+ *valueLen = SQL_IS_POINTER;
+
+ break;
+ }
+
case SQL_ATTR_QUERY_TIMEOUT:
{
SqlUlen *uTimeout = reinterpret_cast<SqlUlen*>(buf);
[08/11] ignite git commit: Added check icon.
Posted by ag...@apache.org.
Added check icon.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/992b0250
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/992b0250
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/992b0250
Branch: refs/heads/ignite-6643
Commit: 992b0250a31b30e6a93aae714ef3bc1e43ca3156
Parents: d6585fa
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Wed Jan 24 19:24:01 2018 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Jan 24 19:24:01 2018 +0700
----------------------------------------------------------------------
.../frontend/public/images/icons/check.svg | 3 ++
.../frontend/public/images/icons/index.js | 1 +
.../frontend/public/stylesheets/style.scss | 33 ++++++++++++++++++++
3 files changed, 37 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/992b0250/modules/web-console/frontend/public/images/icons/check.svg
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/images/icons/check.svg b/modules/web-console/frontend/public/images/icons/check.svg
new file mode 100644
index 0000000..ed74764
--- /dev/null
+++ b/modules/web-console/frontend/public/images/icons/check.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="14" height="11" viewBox="0 0 14 11">
+ <path fill="#FFF" fill-rule="evenodd" d="M4.45 8.42L1.13 5.103 0 6.224l4.45 4.45L14 1.121 12.878 0 4.449 8.42"/>
+</svg>
http://git-wip-us.apache.org/repos/asf/ignite/blob/992b0250/modules/web-console/frontend/public/images/icons/index.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/images/icons/index.js b/modules/web-console/frontend/public/images/icons/index.js
index 48d9227..816ef1f 100644
--- a/modules/web-console/frontend/public/images/icons/index.js
+++ b/modules/web-console/frontend/public/images/icons/index.js
@@ -26,6 +26,7 @@ export search from './search.svg';
export refresh from './refresh.svg';
export sort from './sort.svg';
export info from './info.svg';
+export check from './check.svg';
export checkmark from './checkmark.svg';
export alert from './alert.svg';
export attention from './attention.svg';
http://git-wip-us.apache.org/repos/asf/ignite/blob/992b0250/modules/web-console/frontend/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/public/stylesheets/style.scss b/modules/web-console/frontend/public/stylesheets/style.scss
index 9d4cad9..baa49f8 100644
--- a/modules/web-console/frontend/public/stylesheets/style.scss
+++ b/modules/web-console/frontend/public/stylesheets/style.scss
@@ -2211,3 +2211,36 @@ html,body,.splash-screen {
margin-left: 5px;
}
}
+
+header.header-with-selector {
+ margin: 40px 0 30px;
+
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+
+
+ h1 {
+ height: 36px;
+ margin: 0;
+ margin-right: 8px;
+
+ font-family: Roboto, sans-serif;
+ font-size: 24px;
+ line-height: 36px;
+ }
+
+ div {
+ display: flex;
+ }
+
+ .btn-ignite + .btn-ignite-group {
+ position: relative;
+ margin-left: 20px;
+
+ ul.dropdown-menu {
+ min-width: 100%;
+ font-family: Roboto;
+ }
+ }
+}
[07/11] ignite git commit: IGNITE-7492 Visor CMD: Added output of
data region metrics to "node" command.
Posted by ag...@apache.org.
IGNITE-7492 Visor CMD: Added output of data region metrics to "node" command.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d6585fa2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d6585fa2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d6585fa2
Branch: refs/heads/ignite-6643
Commit: d6585fa2725f59b85640c5cb22da7a80a9d04f00
Parents: 09a94e8
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Wed Jan 24 18:55:44 2018 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Jan 24 18:55:44 2018 +0700
----------------------------------------------------------------------
.../org/apache/ignite/DataRegionMetrics.java | 2 +-
.../visor/cache/VisorMemoryMetrics.java | 74 +++++++++++
.../ignite/visor/commands/VisorConsole.scala | 20 ++-
.../visor/commands/common/VisorTextTable.scala | 22 ++--
.../visor/commands/node/VisorNodeCommand.scala | 123 ++++++++++++-------
5 files changed, 181 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/d6585fa2/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java b/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java
index f5ae96b..dc48f11 100644
--- a/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java
@@ -162,7 +162,7 @@ public interface DataRegionMetrics {
/**
* Gets memory page size.
*
- * @return page size in bytes.
+ * @return Page size in bytes.
*/
public int getPageSize();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/d6585fa2/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
index 37fed5a..c19fd36 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
@@ -59,6 +59,21 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
/** */
private long physicalMemoryPages;
+ /** */
+ private long totalAllocatedSz;
+
+ /** */
+ private long physicalMemSz;
+
+ /** */
+ private long cpBufPages;
+
+ /** */
+ private long cpBufSz;
+
+ /** */
+ private int pageSize;
+
/**
* Default constructor.
*/
@@ -79,6 +94,11 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
dirtyPages = m.getDirtyPages();
pagesReplaceRate = m.getPagesReplaceRate();
physicalMemoryPages = m.getPhysicalMemoryPages();
+ totalAllocatedSz = m.getTotalAllocatedSize();
+ physicalMemSz = m.getPhysicalMemorySize();
+ cpBufPages = m.getCheckpointBufferPages();
+ cpBufSz = m.getCheckpointBufferSize();
+ pageSize = m.getPageSize();
}
/**
@@ -144,6 +164,47 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
return physicalMemoryPages;
}
+
+ /**
+ * @return Total size of memory allocated, in bytes.
+ */
+ public long getTotalAllocatedSize() {
+ return totalAllocatedSz;
+ }
+
+ /**
+ * @return Total size of pages loaded to RAM in bytes.
+ */
+ public long getPhysicalMemorySize() {
+ return physicalMemSz;
+ }
+
+ /**
+ * @return Checkpoint buffer size in pages.
+ */
+ public long getCheckpointBufferPages() {
+ return cpBufPages;
+ }
+
+ /**
+ * @return @return Checkpoint buffer size in bytes.
+ */
+ public long getCheckpointBufferSize() {
+ return cpBufSz;
+ }
+
+ /**
+ * @return Page size in bytes.
+ */
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ /** {@inheritDoc} */
+ @Override public byte getProtocolVersion() {
+ return V2;
+ }
+
/** {@inheritDoc} */
@Override protected void writeExternalData(ObjectOutput out) throws IOException {
U.writeString(out, name);
@@ -155,6 +216,11 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
out.writeLong(dirtyPages);
out.writeFloat(pagesReplaceRate);
out.writeLong(physicalMemoryPages);
+ out.writeLong(totalAllocatedSz);
+ out.writeLong(physicalMemSz);
+ out.writeLong(cpBufPages);
+ out.writeLong(cpBufSz);
+ out.writeInt(pageSize);
}
/** {@inheritDoc} */
@@ -168,6 +234,14 @@ public class VisorMemoryMetrics extends VisorDataTransferObject {
dirtyPages = in.readLong();
pagesReplaceRate = in.readFloat();
physicalMemoryPages = in.readLong();
+
+ if (protoVer > V1) {
+ totalAllocatedSz = in.readLong();
+ physicalMemSz = in.readLong();
+ cpBufPages = in.readLong();
+ cpBufSz = in.readLong();
+ pageSize = in.readInt();
+ }
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/d6585fa2/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
index 8bf64b7..43e11db 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/VisorConsole.scala
@@ -170,13 +170,21 @@ class VisorConsole {
}
// Workaround for IDEA terminal.
- val term = try {
- Class.forName("com.intellij.rt.execution.application.AppMain")
+ val idea = Seq(
+ "com.intellij.rt.execution.application.AppMain",
+ "com.intellij.rt.execution.application.AppMainV2"
+ ).exists(cls =>
+ try {
+ Class.forName(cls)
+
+ true
+ }
+ catch {
+ case _: ClassNotFoundException => false
+ }
+ )
- new TerminalSupport(false) {}
- } catch {
- case _: ClassNotFoundException => null
- }
+ val term = if (idea) new TerminalSupport(false) {} else null
val reader = new ConsoleReader(inputStream, System.out, term)
http://git-wip-us.apache.org/repos/asf/ignite/blob/d6585fa2/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorTextTable.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorTextTable.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorTextTable.scala
index 58e3f21..6612ba4 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorTextTable.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorTextTable.scala
@@ -127,7 +127,7 @@ class VisorTextTable {
private val rows = collection.mutable.ArrayBuffer.empty[Seq[Cell]]
/** Current row, if any. */
- private var curRow: collection.mutable.ArrayBuffer[Cell] = null
+ private var curRow: collection.mutable.ArrayBuffer[Cell] = _
/** Table's margin, if any. */
private var margin: Margin = Margin()
@@ -146,7 +146,7 @@ class VisorTextTable {
/**
* Flag indicating whether of not to automatically draw horizontal lines
- * for multiline rows.
+ * for multi line rows.
*/
var autoBorder = true
@@ -276,7 +276,7 @@ class VisorTextTable {
*/
def addHeaderCell(lines: Any*): VisorTextTable = {
assert(lines != null)
- assert(lines.length > 0)
+ assert(lines.nonEmpty)
// Break up long line into multiple ones - if necessary.
val lst = lines flatten(_.toString.grouped(maxCellWidth))
@@ -400,7 +400,7 @@ class VisorTextTable {
var hdrH = 0
// Initialize column widths with header row (if any).
- for (i <- 0 until hdr.size) {
+ for (i <- hdr.indices) {
val c = hdr(i)
colWs(i) = c.width
@@ -409,7 +409,7 @@ class VisorTextTable {
}
// Calc row heights and column widths.
- for (i <- 0 until rows.length; j <- 0 until colsNum) {
+ for (i <- rows.indices; j <- 0 until colsNum) {
val c = rows(i)(j)
rowHs(i) = math.max(rowHs(i), c.height)
@@ -422,7 +422,7 @@ class VisorTextTable {
val tbl = new GridStringBuilder()
// Top margin.
- for (i <- 0 until margin.top)
+ for (_ <- 0 until margin.top)
tbl.a(" ").a(NL)
// Print header, if any.
@@ -433,7 +433,7 @@ class VisorTextTable {
// Left margin and '|'.
tbl.a(blank(margin.left)).a(HDR_VER)
- for (j <- 0 until hdr.size) {
+ for (j <- hdr.indices) {
val c = hdr(j)
if (i >= 0 && i < c.height)
@@ -459,14 +459,14 @@ class VisorTextTable {
// Left margin and '+'
tbl.a(blank(margin.left)).a(ROW_CRS)
- for (k <- 0 until rows(i).size)
+ for (k <- rows(i).indices)
tbl.a(dash(ROW_HOR, colWs(k))).a(ROW_CRS)
// Right margin.
tbl.a(blank(margin.right)).a(NL)
}
- for (i <- 0 until rows.size) {
+ for (i <- rows.indices) {
val r = rows(i)
val rowH = rowHs(i)
@@ -478,7 +478,7 @@ class VisorTextTable {
// Left margin and '|'
tbl.a(blank(margin.left)).a(ROW_VER)
- for (k <- 0 until r.size) {
+ for (k <- r.indices) {
val c = r(k)
val w = colWs(k)
@@ -502,7 +502,7 @@ class VisorTextTable {
}
// Bottom margin.
- for (i <- 1 to margin.bottom)
+ for (_ <- 1 to margin.bottom)
tbl.a(" ").a(NL)
print(tbl.toString)
http://git-wip-us.apache.org/repos/asf/ignite/blob/d6585fa2/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/VisorNodeCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/VisorNodeCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/VisorNodeCommand.scala
index b240aa5..6e1a339 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/VisorNodeCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/node/VisorNodeCommand.scala
@@ -17,22 +17,22 @@
package org.apache.ignite.visor.commands.node
+import java.util.UUID
+
import org.apache.ignite.cluster.ClusterNode
import org.apache.ignite.internal.IgniteNodeAttributes._
import org.apache.ignite.internal.util.lang.{GridFunc => F}
import org.apache.ignite.internal.util.scala.impl
import org.apache.ignite.internal.util.typedef.X
import org.apache.ignite.internal.util.{IgniteUtils => U}
+import org.apache.ignite.internal.visor.node.{VisorNodeDataCollectorTask, VisorNodeDataCollectorTaskArg}
+import org.apache.ignite.internal.visor.util.VisorTaskUtils._
import org.apache.ignite.visor.VisorTag
import org.apache.ignite.visor.commands.common.{VisorConsoleCommand, VisorTextTable}
import org.apache.ignite.visor.visor._
import org.jetbrains.annotations._
-import java.util.UUID
-
-import org.apache.ignite.internal.visor.util.VisorTaskUtils._
-
import scala.collection.JavaConversions._
import scala.language.{implicitConversions, reflectiveCalls}
import scala.util.control.Breaks._
@@ -105,6 +105,54 @@ class VisorNodeCommand extends VisorConsoleCommand {
}
}
+ private def printDataRegions(node: ClusterNode) {
+ val arg = new VisorNodeDataCollectorTaskArg(false, EVT_LAST_ORDER_KEY, EVT_THROTTLE_CNTR_KEY, false, false)
+
+ val res = executeMulti(Seq(node.id()), classOf[VisorNodeDataCollectorTask], arg)
+
+ val t = VisorTextTable()
+
+ t #= ("Name", "Page size", "Pages", "Memory", "Rates", "Checkpoint buffer", "Large entries")
+
+ val mm = res.getMemoryMetrics
+
+ mm.values().flatten.toSeq.sortBy(_.getName.toLowerCase).foreach(m => {
+ // Add row.
+ t += (
+ m.getName,
+ formatMemory(m.getPageSize),
+ (
+ "Total: " + formatNumber(m.getTotalAllocatedPages),
+ "Dirty: " + formatNumber(m.getDirtyPages),
+ "Memory: " + formatNumber(m.getPhysicalMemoryPages),
+ "Fill factor: " + formatDouble(m.getPagesFillFactor * 100) + "%"
+ ),
+ (
+ "Total: " + formatMemory(m.getTotalAllocatedSize),
+ "In RAM: " + formatMemory(m.getPhysicalMemorySize)
+ ),
+ (
+ "Allocation: " + formatDouble(m.getAllocationRate),
+ "Eviction: " + formatDouble(m.getEvictionRate),
+ "Replace: " + formatDouble(m.getPagesReplaceRate)
+ ),
+ (
+ "Pages: " + formatNumber(m.getCheckpointBufferPages),
+ "Size: " + formatMemory(m.getCheckpointBufferSize)
+ ),
+ formatDouble(m.getLargeEntriesPagesPercentage * 100) + "%"
+ )
+ })
+
+ nl()
+
+ println("Data region metrics:")
+
+ t.render()
+
+ nl()
+ }
+
/**
* ===Command===
* Prints full node information.
@@ -144,7 +192,7 @@ class VisorNodeCommand extends VisorConsoleCommand {
try
node = ignite.cluster.node(UUID.fromString(id.get))
catch {
- case e: IllegalArgumentException => warn("Invalid node ID: " + id.get).^^
+ case _: IllegalArgumentException => warn("Invalid node ID: " + id.get).^^
}
else
warn("Invalid arguments: " + args).^^
@@ -163,33 +211,38 @@ class VisorNodeCommand extends VisorConsoleCommand {
(0 /: sortAddresses(node.addresses))((b, a) => { t += ("Address (" + b + ")", a); b + 1 })
- val m = node.metrics
+ t += ("OS info", "" +
+ node.attribute("os.name") + " " +
+ node.attribute("os.arch") + " " +
+ node.attribute("os.version"))
- val igniteInstanceName: String = node.attribute(ATTR_IGNITE_INSTANCE_NAME)
+ t += ("OS user", node.attribute(ATTR_USER_NAME))
+ t += ("Deployment mode", node.attribute(ATTR_DEPLOYMENT_MODE))
+ t += ("Language runtime", node.attribute(ATTR_LANG_RUNTIME))
val ver = U.productVersion(node)
val verStr = ver.major() + "." + ver.minor() + "." + ver.maintenance() +
(if (F.isEmpty(ver.stage())) "" else "-" + ver.stage())
+ t += ("Ignite version", verStr)
+
+ val igniteInstanceName: String = node.attribute(ATTR_IGNITE_INSTANCE_NAME)
+
+ t += ("Ignite instance name", escapeName(igniteInstanceName))
+
+ t += ("JRE information", node.attribute(ATTR_JIT_NAME))
+
+ val m = node.metrics
+
+ t += ("JVM start time", formatDateTime(m.getStartTime))
+ t += ("Node start time", formatDateTime(m.getNodeStartTime))
+ t += ("Up time", X.timeSpan2HMSM(m.getUpTime))
+ t += ("CPUs", formatNumber(m.getTotalCpus))
+ t += ("Last metric update", formatDateTime(m.getLastUpdateTime))
+
if (all) {
- t += ("OS info", "" +
- node.attribute("os.name") + " " +
- node.attribute("os.arch") + " " +
- node.attribute("os.version")
- )
- t += ("OS user", node.attribute(ATTR_USER_NAME))
- t += ("Deployment mode", node.attribute(ATTR_DEPLOYMENT_MODE))
- t += ("Language runtime", node.attribute(ATTR_LANG_RUNTIME))
- t += ("Ignite version", verStr)
- t += ("JRE information", node.attribute(ATTR_JIT_NAME))
t += ("Non-loopback IPs", node.attribute(ATTR_IPS))
t += ("Enabled MACs", node.attribute(ATTR_MACS))
- t += ("Ignite instance name", escapeName(igniteInstanceName))
- t += ("JVM start time", formatDateTime(m.getStartTime))
- t += ("Node start time", formatDateTime(m.getNodeStartTime))
- t += ("Up time", X.timeSpan2HMSM(m.getUpTime))
- t += ("CPUs", formatNumber(m.getTotalCpus))
- t += ("Last metric update", formatDateTime(m.getLastUpdateTime))
t += ("Maximum active jobs", formatNumber(m.getMaximumActiveJobs))
t += ("Current active jobs", formatNumber(m.getCurrentActiveJobs))
t += ("Average active jobs", formatDouble(m.getAverageActiveJobs))
@@ -209,7 +262,7 @@ class VisorNodeCommand extends VisorConsoleCommand {
t += ("Current job wait time", formatNumber(m.getCurrentJobWaitTime) + "ms")
t += ("Average job wait time", formatDouble(m.getAverageJobWaitTime) + "ms")
t += ("Maximum job execute time", formatNumber(m.getMaximumJobExecuteTime) + "ms")
- t += ("Curent job execute time", formatNumber(m.getCurrentJobExecuteTime) + "ms")
+ t += ("Current job execute time", formatNumber(m.getCurrentJobExecuteTime) + "ms")
t += ("Average job execute time", formatDouble(m.getAverageJobExecuteTime) + "ms")
t += ("Total busy time", formatNumber(m.getTotalBusyTime) + "ms")
t += ("Busy time %", formatDouble(m.getBusyTimePercentage * 100) + "%")
@@ -229,23 +282,7 @@ class VisorNodeCommand extends VisorConsoleCommand {
t += ("Current daemon thread count", formatNumber(m.getCurrentDaemonThreadCount))
}
else {
- t += ("OS info", "" +
- node.attribute("os.name") + " " +
- node.attribute("os.arch") + " " +
- node.attribute("os.version")
- )
- t += ("OS user", node.attribute(ATTR_USER_NAME))
- t += ("Deployment mode", node.attribute(ATTR_DEPLOYMENT_MODE))
- t += ("Language runtime", node.attribute(ATTR_LANG_RUNTIME))
- t += ("Ignite version", verStr)
- t += ("JRE information", node.attribute(ATTR_JIT_NAME))
- t += ("Ignite instance name", escapeName(igniteInstanceName))
- t += ("JVM start time", formatDateTime(m.getStartTime))
- t += ("Node start time", formatDateTime(m.getNodeStartTime))
- t += ("Up time", X.timeSpan2HMSM(m.getUpTime))
- t += ("Last metric update", formatDateTime(m.getLastUpdateTime))
- t += ("CPUs", formatNumber(m.getTotalCpus))
- t += ("Thread count", formatNumber(m.getCurrentThreadCount))
+ t += ("Threads count", formatNumber(m.getCurrentThreadCount))
t += ("Cur/avg active jobs", formatNumber(m.getCurrentActiveJobs) +
"/" + formatDouble(m.getAverageActiveJobs))
t += ("Cur/avg waiting jobs", formatNumber(m.getCurrentWaitingJobs) +
@@ -268,7 +305,9 @@ class VisorNodeCommand extends VisorConsoleCommand {
t.render()
- if (!all)
+ if (all)
+ printDataRegions(node)
+ else
println("\nUse \"-a\" flag to see detailed statistics.")
}
}
[03/11] ignite git commit: IGNITE-7510 Muting flaky test
Posted by ag...@apache.org.
IGNITE-7510 Muting flaky test
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a6840b52
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a6840b52
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a6840b52
Branch: refs/heads/ignite-6643
Commit: a6840b52ca422df1d4f6f824416ad4f3869496f0
Parents: 000b71e
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Wed Jan 24 10:27:16 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Wed Jan 24 10:27:16 2018 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/a6840b52/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
index 383698f..a7c549d 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
@@ -93,7 +93,8 @@ public class IgnitePdsTestSuite extends TestSuite {
// Persistence-enabled.
suite.addTestSuite(IgnitePdsSingleNodePutGetPersistenceTest.class);
suite.addTestSuite(IgnitePdsDynamicCacheTest.class);
- suite.addTestSuite(IgnitePdsClientNearCachePutGetTest.class);
+ // TODO uncomment when https://issues.apache.org/jira/browse/IGNITE-7510 is fixed
+ // suite.addTestSuite(IgnitePdsClientNearCachePutGetTest.class);
suite.addTestSuite(IgniteDbPutGetWithCacheStoreTest.class);
suite.addTestSuite(IgniteClusterActivateDeactivateTestWithPersistence.class);
[02/11] ignite git commit: IGNITE-7278 Fixed partition state recovery
from WAL
Posted by ag...@apache.org.
IGNITE-7278 Fixed partition state recovery from WAL
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/000b71ef
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/000b71ef
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/000b71ef
Branch: refs/heads/ignite-6643
Commit: 000b71efd795031f8f3aed114e2ce662c7195987
Parents: fb5b613
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Tue Jan 23 18:30:04 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Tue Jan 23 18:30:04 2018 +0300
----------------------------------------------------------------------
.../GridCacheDatabaseSharedManager.java | 26 +-
.../IgnitePdsContinuousRestartTest2.java | 291 +++++++++++++++++++
.../ignite/testsuites/IgnitePdsTestSuite2.java | 2 +
3 files changed, 305 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/000b71ef/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 85c4005..205365b 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -1916,26 +1916,24 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
break;
case PARTITION_DESTROY:
- if (apply) {
- PartitionDestroyRecord destroyRec = (PartitionDestroyRecord)rec;
+ PartitionDestroyRecord destroyRec = (PartitionDestroyRecord)rec;
- final int gId = destroyRec.groupId();
+ final int gId = destroyRec.groupId();
- if (storeOnly && gId != METASTORAGE_CACHE_ID)
- continue;
+ if (storeOnly && gId != METASTORAGE_CACHE_ID)
+ continue;
- if (!ignoreGrps.contains(gId)) {
- final int pId = destroyRec.partitionId();
+ if (!ignoreGrps.contains(gId)) {
+ final int pId = destroyRec.partitionId();
- PageMemoryEx pageMem = gId == METASTORAGE_CACHE_ID ? storePageMem : getPageMemoryForCacheGroup(gId);
+ PageMemoryEx pageMem = gId == METASTORAGE_CACHE_ID ? storePageMem : getPageMemoryForCacheGroup(gId);
- pageMem.clearAsync(new P3<Integer, Long, Integer>() {
- @Override public boolean apply(Integer cacheId, Long pageId, Integer tag) {
- return cacheId == gId && PageIdUtils.partId(pageId) == pId;
- }
- }, true).get();
+ pageMem.clearAsync(new P3<Integer, Long, Integer>() {
+ @Override public boolean apply(Integer cacheId, Long pageId, Integer tag) {
+ return cacheId == gId && PageIdUtils.partId(pageId) == pId;
+ }
+ }, true).get();
- }
}
break;
http://git-wip-us.apache.org/repos/asf/ignite/blob/000b71ef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest2.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest2.java
new file mode 100644
index 0000000..f45fc50
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest2.java
@@ -0,0 +1,291 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.internal.processors.cache.persistence;
+
+import java.util.Map;
+import java.util.Random;
+import java.util.TreeMap;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.WALMode;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.DFLT_STORE_DIR;
+
+/**
+ * Cause by https://issues.apache.org/jira/browse/IGNITE-7278
+ */
+public class IgnitePdsContinuousRestartTest2 extends GridCommonAbstractTest {
+ /** */
+ private static final int GRID_CNT = 4;
+
+ /** */
+ private static final int ENTRIES_COUNT = 10_000;
+
+ /** */
+ public static final String CACHE_NAME = "cache1";
+
+ /** Checkpoint delay. */
+ private volatile int checkpointDelay = -1;
+
+ /** */
+ private boolean cancel;
+
+ /**
+ * Default constructor.
+ */
+ public IgnitePdsContinuousRestartTest2() {
+
+ }
+
+ /**
+ * @param cancel Cancel.
+ */
+ public IgnitePdsContinuousRestartTest2(boolean cancel) {
+ this.cancel = cancel;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ DataStorageConfiguration memCfg = new DataStorageConfiguration()
+ .setDefaultDataRegionConfiguration(
+ new DataRegionConfiguration()
+ .setMaxSize(400 * 1024 * 1024)
+ .setPersistenceEnabled(true))
+ .setWalMode(WALMode.LOG_ONLY)
+ .setCheckpointFrequency(checkpointDelay);
+
+ cfg.setDataStorageConfiguration(memCfg);
+
+ CacheConfiguration ccfg = new CacheConfiguration();
+
+ ccfg.setName(CACHE_NAME);
+ ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+ ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+ ccfg.setAffinity(new RendezvousAffinityFunction(false, 128));
+ ccfg.setBackups(2);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ stopAllGrids();
+
+ deleteWorkFiles();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+
+ deleteWorkFiles();
+ }
+
+ /**
+ * @throws IgniteCheckedException If failed.
+ */
+ private void deleteWorkFiles() throws IgniteCheckedException {
+ deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), DFLT_STORE_DIR, false));
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_1000_500_1_1() throws Exception {
+ checkRebalancingDuringLoad(1000, 500, 1, 1);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_8000_500_1_1() throws Exception {
+ checkRebalancingDuringLoad(8000, 500, 1, 1);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_1000_20000_1_1() throws Exception {
+ checkRebalancingDuringLoad(1000, 20000, 1, 1);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_8000_8000_1_1() throws Exception {
+ checkRebalancingDuringLoad(8000, 8000, 1, 1);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_1000_500_8_1() throws Exception {
+ checkRebalancingDuringLoad(1000, 500, 8, 1);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_8000_500_8_1() throws Exception {
+ checkRebalancingDuringLoad(8000, 500, 8, 1);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_1000_20000_8_1() throws Exception {
+ checkRebalancingDuringLoad(1000, 20000, 8, 1);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_8000_8000_8_1() throws Exception {
+ checkRebalancingDuringLoad(8000, 8000, 8, 1);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_1000_500_8_16() throws Exception {
+ checkRebalancingDuringLoad(1000, 500, 8, 16);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_8000_500_8_16() throws Exception {
+ checkRebalancingDuringLoad(8000, 500, 8, 16);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_1000_20000_8_16() throws Exception {
+ checkRebalancingDuringLoad(1000, 20000, 8, 16);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ public void testRebalancingDuringLoad_8000_8000_8_16() throws Exception {
+ checkRebalancingDuringLoad(8000, 8000, 8, 16);
+ }
+
+ /**
+ *
+ * @throws Exception if failed.
+ */
+ public void testRebalncingDuringLoad_10_10_1_1() throws Exception {
+ checkRebalancingDuringLoad(10, 10, 1, 1);
+ }
+
+ /**
+ *
+ * @throws Exception if failed.
+ */
+ public void testRebalncingDuringLoad_10_500_8_16() throws Exception {
+ checkRebalancingDuringLoad(10, 500, 8, 16);
+ }
+
+ /**
+ * @throws Exception if failed.
+ */
+ private void checkRebalancingDuringLoad(
+ int restartDelay,
+ int checkpointDelay,
+ int threads,
+ final int batch
+ ) throws Exception {
+ this.checkpointDelay = checkpointDelay;
+
+ startGrids(GRID_CNT);
+
+ final Ignite load = ignite(0);
+
+ load.cluster().active(true);
+
+ try (IgniteDataStreamer<Object, Object> s = load.dataStreamer(CACHE_NAME)) {
+ s.allowOverwrite(true);
+
+ for (int i = 0; i < ENTRIES_COUNT; i++)
+ s.addData(i, i);
+ }
+
+ final AtomicBoolean done = new AtomicBoolean(false);
+
+ IgniteInternalFuture<?> busyFut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+ /** {@inheritDoc} */
+ @Override public Object call() throws Exception {
+ IgniteCache<Object, Object> cache = load.cache(CACHE_NAME);
+ Random rnd = ThreadLocalRandom.current();
+
+ while (!done.get()) {
+ Map<Integer, Integer> map = new TreeMap<>();
+
+ for (int i = 0; i < batch; i++)
+ map.put(rnd.nextInt(ENTRIES_COUNT), rnd.nextInt());
+
+ cache.putAll(map);
+ }
+
+ return null;
+ }
+ }, threads, "updater");
+
+ long end = System.currentTimeMillis() + 90_000;
+
+ Random rnd = ThreadLocalRandom.current();
+
+ while (System.currentTimeMillis() < end) {
+ int idx = rnd.nextInt(GRID_CNT - 1) + 1;
+
+ stopGrid(idx, cancel);
+
+ U.sleep(restartDelay);
+
+ startGrid(idx);
+
+ U.sleep(restartDelay);
+ }
+
+ done.set(true);
+
+ busyFut.get();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/000b71ef/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
index 3852a16..a3dc5a1 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite2.java
@@ -20,6 +20,7 @@ package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
import org.apache.ignite.internal.processors.cache.persistence.IgniteDataStorageMetricsSelfTest;
import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsContinuousRestartTest;
+import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsContinuousRestartTest2;
import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsContinuousRestartTestWithSharedGroupAndIndexes;
import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsExchangeDuringCheckpointTest;
import org.apache.ignite.internal.processors.cache.persistence.IgnitePdsPageSizesTest;
@@ -92,6 +93,7 @@ public class IgnitePdsTestSuite2 extends TestSuite {
suite.addTestSuite(IgniteWalHistoryReservationsTest.class);
suite.addTestSuite(IgnitePdsContinuousRestartTest.class);
+ suite.addTestSuite(IgnitePdsContinuousRestartTest2.class);
suite.addTestSuite(IgnitePdsContinuousRestartTestWithSharedGroupAndIndexes.class);
[10/11] ignite git commit: IGNITE-7514 Choose owner primary node
after cluster restart
Posted by ag...@apache.org.
IGNITE-7514 Choose owner primary node after cluster restart
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fc09631c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fc09631c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fc09631c
Branch: refs/heads/ignite-6643
Commit: fc09631c7e0f2f87012bed34f89e6b343ee18c84
Parents: 4c4d70e
Author: Ilya Lantukh <il...@gridgain.com>
Authored: Wed Jan 24 17:54:09 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Wed Jan 24 17:54:09 2018 +0300
----------------------------------------------------------------------
.../internal/events/DiscoveryCustomEvent.java | 34 ++++
.../cache/CacheAffinitySharedManager.java | 76 ++++++---
.../processors/cache/ClusterCachesInfo.java | 1 +
.../GridCachePartitionExchangeManager.java | 9 +-
.../dht/GridClientPartitionTopology.java | 9 +-
.../distributed/dht/GridDhtLocalPartition.java | 3 -
.../dht/GridDhtPartitionTopology.java | 10 +-
.../dht/GridDhtPartitionTopologyImpl.java | 47 +++++-
.../GridDhtPartitionsExchangeFuture.java | 134 +++++++++------
.../GridCacheDatabaseSharedManager.java | 4 +
.../distributed/CacheBaselineTopologyTest.java | 166 ++++++++++++++++++-
11 files changed, 408 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/events/DiscoveryCustomEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/events/DiscoveryCustomEvent.java b/modules/core/src/main/java/org/apache/ignite/internal/events/DiscoveryCustomEvent.java
index b3c6a2d..3b12b38 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/events/DiscoveryCustomEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/events/DiscoveryCustomEvent.java
@@ -21,7 +21,10 @@ import org.apache.ignite.events.DiscoveryEvent;
import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDiscoveryMessage;
+import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateMessage;
import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.Nullable;
/**
* Custom event.
@@ -85,4 +88,35 @@ public class DiscoveryCustomEvent extends DiscoveryEvent {
@Override public String toString() {
return S.toString(DiscoveryCustomEvent.class, this, super.toString());
}
+
+ /**
+ * @param evt Discovery event.
+ * @return {@code True} if event is DiscoveryCustomEvent that requires centralized affinity assignment.
+ */
+ public static boolean requiresCentralizedAffinityAssignment(DiscoveryEvent evt) {
+ if (!(evt instanceof DiscoveryCustomEvent))
+ return false;
+
+ return requiresCentralizedAffinityAssignment(((DiscoveryCustomEvent)evt).customMessage());
+ }
+
+ /**
+ * @param msg Discovery custom message.
+ * @return {@code True} if message belongs to event that requires centralized affinity assignment.
+ */
+ public static boolean requiresCentralizedAffinityAssignment(@Nullable DiscoveryCustomMessage msg) {
+ if (msg == null)
+ return false;
+
+ if (msg instanceof ChangeGlobalStateMessage && ((ChangeGlobalStateMessage)msg).activate())
+ return true;
+
+ if (msg instanceof SnapshotDiscoveryMessage) {
+ SnapshotDiscoveryMessage snapMsg = (SnapshotDiscoveryMessage) msg;
+
+ return snapMsg.needExchange() && snapMsg.needAssignPartitions();
+ }
+
+ return false;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index 63aba98..921701a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@ -40,6 +40,7 @@ import org.apache.ignite.events.DiscoveryEvent;
import org.apache.ignite.events.Event;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
+import org.apache.ignite.internal.events.DiscoveryCustomEvent;
import org.apache.ignite.internal.managers.discovery.DiscoCache;
import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
@@ -57,7 +58,6 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage;
-import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateFinishMessage;
import org.apache.ignite.internal.processors.cluster.DiscoveryDataClusterState;
import org.apache.ignite.internal.util.GridLongList;
import org.apache.ignite.internal.util.GridPartitionStateMap;
@@ -161,13 +161,15 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
ClusterNode node,
AffinityTopologyVersion topVer,
DiscoveryDataClusterState state) {
- if (state.transition() || !state.active())
+ if ((state.transition() || !state.active()) &&
+ !DiscoveryCustomEvent.requiresCentralizedAffinityAssignment(customMsg))
return;
if (type == EVT_NODE_JOINED && node.isLocal())
lastAffVer = null;
- if (!CU.clientNode(node) && (type == EVT_NODE_FAILED || type == EVT_NODE_JOINED || type == EVT_NODE_LEFT)) {
+ if ((!CU.clientNode(node) && (type == EVT_NODE_FAILED || type == EVT_NODE_JOINED || type == EVT_NODE_LEFT)) ||
+ DiscoveryCustomEvent.requiresCentralizedAffinityAssignment(customMsg)) {
synchronized (mux) {
assert lastAffVer == null || topVer.compareTo(lastAffVer) > 0;
@@ -1263,7 +1265,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
* @param fut Current exchange future.
* @param msg Finish exchange message.
*/
- public void mergeExchangesOnServerLeft(final GridDhtPartitionsExchangeFuture fut,
+ public void applyAffinityFromFullMessage(final GridDhtPartitionsExchangeFuture fut,
final GridDhtPartitionsFullMessage msg) {
final Map<Long, ClusterNode> nodesByOrder = new HashMap<>();
@@ -1396,7 +1398,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
* @return Computed difference with ideal affinity.
* @throws IgniteCheckedException If failed.
*/
- public Map<Integer, CacheGroupAffinityMessage> onServerLeftWithExchangeMergeProtocol(
+ public Map<Integer, CacheGroupAffinityMessage> onServerLeftWithExchangeMergeProtocol(
final GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
{
final ExchangeDiscoveryEvents evts = fut.context().events();
@@ -1404,6 +1406,32 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
assert fut.context().mergeExchanges();
assert evts.hasServerLeft();
+ return onReassignmentEnforced(fut);
+ }
+
+ /**
+ * @param fut Current exchange future.
+ * @return Computed difference with ideal affinity.
+ * @throws IgniteCheckedException If failed.
+ */
+ public Map<Integer, CacheGroupAffinityMessage> onCustomEventWithEnforcedAffinityReassignment(
+ final GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
+ {
+ assert DiscoveryCustomEvent.requiresCentralizedAffinityAssignment(fut.firstEvent());
+
+ return onReassignmentEnforced(fut);
+ }
+
+ /**
+ * @param fut Current exchange future.
+ * @return Computed difference with ideal affinity.
+ * @throws IgniteCheckedException If failed.
+ */
+ public Map<Integer, CacheGroupAffinityMessage> onReassignmentEnforced(
+ final GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
+ {
+ final ExchangeDiscoveryEvents evts = fut.context().events();
+
forAllRegisteredCacheGroups(new IgniteInClosureX<CacheGroupDescriptor>() {
@Override public void applyx(CacheGroupDescriptor desc) throws IgniteCheckedException {
AffinityTopologyVersion topVer = evts.topologyVersion();
@@ -1418,7 +1446,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
}
});
- Map<Integer, Map<Integer, List<Long>>> diff = initAffinityOnNodeLeft0(evts.topologyVersion(),
+ Map<Integer, Map<Integer, List<Long>>> diff = initAffinityBasedOnPartitionsAvailability(evts.topologyVersion(),
fut,
NODE_TO_ORDER,
true);
@@ -1642,17 +1670,16 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
}
/**
- * Called on exchange initiated by server node leave.
+ * Called on exchange initiated by server node leave or custom event with centralized affinity assignment.
*
* @param fut Exchange future.
* @param crd Coordinator flag.
* @throws IgniteCheckedException If failed.
* @return {@code True} if affinity should be assigned by coordinator.
*/
- public boolean onServerLeft(final GridDhtPartitionsExchangeFuture fut, boolean crd) throws IgniteCheckedException {
- ClusterNode leftNode = fut.firstEvent().eventNode();
-
- assert !leftNode.isClient() : leftNode;
+ public boolean onCentralizedAffinityChange(final GridDhtPartitionsExchangeFuture fut, boolean crd) throws IgniteCheckedException {
+ assert (fut.events().hasServerLeft() && !fut.firstEvent().eventNode().isClient()) ||
+ DiscoveryCustomEvent.requiresCentralizedAffinityAssignment(fut.firstEvent()) : fut.firstEvent();
if (crd) {
// Need initialize CacheGroupHolders if this node become coordinator on this exchange.
@@ -2066,7 +2093,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
initFut.listen(new IgniteInClosure<IgniteInternalFuture<?>>() {
@Override public void apply(IgniteInternalFuture<?> initFut) {
try {
- resFut.onDone(initAffinityOnNodeLeft0(fut.initialVersion(), fut, NODE_TO_ID, false));
+ resFut.onDone(initAffinityBasedOnPartitionsAvailability(fut.initialVersion(), fut, NODE_TO_ID, false));
}
catch (IgniteCheckedException e) {
resFut.onDone(e);
@@ -2077,7 +2104,7 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
return resFut;
}
else
- return new GridFinishedFuture<>(initAffinityOnNodeLeft0(fut.initialVersion(), fut, NODE_TO_ID, false));
+ return new GridFinishedFuture<>(initAffinityBasedOnPartitionsAvailability(fut.initialVersion(), fut, NODE_TO_ID, false));
}
/**
@@ -2088,12 +2115,17 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
* @return Affinity assignment.
* @throws IgniteCheckedException If failed.
*/
- private <T> Map<Integer, Map<Integer, List<T>>> initAffinityOnNodeLeft0(final AffinityTopologyVersion topVer,
+ private <T> Map<Integer, Map<Integer, List<T>>> initAffinityBasedOnPartitionsAvailability(final AffinityTopologyVersion topVer,
final GridDhtPartitionsExchangeFuture fut,
final IgniteClosure<ClusterNode, T> c,
final boolean initAff)
throws IgniteCheckedException {
- final WaitRebalanceInfo waitRebalanceInfo = new WaitRebalanceInfo(fut.context().events().lastServerEventVersion());
+ final boolean enforcedCentralizedAssignment =
+ DiscoveryCustomEvent.requiresCentralizedAffinityAssignment(fut.firstEvent());
+
+ final WaitRebalanceInfo waitRebalanceInfo = enforcedCentralizedAssignment ?
+ new WaitRebalanceInfo(fut.exchangeId().topologyVersion()) :
+ new WaitRebalanceInfo(fut.context().events().lastServerEventVersion());
final Collection<ClusterNode> aliveNodes = fut.context().events().discoveryCache().serverNodes();
@@ -2103,13 +2135,14 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
@Override public void applyx(CacheGroupDescriptor desc) throws IgniteCheckedException {
CacheGroupHolder grpHolder = groupHolder(topVer, desc);
- if (!grpHolder.rebalanceEnabled || fut.cacheGroupAddedOnExchange(desc.groupId(), desc.receivedFrom()))
+ if (!grpHolder.rebalanceEnabled ||
+ (fut.cacheGroupAddedOnExchange(desc.groupId(), desc.receivedFrom()) && !enforcedCentralizedAssignment))
return;
AffinityTopologyVersion affTopVer = grpHolder.affinity().lastVersion();
- assert affTopVer.topologyVersion() > 0 && !affTopVer.equals(topVer) : "Invalid affinity version " +
- "[last=" + affTopVer + ", futVer=" + topVer + ", grp=" + desc.cacheOrGroupName() + ']';
+ assert (affTopVer.topologyVersion() > 0 && !affTopVer.equals(topVer)) || enforcedCentralizedAssignment :
+ "Invalid affinity version [last=" + affTopVer + ", futVer=" + topVer + ", grp=" + desc.cacheOrGroupName() + ']';
List<List<ClusterNode>> curAssignment = grpHolder.affinity().assignments(affTopVer);
List<List<ClusterNode>> newAssignment = grpHolder.affinity().idealAssignment();
@@ -2141,6 +2174,11 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
", node=" + newPrimary +
", topVer=" + topVer + ']';
+ List<ClusterNode> owners = top.owners(p);
+
+ if (!owners.isEmpty() && !owners.contains(curPrimary))
+ curPrimary = owners.get(0);
+
if (curPrimary != null && newPrimary != null && !curPrimary.equals(newPrimary)) {
if (aliveNodes.contains(curPrimary)) {
GridDhtPartitionState state = top.partitionState(newPrimary.id(), p);
@@ -2173,8 +2211,6 @@ public class CacheAffinitySharedManager<K, V> extends GridCacheSharedManagerAdap
}
if (newNodes0 == null) {
- List<ClusterNode> owners = top.owners(p);
-
for (ClusterNode owner : owners) {
if (aliveNodes.contains(owner)) {
newNodes0 = latePrimaryAssignment(grpHolder.affinity(),
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
index 08a910b..2b2fb55 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
@@ -1186,6 +1186,7 @@ class ClusterCachesInfo {
/**
* @param msg Message.
* @param topVer Current topology version.
+ * @param curState Current cluster state.
* @return Exchange action.
* @throws IgniteCheckedException If configuration validation failed.
*/
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 9b9284f..0a657c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -253,6 +253,13 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
return;
}
+ if (evt.type() == EVT_DISCOVERY_CUSTOM_EVT &&
+ (((DiscoveryCustomEvent)evt).customMessage() instanceof CacheAffinityChangeMessage) &&
+ ((CacheAffinityChangeMessage)((DiscoveryCustomEvent)evt).customMessage()).exchangeId() != null) {
+ onDiscoveryEvent(evt, cache);
+
+ return;
+ }
if (cache.state().transition()) {
if (log.isDebugEnabled())
@@ -965,7 +972,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
* For coordinator causes {@link GridDhtPartitionsFullMessage FullMessages} send,
* for non coordinator - {@link GridDhtPartitionsSingleMessage SingleMessages} send
*/
- private void refreshPartitions() {
+ public void refreshPartitions() {
// TODO https://issues.apache.org/jira/browse/IGNITE-6857
if (cctx.snapshot().snapshotOperationInProgress()) {
scheduleResendPartitions();
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
index e994113..def00f3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridClientPartitionTopology.java
@@ -256,9 +256,9 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
}
/** {@inheritDoc} */
- @Override public void initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer,
+ @Override public boolean initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer,
GridDhtPartitionsExchangeFuture exchFut) {
- // No-op.
+ return false;
}
/** {@inheritDoc} */
@@ -383,6 +383,11 @@ public class GridClientPartitionTopology implements GridDhtPartitionTopology {
}
/** {@inheritDoc} */
+ @Override public void afterStateRestored(AffinityTopologyVersion topVer) {
+ // no-op
+ }
+
+ /** {@inheritDoc} */
@Override public boolean afterExchange(GridDhtPartitionsExchangeFuture exchFut) throws IgniteCheckedException {
AffinityTopologyVersion topVer = exchFut.topologyVersion();
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index e1f1d6f..e63aab6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -213,9 +213,6 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
// TODO ignite-db
throw new IgniteException(e);
}
-
- // Todo log moving state
- casState(state.get(), MOVING);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java
index 4ae68ef..13564c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java
@@ -117,12 +117,20 @@ public interface GridDhtPartitionTopology {
/**
* @param affVer Affinity version.
* @param exchFut Exchange future.
+ * @return {@code True} if partitions must be refreshed.
* @throws IgniteInterruptedCheckedException If interrupted.
*/
- public void initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer, GridDhtPartitionsExchangeFuture exchFut)
+ public boolean initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer, GridDhtPartitionsExchangeFuture exchFut)
throws IgniteInterruptedCheckedException;
/**
+ * Initializes local data structures after partitions are restored from persistence.
+ *
+ * @param topVer Topology version.
+ */
+ public void afterStateRestored(AffinityTopologyVersion topVer);
+
+ /**
* Post-initializes this topology.
*
* @param exchFut Exchange future.
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index 0a2c154..f3da42a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -299,10 +299,12 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
/** {@inheritDoc} */
- @Override public void initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer,
+ @Override public boolean initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer,
GridDhtPartitionsExchangeFuture exchFut)
throws IgniteInterruptedCheckedException
{
+ boolean needRefresh;
+
ctx.database().checkpointReadLock();
try {
@@ -310,11 +312,11 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
try {
if (stopping)
- return;
+ return false;
long updateSeq = this.updateSeq.incrementAndGet();
- initPartitions0(affVer, exchFut, updateSeq);
+ needRefresh = initPartitions0(affVer, exchFut, updateSeq);
consistencyCheck();
}
@@ -325,16 +327,21 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
finally {
ctx.database().checkpointReadUnlock();
}
+
+ return needRefresh;
}
/**
* @param affVer Affinity version to use.
* @param exchFut Exchange future.
* @param updateSeq Update sequence.
+ * @return {@code True} if partitions must be refreshed.
*/
- private void initPartitions0(AffinityTopologyVersion affVer, GridDhtPartitionsExchangeFuture exchFut, long updateSeq) {
+ private boolean initPartitions0(AffinityTopologyVersion affVer, GridDhtPartitionsExchangeFuture exchFut, long updateSeq) {
List<List<ClusterNode>> aff = grp.affinity().readyAssignments(affVer);
+ boolean needRefresh = false;
+
if (grp.affinityNode()) {
ClusterNode loc = ctx.localNode();
@@ -366,6 +373,8 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
GridCacheDatabaseSharedManager db = (GridCacheDatabaseSharedManager)grp.shared().database();
locPart.restoreState(db.readPartitionState(grp, locPart.id()));
+
+ needRefresh = true;
}
else {
boolean owned = locPart.own();
@@ -423,6 +432,8 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
updateRebalanceVersion(aff);
+
+ return needRefresh;
}
/**
@@ -617,6 +628,30 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
/** {@inheritDoc} */
+ @Override public void afterStateRestored(AffinityTopologyVersion topVer) {
+ lock.writeLock().lock();
+
+ try {
+ if (node2part == null)
+ return;
+
+ long updateSeq = this.updateSeq.incrementAndGet();
+
+ for (int p = 0; p < grp.affinity().partitions(); p++) {
+ GridDhtLocalPartition locPart = locParts.get(p);
+
+ if (locPart == null)
+ updateLocal(p, EVICTED, updateSeq, topVer);
+ else
+ updateLocal(p, locPart.state(), updateSeq, topVer);
+ }
+ }
+ finally {
+ lock.writeLock().unlock();
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public boolean afterExchange(GridDhtPartitionsExchangeFuture exchFut) {
boolean changed = false;
@@ -996,9 +1031,11 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
map.put(i, part.state());
}
+ GridDhtPartitionMap locPartMap = node2part != null ? node2part.get(ctx.localNodeId()) : null;
+
return new GridDhtPartitionMap(ctx.localNodeId(),
updateSeq.get(),
- readyTopVer,
+ locPartMap != null ? locPartMap.topologyVersion() : readyTopVer,
map,
true);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 6c09b6a..9a247e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -227,6 +227,12 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
*/
private boolean centralizedAff;
+ /**
+ * Enforce affinity reassignment based on actual partition distribution. This mode should be used when partitions
+ * might be distributed not according to affinity assignment.
+ */
+ private boolean forceAffReassignment;
+
/** Change global state exception. */
private Exception changeGlobalStateE;
@@ -590,6 +596,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
DiscoveryCustomMessage msg = ((DiscoveryCustomEvent)firstDiscoEvt).customMessage();
+ forceAffReassignment = DiscoveryCustomEvent.requiresCentralizedAffinityAssignment(msg);
+
if (msg instanceof ChangeGlobalStateMessage) {
assert exchActions != null && !exchActions.empty();
@@ -611,6 +619,9 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
exchange = onAffinityChangeRequest(crdNode);
}
+ if (forceAffReassignment)
+ cctx.affinity().onCentralizedAffinityChange(this, crdNode);
+
initCoordinatorCaches(newCrd);
}
else {
@@ -756,7 +767,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
if (grp.isLocal())
continue;
- grp.topology().beforeExchange(this, !centralizedAff, false);
+ grp.topology().beforeExchange(this, !centralizedAff && !forceAffReassignment, false);
}
}
}
@@ -899,8 +910,6 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
else if (req.activate()) {
// TODO: BLT changes on inactive cluster can't be handled easily because persistent storage hasn't been initialized yet.
try {
- cctx.affinity().onBaselineTopologyChanged(this, crd);
-
if (CU.isPersistenceEnabled(cctx.kernalContext().config()) && !cctx.kernalContext().clientNode())
cctx.kernalContext().state().onBaselineTopologyChanged(req.baselineTopology(),
req.prevBaselineTopologyHistoryItem());
@@ -937,7 +946,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
* @return Exchange type.
*/
private ExchangeType onCustomMessageNoAffinityChange(boolean crd) {
- cctx.affinity().onCustomMessageNoAffinityChange(this, crd, exchActions);
+ if (!forceAffReassignment)
+ cctx.affinity().onCustomMessageNoAffinityChange(this, crd, exchActions);
return cctx.kernalContext().clientNode() ? ExchangeType.CLIENT : ExchangeType.ALL;
}
@@ -992,7 +1002,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
exchCtx.events().warnNoAffinityNodes(cctx);
- centralizedAff = cctx.affinity().onServerLeft(this, crd);
+ centralizedAff = cctx.affinity().onCentralizedAffinityChange(this, crd);
}
else
cctx.affinity().onServerJoin(this, crd);
@@ -1072,7 +1082,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
// It is possible affinity is not initialized yet if node joins to cluster.
if (grp.affinity().lastVersion().topologyVersion() > 0)
- grp.topology().beforeExchange(this, !centralizedAff, false);
+ grp.topology().beforeExchange(this, !centralizedAff && !forceAffReassignment, false);
}
}
@@ -1509,19 +1519,24 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
}
if (err == null) {
- if (centralizedAff) {
+ if (centralizedAff || forceAffReassignment) {
assert !exchCtx.mergeExchanges();
for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
if (grp.isLocal())
continue;
+ boolean needRefresh = false;
+
try {
- grp.topology().initPartitionsWhenAffinityReady(res, this);
+ needRefresh = grp.topology().initPartitionsWhenAffinityReady(res, this);
}
catch (IgniteInterruptedCheckedException e) {
U.error(log, "Failed to initialize partitions.", e);
}
+
+ if (needRefresh)
+ cctx.exchange().refreshPartitions();
}
}
@@ -2317,7 +2332,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
if (!exchCtx.mergeExchanges() && !crd.equals(events().discoveryCache().serverNodes().get(0))) {
for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
if (!grp.isLocal())
- grp.topology().beforeExchange(this, !centralizedAff, false);
+ grp.topology().beforeExchange(this, !centralizedAff && !forceAffReassignment, false);
}
}
@@ -2449,6 +2464,9 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
detectLostPartitions(resTopVer);
}
+ if (!exchCtx.mergeExchanges() && forceAffReassignment)
+ idealAffDiff = cctx.affinity().onCustomEventWithEnforcedAffinityReassignment(this);
+
for (CacheGroupContext grpCtx : cctx.cache().cacheGroups()) {
if (!grpCtx.isLocal())
grpCtx.topology().applyUpdateCounters();
@@ -2471,6 +2489,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
if (exchCtx.events().hasServerLeft())
msg.idealAffinityDiff(idealAffDiff);
}
+ else if (forceAffReassignment)
+ msg.idealAffinityDiff(idealAffDiff);
msg.prepareMarshal(cctx);
@@ -2524,65 +2544,69 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
nodes.addAll(sndResNodes);
}
- IgniteCheckedException err = null;
+ if (!nodes.isEmpty())
+ sendAllPartitions(msg, nodes, mergedJoinExchMsgs0, joinedNodeAff);
- if (stateChangeExchange()) {
- StateChangeRequest req = exchActions.stateChangeRequest();
+ if (!stateChangeExchange())
+ onDone(exchCtx.events().topologyVersion(), null);
- assert req != null : exchActions;
+ for (Map.Entry<UUID, GridDhtPartitionsSingleMessage> e : pendingSingleMsgs.entrySet()) {
+ if (log.isInfoEnabled()) {
+ log.info("Process pending message on coordinator [node=" + e.getKey() +
+ ", ver=" + initialVersion() +
+ ", resVer=" + resTopVer + ']');
+ }
- boolean stateChangeErr = false;
+ processSingleMessage(e.getKey(), e.getValue());
+ }
+ }
- if (!F.isEmpty(changeGlobalStateExceptions)) {
- stateChangeErr = true;
+ if (stateChangeExchange()) {
+ IgniteCheckedException err = null;
- err = new IgniteCheckedException("Cluster state change failed.");
+ StateChangeRequest req = exchActions.stateChangeRequest();
- cctx.kernalContext().state().onStateChangeError(changeGlobalStateExceptions, req);
- }
- else {
- boolean hasMoving = !partsToReload.isEmpty();
+ assert req != null : exchActions;
- Set<Integer> waitGrps = cctx.affinity().waitGroups();
+ boolean stateChangeErr = false;
- if (!hasMoving) {
- for (CacheGroupContext grpCtx : cctx.cache().cacheGroups()) {
- if (waitGrps.contains(grpCtx.groupId()) && grpCtx.topology().hasMovingPartitions()) {
- hasMoving = true;
+ if (!F.isEmpty(changeGlobalStateExceptions)) {
+ stateChangeErr = true;
- break;
- }
+ err = new IgniteCheckedException("Cluster state change failed.");
- }
- }
+ cctx.kernalContext().state().onStateChangeError(changeGlobalStateExceptions, req);
+ }
+ else {
+ boolean hasMoving = !partsToReload.isEmpty();
- cctx.kernalContext().state().onExchangeFinishedOnCoordinator(this, hasMoving);
- }
+ Set<Integer> waitGrps = cctx.affinity().waitGroups();
+
+ if (!hasMoving) {
+ for (CacheGroupContext grpCtx : cctx.cache().cacheGroups()) {
+ if (waitGrps.contains(grpCtx.groupId()) && grpCtx.topology().hasMovingPartitions()) {
+ hasMoving = true;
- boolean active = !stateChangeErr && req.activate();
+ break;
+ }
- ChangeGlobalStateFinishMessage stateFinishMsg = new ChangeGlobalStateFinishMessage(
- req.requestId(),
- active,
- !stateChangeErr);
+ }
+ }
- cctx.discovery().sendCustomEvent(stateFinishMsg);
+ cctx.kernalContext().state().onExchangeFinishedOnCoordinator(this, hasMoving);
}
- if (!nodes.isEmpty())
- sendAllPartitions(msg, nodes, mergedJoinExchMsgs0, joinedNodeAff);
+ boolean active = !stateChangeErr && req.activate();
- onDone(exchCtx.events().topologyVersion(), err);
+ ChangeGlobalStateFinishMessage stateFinishMsg = new ChangeGlobalStateFinishMessage(
+ req.requestId(),
+ active,
+ !stateChangeErr);
- for (Map.Entry<UUID, GridDhtPartitionsSingleMessage> e : pendingSingleMsgs.entrySet()) {
- if (log.isInfoEnabled()) {
- log.info("Process pending message on coordinator [node=" + e.getKey() +
- ", ver=" + initialVersion() +
- ", resVer=" + resTopVer + ']');
- }
+ cctx.discovery().sendCustomEvent(stateFinishMsg);
- processSingleMessage(e.getKey(), e.getValue());
- }
+ if (!centralizedAff)
+ onDone(exchCtx.events().topologyVersion(), err);
}
}
catch (IgniteCheckedException e) {
@@ -2925,7 +2949,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
cctx.affinity().onLocalJoin(this, msg, resTopVer);
else {
if (exchCtx.events().hasServerLeft())
- cctx.affinity().mergeExchangesOnServerLeft(this, msg);
+ cctx.affinity().applyAffinityFromFullMessage(this, msg);
else
cctx.affinity().onServerJoinWithExchangeMergeProtocol(this, false);
@@ -2939,6 +2963,8 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
}
else if (localJoinExchange() && !exchCtx.fetchAffinityOnJoin())
cctx.affinity().onLocalJoin(this, msg, resTopVer);
+ else if (forceAffReassignment)
+ cctx.affinity().applyAffinityFromFullMessage(this, msg);
updatePartitionFullMap(resTopVer, msg);
@@ -3048,6 +3074,9 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
crd.isLocal(),
msg);
+ IgniteCheckedException err = !F.isEmpty(msg.partitionsMessage().getErrorsMap()) ?
+ new IgniteCheckedException("Cluster state change failed.") : null;
+
if (!crd.isLocal()) {
GridDhtPartitionsFullMessage partsMsg = msg.partitionsMessage();
@@ -3055,9 +3084,12 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
assert partsMsg.lastVersion() != null : partsMsg;
updatePartitionFullMap(resTopVer, partsMsg);
+
+ if (exchActions != null && exchActions.stateChangeRequest() != null && err != null)
+ cctx.kernalContext().state().onStateChangeError(msg.partitionsMessage().getErrorsMap(), exchActions.stateChangeRequest());
}
- onDone(resTopVer);
+ onDone(resTopVer, err);
}
else {
if (log.isDebugEnabled()) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index a636464..b43827a 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -109,6 +109,8 @@ import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
import org.apache.ignite.internal.processors.cache.StoredCacheData;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
import org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore;
@@ -2300,6 +2302,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
updateState(part, restore.get1());
}
}
+
+ grp.topology().afterStateRestored(grp.topology().lastTopologyChangeVersion());
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fc09631c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
index 5fbd752..7dc1bfa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
@@ -25,13 +25,16 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Random;
import java.util.Set;
+import java.util.UUID;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CacheWriteSynchronizationMode;
-import org.apache.ignite.cache.PartitionLossPolicy;
+import org.apache.ignite.cache.affinity.AffinityFunction;
+import org.apache.ignite.cache.affinity.AffinityFunctionContext;
+import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.cluster.BaselineNode;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.CacheConfiguration;
@@ -40,9 +43,16 @@ import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.WALMode;
import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.TestDelayingCommunicationSpi;
+import org.apache.ignite.internal.managers.communication.GridIoMessage;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState;
import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage;
import org.apache.ignite.internal.util.lang.GridAbsPredicate;
import org.apache.ignite.internal.util.typedef.PA;
+import org.apache.ignite.plugin.extensions.communication.Message;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
@@ -63,6 +73,9 @@ public class CacheBaselineTopologyTest extends GridCommonAbstractTest {
/** */
private static final int NODE_COUNT = 4;
+ /** */
+ private static boolean delayRebalance = false;
+
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
super.beforeTest();
@@ -98,6 +111,9 @@ public class CacheBaselineTopologyTest extends GridCommonAbstractTest {
if (client)
cfg.setClientMode(true);
+ if (delayRebalance)
+ cfg.setCommunicationSpi(new DelayRebalanceCommunicationSpi());
+
return cfg;
}
@@ -646,6 +662,83 @@ public class CacheBaselineTopologyTest extends GridCommonAbstractTest {
}
}
+ /**
+ * @throws Exception if failed.
+ */
+ public void testAffinityAssignmentChangedAfterRestart() throws Exception {
+ delayRebalance = false;
+
+ int parts = 32;
+
+ final List<Integer> partMapping = new ArrayList<>();
+
+ for (int p = 0; p < parts; p++)
+ partMapping.add(p);
+
+ final AffinityFunction affFunc = new TestAffinityFunction(new RendezvousAffinityFunction(false, parts));
+
+ TestAffinityFunction.partsAffMapping = partMapping;
+
+ String cacheName = CACHE_NAME + 2;
+
+ startGrids(4);
+
+ IgniteEx ig = grid(0);
+
+ ig.cluster().active(true);
+
+ IgniteCache<Integer, Integer> cache = ig.createCache(
+ new CacheConfiguration<Integer, Integer>()
+ .setName(cacheName)
+ .setCacheMode(PARTITIONED)
+ .setBackups(1)
+ .setPartitionLossPolicy(READ_ONLY_SAFE)
+ .setReadFromBackup(true)
+ .setWriteSynchronizationMode(FULL_SYNC)
+ .setRebalanceDelay(-1)
+ .setAffinity(affFunc));
+
+ Map<Integer, String> keyToConsId = new HashMap<>();
+
+ for (int k = 0; k < 1000; k++) {
+ cache.put(k, k);
+
+ keyToConsId.put(k, ig.affinity(cacheName).mapKeyToNode(k).consistentId().toString());
+ }
+
+ stopAllGrids();
+
+ Collections.shuffle(TestAffinityFunction.partsAffMapping, new Random(1));
+
+ delayRebalance = true;
+
+ startGrids(4);
+
+ ig = grid(0);
+
+ ig.active(true);
+
+ cache = ig.cache(cacheName);
+
+ GridDhtPartitionFullMap partMap = ig.cachex(cacheName).context().topology().partitionMap(false);
+
+ for (int i = 1; i < 4; i++) {
+ IgniteEx ig0 = grid(i);
+
+ for (int p = 0; p < 32; p++)
+ assertEqualsCollections(ig.affinity(cacheName).mapPartitionToPrimaryAndBackups(p), ig0.affinity(cacheName).mapPartitionToPrimaryAndBackups(p));
+ }
+
+ for (Map.Entry<Integer, String> e : keyToConsId.entrySet()) {
+ int p = ig.affinity(cacheName).partition(e.getKey());
+
+ assertEquals("p=" + p, GridDhtPartitionState.OWNING, partMap.get(ig.affinity(cacheName).mapKeyToNode(e.getKey()).id()).get(p));
+ }
+
+ for (int k = 0; k < 1000; k++)
+ assertEquals("k=" + k, Integer.valueOf(k), cache.get(k));
+ }
+
/** */
private Collection<BaselineNode> baselineNodes(Collection<ClusterNode> clNodes) {
Collection<BaselineNode> res = new ArrayList<>(clNodes.size());
@@ -708,4 +801,73 @@ public class CacheBaselineTopologyTest extends GridCommonAbstractTest {
return result;
}
}
+
+ /**
+ *
+ */
+ private static class TestAffinityFunction implements AffinityFunction {
+ /** */
+ private final AffinityFunction delegate;
+
+ /** */
+ private static List<Integer> partsAffMapping;
+
+ /** */
+ public TestAffinityFunction(AffinityFunction delegate) {
+ this.delegate = delegate;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void reset() {
+ delegate.reset();;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partitions() {
+ return delegate.partitions();
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partition(Object key) {
+ return delegate.partition(key);
+ }
+
+ /** {@inheritDoc} */
+ @Override public List<List<ClusterNode>> assignPartitions(AffinityFunctionContext affCtx) {
+ List<List<ClusterNode>> res0 = delegate.assignPartitions(affCtx);
+
+ List<List<ClusterNode>> res = new ArrayList<>(res0.size());
+
+ for (int p = 0; p < res0.size(); p++)
+ res.add(p, null);
+
+ for (int p = 0; p < res0.size(); p++)
+ res.set(partsAffMapping.get(p), res0.get(p));
+
+ return res;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void removeNode(UUID nodeId) {
+ delegate.removeNode(nodeId);
+ }
+ }
+
+ /**
+ *
+ */
+ private static class DelayRebalanceCommunicationSpi extends TestDelayingCommunicationSpi {
+ /** {@inheritDoc} */
+ @Override protected boolean delayMessage(Message msg, GridIoMessage ioMsg) {
+ if (msg != null && (msg instanceof GridDhtPartitionDemandMessage || msg instanceof GridDhtPartitionSupplyMessage))
+ return true;
+
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int delayMillis() {
+ return 1_000_000;
+ }
+ }
}
[05/11] ignite git commit: master Add a method to quickly check if a
node is in baseline topology
Posted by ag...@apache.org.
master Add a method to quickly check if a node is in baseline topology
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fa156452
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fa156452
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fa156452
Branch: refs/heads/ignite-6643
Commit: fa1564522cc544ffcff7e22e6af2cf19dea53ae5
Parents: 8d42789
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Wed Jan 24 10:46:34 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Wed Jan 24 10:46:34 2018 +0300
----------------------------------------------------------------------
.../ignite/internal/managers/discovery/DiscoCache.java | 8 ++++++++
.../processors/cache/persistence/file/FilePageStore.java | 2 +-
.../processors/cluster/GridClusterStateProcessor.java | 10 ++++++----
3 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/fa156452/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
index f73f420..7bc0344 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
@@ -276,6 +276,14 @@ public class DiscoCache {
}
/**
+ * @param node Node to check.
+ * @return {@code True} if the node is in baseline or if baseline is not set.
+ */
+ public boolean baselineNode(ClusterNode node) {
+ return nodeIdToConsIdx == null || nodeIdToConsIdx.get(node.id()) != null;
+ }
+
+ /**
* @return Oldest alive server node.
*/
@SuppressWarnings("ForLoopReplaceableByForEach")
http://git-wip-us.apache.org/repos/asf/ignite/blob/fa156452/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
index ddf6062..1153c88 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStore.java
@@ -126,7 +126,7 @@ public class FilePageStore implements PageStore {
/**
* Page store version.
*/
- public int version() {
+ @Override public int version() {
return VERSION;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/fa156452/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
index 54e0f56..73c9d7f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/GridClusterStateProcessor.java
@@ -243,12 +243,14 @@ public class GridClusterStateProcessor extends GridProcessorAdapter implements I
* @throws IgniteCheckedException If write to metastore has failed.
*/
public void resetBranchingHistory(long newBranchingHash) throws IgniteCheckedException {
- globalState.baselineTopology().resetBranchingHistory(newBranchingHash);
+ if (!compatibilityMode()) {
+ globalState.baselineTopology().resetBranchingHistory(newBranchingHash);
- writeBaselineTopology(globalState.baselineTopology(), null);
+ writeBaselineTopology(globalState.baselineTopology(), null);
- U.log(log,
- String.format("Branching history of current BaselineTopology is reset to the value %d", newBranchingHash));
+ U.log(log,
+ String.format("Branching history of current BaselineTopology is reset to the value %d", newBranchingHash));
+ }
}
/**
[11/11] ignite git commit: ignite-6643 Marshalling improvements
Posted by ag...@apache.org.
ignite-6643 Marshalling improvements
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/38a48831
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/38a48831
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/38a48831
Branch: refs/heads/ignite-6643
Commit: 38a488313ce8fd9adf97107c259144c4316ac670
Parents: fc09631
Author: Andrey Gura <ag...@apache.org>
Authored: Mon Jan 22 22:41:54 2018 +0300
Committer: Andrey Gura <ag...@apache.org>
Committed: Wed Jan 24 17:58:14 2018 +0300
----------------------------------------------------------------------
.../apache/ignite/IgniteSystemProperties.java | 60 +----
.../org/apache/ignite/internal/ClassSet.java | 108 +++++++++
.../ignite/internal/GridKernalContext.java | 6 +
.../ignite/internal/GridKernalContextImpl.java | 13 +-
.../apache/ignite/internal/IgniteKernal.java | 107 ++++++++-
.../ignite/internal/MarshallerContextImpl.java | 8 +-
.../wal/reader/StandaloneGridKernalContext.java | 6 +
.../ignite/internal/util/IgniteUtils.java | 15 ++
.../ignite/marshaller/MarshallerUtils.java | 6 +
.../ignite/marshaller/jdk/JdkMarshaller.java | 20 +-
.../jdk/JdkMarshallerObjectInputStream.java | 9 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 8 +-
.../org/apache/ignite/stream/StreamAdapter.java | 2 +-
.../ignite/stream/socket/SocketStreamer.java | 8 +-
.../test/config/class_list_exploit_excluded.txt | 18 ++
.../test/config/class_list_exploit_included.txt | 19 ++
.../apache/ignite/internal/ClassSetTest.java | 71 ++++++
.../DiscoveryUnmarshalVulnerabilityTest.java | 180 +++++++++++++++
...ocketStreamerUnmarshalVulnerabilityTest.java | 222 +++++++++++++++++++
.../junits/GridTestKernalContext.java | 9 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 3 +
.../IgniteSpiDiscoverySelfTestSuite.java | 3 +
.../testsuites/IgniteStreamSelfTestSuite.java | 2 +
23 files changed, 834 insertions(+), 69 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 9cd031d..7761292 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -28,7 +28,6 @@ import org.apache.ignite.cluster.ClusterGroup;
import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.internal.client.GridClient;
import org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller;
-import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.stream.StreamTransformer;
import org.jetbrains.annotations.Nullable;
@@ -222,11 +221,6 @@ public final class IgniteSystemProperties {
public static final String IGNITE_MAX_COMPLETED_TX_COUNT = "IGNITE_MAX_COMPLETED_TX_COUNT";
/**
- * Concurrency level for all concurrent hash maps created by Ignite.
- */
- public static final String IGNITE_MAP_CONCURRENCY_LEVEL = "IGNITE_MAP_CONCURRENCY_LEVEL";
-
- /**
* Transactions that take more time, than value of this property, will be output to log
* with warning level. {@code 0} (default value) disables warning on slow transactions.
*/
@@ -320,13 +314,6 @@ public final class IgniteSystemProperties {
/** Ttl of removed cache entries (ms). */
public static final String IGNITE_CACHE_REMOVED_ENTRIES_TTL = "IGNITE_CACHE_REMOVED_ENTRIES_TTL";
- /** Maximum amount of concurrent updates per system thread in atomic caches in case of PRIMARY_SYNC or FULL_ASYNC
- * write synchronization mode. If this limit is exceeded then update will be performed with FULL_SYNC
- * synchronization mode. If value is {@code 0} then limit is unbounded.
- */
- public static final String IGNITE_ATOMIC_CACHE_MAX_CONCURRENT_DHT_UPDATES =
- "IGNITE_ATOMIC_CACHE_MAX_CONCURRENT_DHT_UPDATES";
-
/**
* Comma separated list of addresses in format "10.100.22.100:45000,10.100.22.101:45000".
* Makes sense only for {@link org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder}.
@@ -479,9 +466,6 @@ public final class IgniteSystemProperties {
/** Number of cache operation retries in case of topology exceptions. */
public static final String IGNITE_CACHE_RETRIES_COUNT = "IGNITE_CACHE_RETRIES_COUNT";
- /** Number of times pending cache objects will be dumped to the log in case of partition exchange timeout. */
- public static final String IGNITE_DUMP_PENDING_OBJECTS_THRESHOLD = "IGNITE_DUMP_PENDING_OBJECTS_THRESHOLD";
-
/** If this property is set to {@code true} then Ignite will log thread dump in case of partition exchange timeout. */
public static final String IGNITE_THREAD_DUMP_ON_EXCHANGE_TIMEOUT = "IGNITE_THREAD_DUMP_ON_EXCHANGE_TIMEOUT";
@@ -524,6 +508,12 @@ public final class IgniteSystemProperties {
public static final String IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2 =
"IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2";
+ /** Defines path to the file that contains list of classes allowed to safe deserialization.*/
+ public static final String IGNITE_MARSHALLER_WHITELIST = "IGNITE_MARSHALLER_WHITELIST";
+
+ /** Defines path to the file that contains list of classes disallowed to safe deserialization.*/
+ public static final String IGNITE_MARSHALLER_BLACKLIST = "IGNITE_MARSHALLER_BLACKLIST";
+
/**
* If set to {@code true}, then default selected keys set is used inside
* {@code GridNioServer} which lead to some extra garbage generation when
@@ -689,16 +679,7 @@ public final class IgniteSystemProperties {
*/
public static final String IGNITE_FORCE_START_JAVA7 = "IGNITE_FORCE_START_JAVA7";
- /** Returns true for system properties only avoiding sending sensitive information. */
- private static final IgnitePredicate<Map.Entry<String, String>> PROPS_FILTER = new IgnitePredicate<Map.Entry<String, String>>() {
- @Override public boolean apply(final Map.Entry<String, String> entry) {
- final String key = entry.getKey();
-
- return key.startsWith("java.") || key.startsWith("os.") || key.startsWith("user.");
- }
- };
-
- /**
+ /**
* When set to {@code true}, Ignite switches to compatibility mode with versions that don't
* support service security permissions. In this case security permissions will be ignored
* (if they set).
@@ -740,11 +721,6 @@ public final class IgniteSystemProperties {
public static final String IGNITE_ENABLE_FORCIBLE_NODE_KILL = "IGNITE_ENABLE_FORCIBLE_NODE_KILL";
/**
- *
- */
- public static final String IGNITE_WAL_ARCHIVE_COMPACT_SKIP_DELTA_RECORD = "IGNITE_WAL_ARCHIVE_COMPACT_SKIP_DELTA_RECORD";
-
- /**
* Tasks stealing will be started if tasks queue size per data-streamer thread exceeds this threshold.
* <p>
* Default value is {@code 4}.
@@ -1023,26 +999,4 @@ public final class IgniteSystemProperties {
return sysProps;
}
-
- /**
- * Does the same as {@link #snapshot()} but filters out
- * possible sensitive user data.
- *
- * @return Snapshot of system properties.
- */
- @SuppressWarnings("unchecked")
- public static Properties safeSnapshot() {
- final Properties props = snapshot();
-
- final Iterator<Map.Entry<Object, Object>> iter = props.entrySet().iterator();
-
- while (iter.hasNext()) {
- final Map.Entry entry = iter.next();
-
- if (!PROPS_FILTER.apply(entry))
- iter.remove();
- }
-
- return props;
- }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/internal/ClassSet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/ClassSet.java b/modules/core/src/main/java/org/apache/ignite/internal/ClassSet.java
new file mode 100644
index 0000000..400984d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/ClassSet.java
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.internal;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.IllegalFormatException;
+import java.util.Map;
+
+/**
+ * Set of classes represented as prefix tree.
+ * {@code *} symbol is allowed and indicates that all packages and classes are included.
+ */
+public class ClassSet {
+ /** Corresponds to {@code *} symbol. */
+ private static final Map<String, Node> ALL = Collections.emptyMap();
+
+ /** Root. */
+ private Node root = new Node();
+
+ /**
+ * Adds class name to the set.
+ *
+ * @param clsName Class name.
+ */
+ public void add(String clsName) {
+ String[] tokens = clsName.split("\\.");
+
+ Node cur = root;
+
+ for (int i = 0; i < tokens.length; i++) {
+ if (cur.children == ALL)
+ return;
+
+ if (tokens[i].equals("*")) {
+ if (i != tokens.length - 1)
+ throw new IllegalArgumentException("Incorrect class name format.");
+
+ cur.children = ALL;
+
+ return;
+ }
+
+ if (cur.children == null)
+ cur.children = new HashMap<>();
+
+ Node n = cur.children.get(tokens[i]);
+
+ if (n == null) {
+ n = new Node();
+
+ cur.children.put(tokens[i], n);
+ }
+
+ cur = n;
+ }
+ }
+
+ /**
+ * @param clsName Class name.
+ */
+ public boolean contains(String clsName) {
+ String[] tokens = clsName.split("\\.");
+
+ Node cur = root;
+
+ for (int i = 0; i < tokens.length; i++) {
+ if (cur.children == ALL)
+ return true;
+
+ if (cur.children == null)
+ return false;
+
+ Node n = cur.children.get(tokens[i]);
+
+ if (n == null)
+ return false;
+
+ if (i == tokens.length - 1)
+ return true;
+
+ cur = n;
+ }
+
+ return false;
+ }
+
+ /** */
+ private static class Node {
+ /** Children. */
+ private Map<String, Node> children;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
index ce12b61..2877dad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
@@ -69,6 +69,7 @@ import org.apache.ignite.internal.suggestions.GridPerformanceSuggestions;
import org.apache.ignite.internal.util.IgniteExceptionRegistry;
import org.apache.ignite.internal.util.StripedExecutor;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
+import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.plugin.PluginNotFoundException;
import org.apache.ignite.plugin.PluginProvider;
import org.apache.ignite.thread.IgniteStripedThreadPoolExecutor;
@@ -655,4 +656,9 @@ public interface GridKernalContext extends Iterable<GridComponent> {
* @return subscription processor to manage internal-only (strict node-local) subscriptions between components.
*/
public GridInternalSubscriptionProcessor internalSubscriptionProcessor();
+
+ /**
+ * @return class name filter for marshaller.
+ */
+ public IgnitePredicate<String> classNameFilter();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index 36c6231..61d0dd1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -91,6 +91,7 @@ import org.apache.ignite.internal.util.tostring.GridToStringInclude;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.plugin.PluginNotFoundException;
import org.apache.ignite.plugin.PluginProvider;
import org.apache.ignite.thread.IgniteStripedThreadPoolExecutor;
@@ -385,6 +386,9 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
/** */
private GridInternalSubscriptionProcessor internalSubscriptionProc;
+ /** Class name filter. */
+ private IgnitePredicate<String> clsFilter;
+
/**
* No-arg constructor is required by externalization.
*/
@@ -438,7 +442,8 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
ExecutorService qryExecSvc,
ExecutorService schemaExecSvc,
@Nullable Map<String, ? extends ExecutorService> customExecSvcs,
- List<PluginProvider> plugins
+ List<PluginProvider> plugins,
+ IgnitePredicate<String> clsFilter
) {
assert grid != null;
assert cfg != null;
@@ -463,6 +468,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
this.qryExecSvc = qryExecSvc;
this.schemaExecSvc = schemaExecSvc;
this.customExecSvcs = customExecSvcs;
+ this.clsFilter = clsFilter;
marshCtx = new MarshallerContextImpl(plugins);
@@ -1092,6 +1098,11 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
}
/** {@inheritDoc} */
+ @Override public IgnitePredicate<String> classNameFilter() {
+ return clsFilter;
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridKernalContextImpl.class, this);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 16698b5..3094963 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -17,10 +17,14 @@
package org.apache.ignite.internal;
+import java.io.BufferedReader;
import java.io.Externalizable;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.InvalidObjectException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
@@ -259,6 +263,8 @@ import static org.apache.ignite.internal.IgniteVersionUtils.VER;
import static org.apache.ignite.internal.IgniteVersionUtils.VER_STR;
import static org.apache.ignite.lifecycle.LifecycleEventType.AFTER_NODE_START;
import static org.apache.ignite.lifecycle.LifecycleEventType.BEFORE_NODE_START;
+import static org.apache.ignite.marshaller.MarshallerUtils.CLS_NAMES_FILE;
+import static org.apache.ignite.marshaller.MarshallerUtils.JDK_CLS_NAMES_FILE;
/**
* Ignite kernal.
@@ -834,7 +840,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
qryExecSvc,
schemaExecSvc,
customExecSvcs,
- plugins
+ plugins,
+ classNameFilter()
);
cfg.getMarshaller().setContext(ctx.marshallerContext());
@@ -1685,6 +1692,104 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
}
/**
+ * Returns class name filter for marshaller.
+ * @return Class name filter for marshaller.
+ */
+ private IgnitePredicate<String> classNameFilter() throws IgniteCheckedException {
+ ClassSet whiteList = classWhiteList();
+ ClassSet blackList = classBlackList();
+
+ return new IgnitePredicate<String>() {
+ @Override public boolean apply(String s) {
+ // Allows all primitive arrays and checks arrays' type.
+ if ((blackList != null || whiteList != null) && s.charAt(0) == '[') {
+ if (s.charAt(1) == 'L' && s.length() > 2)
+ s = s.substring(2, s.length() - 1);
+ else
+ return true;
+ }
+
+ return (blackList == null || !blackList.contains(s)) && (whiteList == null || whiteList.contains(s));
+ }
+ };
+ }
+
+ /**
+ * @return White list of classes.
+ */
+ private ClassSet classWhiteList() throws IgniteCheckedException {
+ ClassSet clsSet = null;
+
+ String fileName = IgniteSystemProperties.getString(IgniteSystemProperties.IGNITE_MARSHALLER_WHITELIST);
+
+ if (fileName != null) {
+ clsSet = new ClassSet();
+
+ addClassNames(JDK_CLS_NAMES_FILE, clsSet);
+ addClassNames(CLS_NAMES_FILE, clsSet);
+ addClassNames(fileName, clsSet);
+ }
+
+ return clsSet;
+ }
+
+ /**
+ * @return Black list of classes.
+ */
+ private ClassSet classBlackList() throws IgniteCheckedException {
+ ClassSet clsSet = null;
+
+ String blackListFileName = IgniteSystemProperties.getString(IgniteSystemProperties.IGNITE_MARSHALLER_BLACKLIST);
+
+ if (blackListFileName != null)
+ addClassNames(blackListFileName, clsSet = new ClassSet());
+
+ return clsSet;
+ }
+
+
+ /**
+ * Reads class names from resource referred by given system property name and returns set of classes.
+ * @param fileName File name containing list of classes.
+ * @param clsSet Class set for update.
+ * @return Set of classes.
+ */
+ private void addClassNames(String fileName, ClassSet clsSet) throws IgniteCheckedException {
+ InputStream is = this.getClass().getClassLoader().getResourceAsStream(fileName);
+
+ if (is == null) {
+ try {
+ is = new FileInputStream(new File(fileName));
+ }
+ catch (FileNotFoundException e) {
+ throw new IgniteCheckedException("File " + fileName + " not found.");
+ }
+ }
+
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
+ String line;
+
+ for (int i = 1; (line = reader.readLine()) != null; i++) {
+ String s = line.trim();
+
+ if (!s.isEmpty() && s.charAt(0) != '#' && s.charAt(0) != '[') {
+ try {
+ clsSet.add(s);
+ }
+ catch (IllegalArgumentException e) {
+ throw new IgniteCheckedException("Exception occurred while reading list of classes" +
+ "[path=" + fileName + ", row=" + i + ", line=" + s + ']', e);
+ }
+ }
+ }
+ }
+ catch (IOException e) {
+ throw new IgniteCheckedException("Exception occurred while reading and creating list of classes " +
+ "[path=" + fileName + ']', e);
+ }
+ }
+
+ /**
* Add helper.
*
* @param helper Helper.
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index 08661a3..8b0dc4f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -57,18 +57,14 @@ import org.jetbrains.annotations.Nullable;
import org.jsr166.ConcurrentHashMap8;
import static org.apache.ignite.internal.MarshallerPlatformIds.JAVA_ID;
+import static org.apache.ignite.marshaller.MarshallerUtils.CLS_NAMES_FILE;
+import static org.apache.ignite.marshaller.MarshallerUtils.JDK_CLS_NAMES_FILE;
/**
* Marshaller context implementation.
*/
public class MarshallerContextImpl implements MarshallerContext {
/** */
- private static final String CLS_NAMES_FILE = "META-INF/classnames.properties";
-
- /** */
- private static final String JDK_CLS_NAMES_FILE = "META-INF/classnames-jdk.properties";
-
- /** */
private final Map<Integer, MappedName> sysTypesMap = new HashMap<>();
/** */
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java
index fa3f7f3..92a6e6d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneGridKernalContext.java
@@ -84,6 +84,7 @@ import org.apache.ignite.internal.suggestions.GridPerformanceSuggestions;
import org.apache.ignite.internal.util.IgniteExceptionRegistry;
import org.apache.ignite.internal.util.StripedExecutor;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.plugin.PluginNotFoundException;
import org.apache.ignite.plugin.PluginProvider;
@@ -628,4 +629,9 @@ public class StandaloneGridKernalContext implements GridKernalContext {
@NotNull @Override public Iterator<GridComponent> iterator() {
return null;
}
+
+ /** {@inheritDoc} */
+ @Override public IgnitePredicate<String> classNameFilter() {
+ return null;
+ }
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 0f6a41a..238030a 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -8532,6 +8532,18 @@ public abstract class IgniteUtils {
* @throws ClassNotFoundException If class not found.
*/
public static Class<?> forName(String clsName, @Nullable ClassLoader ldr) throws ClassNotFoundException {
+ return U.forName(clsName, ldr, null);
+ }
+
+ /**
+ * Gets class for provided name. Accepts primitive types names.
+ *
+ * @param clsName Class name.
+ * @param ldr Class loader.
+ * @return Class.
+ * @throws ClassNotFoundException If class not found.
+ */
+ public static Class<?> forName(String clsName, @Nullable ClassLoader ldr, IgnitePredicate<String> clsFilter) throws ClassNotFoundException {
assert clsName != null;
Class<?> cls = primitiveMap.get(clsName);
@@ -8558,6 +8570,9 @@ public abstract class IgniteUtils {
cls = ldrMap.get(clsName);
if (cls == null) {
+ if (clsFilter != null && !clsFilter.apply(clsName))
+ throw new RuntimeException("Deserialization of class " + clsName + " is disallowed.");
+
Class old = ldrMap.putIfAbsent(clsName, cls = Class.forName(clsName, true, ldr));
if (old != null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java
index ad63702..bec1f57 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/MarshallerUtils.java
@@ -25,6 +25,12 @@ import org.jetbrains.annotations.Nullable;
* Utility marshaller methods.
*/
public class MarshallerUtils {
+ /** Jdk class names file. */
+ public static final String JDK_CLS_NAMES_FILE = "META-INF/classnames-jdk.properties";
+
+ /** Class names file. */
+ public static final String CLS_NAMES_FILE = "META-INF/classnames.properties";
+
/** Job sender node version. */
private static final ThreadLocal<IgniteProductVersion> JOB_SND_NODE_VER = new ThreadLocal<>();
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java b/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java
index 6759c40..ae4033b 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshaller.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.util.io.GridByteArrayInputStream;
import org.apache.ignite.internal.util.io.GridByteArrayOutputStream;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller;
import org.jetbrains.annotations.Nullable;
@@ -67,6 +68,23 @@ import org.jetbrains.annotations.Nullable;
* For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
*/
public class JdkMarshaller extends AbstractNodeNameAwareMarshaller {
+ /** Class name filter. */
+ private final IgnitePredicate<String> clsFilter;
+
+ /**
+ * Default constructor.
+ */
+ public JdkMarshaller() {
+ this(null);
+ }
+
+ /**
+ * @param clsFilter Class name filter.
+ */
+ public JdkMarshaller(IgnitePredicate<String> clsFilter) {
+ this.clsFilter = clsFilter;
+ }
+
/** {@inheritDoc} */
@Override protected void marshal0(@Nullable Object obj, OutputStream out) throws IgniteCheckedException {
assert out != null;
@@ -116,7 +134,7 @@ public class JdkMarshaller extends AbstractNodeNameAwareMarshaller {
ObjectInputStream objIn = null;
try {
- objIn = new JdkMarshallerObjectInputStream(new JdkMarshallerInputStreamWrapper(in), clsLdr);
+ objIn = new JdkMarshallerObjectInputStream(new JdkMarshallerInputStreamWrapper(in), clsLdr, clsFilter);
return (T)objIn.readObject();
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshallerObjectInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshallerObjectInputStream.java b/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshallerObjectInputStream.java
index 03256e0..d9fdd3d 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshallerObjectInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/jdk/JdkMarshallerObjectInputStream.java
@@ -22,6 +22,7 @@ import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgnitePredicate;
/**
* This class defines custom JDK object input stream.
@@ -30,17 +31,21 @@ class JdkMarshallerObjectInputStream extends ObjectInputStream {
/** */
private final ClassLoader clsLdr;
+ /** Class name filter. */
+ private final IgnitePredicate<String> clsFilter;
+
/**
* @param in Parent input stream.
* @param clsLdr Custom class loader.
* @throws IOException If initialization failed.
*/
- JdkMarshallerObjectInputStream(InputStream in, ClassLoader clsLdr) throws IOException {
+ JdkMarshallerObjectInputStream(InputStream in, ClassLoader clsLdr, IgnitePredicate<String> clsFilter) throws IOException {
super(in);
assert clsLdr != null;
this.clsLdr = clsLdr;
+ this.clsFilter = clsFilter;
enableResolveObject(true);
}
@@ -51,7 +56,7 @@ class JdkMarshallerObjectInputStream extends ObjectInputStream {
// Must have 'Class.forName()' instead of clsLoader.loadClass()
// due to weird ClassNotFoundExceptions for arrays of classes
// in certain cases.
- return U.forName(desc.getName(), clsLdr);
+ return U.forName(desc.getName(), clsLdr, clsFilter);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 713bbab..34b8fdf 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -55,6 +55,7 @@ import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.AddressResolver;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.X;
@@ -333,7 +334,7 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi {
protected volatile long gridStartTime;
/** Marshaller. */
- private final Marshaller marsh = new JdkMarshaller();
+ private Marshaller marsh;
/** Statistics. */
protected final TcpDiscoveryStatistics stats = new TcpDiscoveryStatistics();
@@ -551,6 +552,11 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi {
if (ignite != null) {
setLocalAddress(ignite.configuration().getLocalHost());
setAddressResolver(ignite.configuration().getAddressResolver());
+
+ if (ignite instanceof IgniteKernal) // IgniteMock instance can be injected from tests.
+ marsh = new JdkMarshaller(((IgniteKernal)ignite).context().classNameFilter());
+ else
+ marsh = new JdkMarshaller();
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java b/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java
index 3f1dfad..49f0c15 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/StreamAdapter.java
@@ -46,7 +46,7 @@ public abstract class StreamAdapter<T, K, V> {
private IgniteDataStreamer<K, V> stmr;
/** Ignite. */
- private Ignite ignite;
+ protected Ignite ignite;
/**
* Empty constructor.
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java b/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java
index f45423b..827c8d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java
+++ b/modules/core/src/main/java/org/apache/ignite/stream/socket/SocketStreamer.java
@@ -24,6 +24,7 @@ import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.IgniteDataStreamer;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.util.nio.GridBufferedParser;
import org.apache.ignite.internal.util.nio.GridDelimitedParser;
import org.apache.ignite.internal.util.nio.GridNioCodecFilter;
@@ -38,6 +39,7 @@ import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.marshaller.MarshallerUtils;
+import org.apache.ignite.marshaller.jdk.JdkMarshaller;
import org.apache.ignite.stream.StreamAdapter;
import org.apache.ignite.stream.StreamTupleExtractor;
import org.jetbrains.annotations.Nullable;
@@ -217,7 +219,7 @@ public class SocketStreamer<T, K, V> extends StreamAdapter<T, K, V> {
/**
* Converts message to Java object using Jdk marshaller.
*/
- private static class DefaultConverter<T> implements SocketMessageConverter<T> {
+ private class DefaultConverter<T> implements SocketMessageConverter<T> {
/** Marshaller. */
private final Marshaller marsh;
@@ -227,7 +229,9 @@ public class SocketStreamer<T, K, V> extends StreamAdapter<T, K, V> {
* @param igniteInstanceName Ignite instance name.
*/
private DefaultConverter(@Nullable String igniteInstanceName) {
- marsh = MarshallerUtils.jdkMarshaller(igniteInstanceName);
+ marsh = new JdkMarshaller(((IgniteKernal)ignite).context().classNameFilter());
+
+ MarshallerUtils.setNodeName(marsh, igniteInstanceName);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/config/class_list_exploit_excluded.txt
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/class_list_exploit_excluded.txt b/modules/core/src/test/config/class_list_exploit_excluded.txt
new file mode 100644
index 0000000..d2657e8
--- /dev/null
+++ b/modules/core/src/test/config/class_list_exploit_excluded.txt
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+# Intentionally empty.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/config/class_list_exploit_included.txt
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/class_list_exploit_included.txt b/modules/core/src/test/config/class_list_exploit_included.txt
new file mode 100644
index 0000000..9a07d54
--- /dev/null
+++ b/modules/core/src/test/config/class_list_exploit_included.txt
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
+org.apache.ignite.spi.discovery.tcp.DiscoveryUnmarshalVulnerabilityTest$Exploit
+org.apache.ignite.stream.socket.SocketStreamerUnmarshalVulnerabilityTest$Exploit
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/java/org/apache/ignite/internal/ClassSetTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/ClassSetTest.java b/modules/core/src/test/java/org/apache/ignite/internal/ClassSetTest.java
new file mode 100644
index 0000000..c51957a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/ClassSetTest.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.internal;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for {@link ClassSet} class.
+ */
+public class ClassSetTest extends TestCase {
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAddAndContains() throws Exception {
+ ClassSet clsSet = new ClassSet();
+
+ clsSet.add("org.apache.ignite.Ignite");
+
+ assertTrue(clsSet.contains("org.apache.ignite.Ignite"));
+ assertFalse(clsSet.contains("org.apache.ignite.NotIgnite"));
+ assertFalse(clsSet.contains("org.apache.Ignite"));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAddWithMaskAndContains() throws Exception {
+ ClassSet clsSet = new ClassSet();
+
+ clsSet.add("org.apache.ignite.*");
+
+ assertTrue(clsSet.contains("org.apache.ignite.Ignite"));
+ assertTrue(clsSet.contains("org.apache.ignite.NotIgnite"));
+ assertFalse(clsSet.contains("org.apache.Ignite"));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReduceOnAddWithMask() throws Exception {
+ ClassSet clsSet = new ClassSet();
+
+ clsSet.add("org.apache.ignite.Ignite");
+ clsSet.add("org.apache.ignite.Ignition");
+
+ assertTrue(clsSet.contains("org.apache.ignite.Ignite"));
+ assertTrue(clsSet.contains("org.apache.ignite.Ignition"));
+ assertFalse(clsSet.contains("org.apache.ignite.NotIgnite"));
+
+ clsSet.add("org.apache.ignite.*");
+
+ assertTrue(clsSet.contains("org.apache.ignite.Ignite"));
+ assertTrue(clsSet.contains("org.apache.ignite.Ignition"));
+ assertTrue(clsSet.contains("org.apache.ignite.NotIgnite"));
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/DiscoveryUnmarshalVulnerabilityTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/DiscoveryUnmarshalVulnerabilityTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/DiscoveryUnmarshalVulnerabilityTest.java
new file mode 100644
index 0000000..448c9af
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/DiscoveryUnmarshalVulnerabilityTest.java
@@ -0,0 +1,180 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.spi.discovery.tcp;
+
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.marshaller.jdk.JdkMarshaller;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHALLER_BLACKLIST;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHALLER_WHITELIST;
+
+/**
+ * Tests for whitelist and blacklist ot avoiding deserialization vulnerability.
+ */
+public class DiscoveryUnmarshalVulnerabilityTest extends GridCommonAbstractTest {
+ /** Marshaller. */
+ private static final JdkMarshaller MARSH = new JdkMarshaller();
+
+ /** Shared value. */
+ private static final AtomicBoolean SHARED = new AtomicBoolean();
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ super.beforeTest();
+
+ SHARED.set(false);
+
+ System.clearProperty(IGNITE_MARSHALLER_WHITELIST);
+ System.clearProperty(IGNITE_MARSHALLER_BLACKLIST);
+
+ IgniteUtils.clearClassCache();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testNoLists() throws Exception {
+ testExploit(true);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testWhiteListIncluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_WHITELIST, path);
+
+ testExploit(true);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testWhiteListExcluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_excluded.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_WHITELIST, path);
+
+ testExploit(false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testBlackListIncluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_BLACKLIST, path);
+
+ testExploit(false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testBlackListExcluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_excluded.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_BLACKLIST, path);
+
+ testExploit(true);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testBothListIncluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_WHITELIST, path);
+ System.setProperty(IGNITE_MARSHALLER_BLACKLIST, path);
+
+ testExploit(false);
+ }
+
+ /**
+ * @param positive Positive.
+ */
+ private void testExploit(boolean positive) throws Exception {
+ try {
+ startGrid();
+
+ attack(marshal(new Exploit()));
+
+ boolean res = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return SHARED.get();
+ }
+ }, 3000L);
+
+ if (positive)
+ assertTrue(res);
+ else
+ assertFalse(res);
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /**
+ * @param obj Object.
+ */
+ private static byte[] marshal(Object obj) throws IgniteCheckedException {
+ return MARSH.marshal(obj);
+ }
+
+ /**
+ * @param data Data.
+ */
+ private void attack(byte[] data) throws IOException {
+ InetAddress addr = InetAddress.getLoopbackAddress();
+
+ try (
+ Socket sock = new Socket(addr, 47500);
+ OutputStream oos = new BufferedOutputStream(sock.getOutputStream())
+ ) {
+ oos.write(U.IGNITE_HEADER);
+ oos.write(data);
+ }
+ }
+
+ /** */
+ private static class Exploit implements Serializable {
+ /**
+ * @param is Input stream.
+ */
+ private void readObject(ObjectInputStream is) throws ClassNotFoundException, IOException {
+ SHARED.set(true);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerUnmarshalVulnerabilityTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerUnmarshalVulnerabilityTest.java b/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerUnmarshalVulnerabilityTest.java
new file mode 100644
index 0000000..dadc5b6
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/stream/socket/SocketStreamerUnmarshalVulnerabilityTest.java
@@ -0,0 +1,222 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.stream.socket;
+
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.marshaller.Marshaller;
+import org.apache.ignite.marshaller.jdk.JdkMarshaller;
+import org.apache.ignite.stream.StreamSingleTupleExtractor;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHALLER_BLACKLIST;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHALLER_WHITELIST;
+
+/**
+ * Tests for whitelist and blacklist ot avoiding deserialization vulnerability.
+ */
+public class SocketStreamerUnmarshalVulnerabilityTest extends GridCommonAbstractTest {
+ /** Shared value. */
+ private static final AtomicBoolean SHARED = new AtomicBoolean();
+
+ /** Port. */
+ private static int port;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ try (ServerSocket sock = new ServerSocket(0)) {
+ port = sock.getLocalPort();
+ }
+
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ cfg.setCacheConfiguration(defaultCacheConfiguration());
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ super.beforeTest();
+
+ SHARED.set(false);
+
+ System.clearProperty(IGNITE_MARSHALLER_WHITELIST);
+ System.clearProperty(IGNITE_MARSHALLER_BLACKLIST);
+
+ IgniteUtils.clearClassCache();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testNoLists() throws Exception {
+ testExploit(true);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testWhiteListIncluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_WHITELIST, path);
+
+ testExploit(true);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testWhiteListExcluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_excluded.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_WHITELIST, path);
+
+ testExploit(false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testBlackListIncluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_BLACKLIST, path);
+
+ testExploit(false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testBlackListExcluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_excluded.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_BLACKLIST, path);
+
+ testExploit(true);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testBothListIncluded() throws Exception {
+ String path = U.resolveIgnitePath("modules/core/src/test/config/class_list_exploit_included.txt").getPath();
+
+ System.setProperty(IGNITE_MARSHALLER_WHITELIST, path);
+ System.setProperty(IGNITE_MARSHALLER_BLACKLIST, path);
+
+ testExploit(false);
+ }
+
+ /**
+ * @param positive Positive.
+ */
+ private void testExploit(boolean positive) throws Exception {
+ try {
+ Ignite ignite = startGrid();
+
+ SocketStreamer<Exploit, Integer, String> sockStmr = null;
+
+ try (IgniteDataStreamer<Integer, String> stmr = ignite.dataStreamer(DEFAULT_CACHE_NAME)) {
+ stmr.allowOverwrite(true);
+ stmr.autoFlushFrequency(10);
+
+ sockStmr = new SocketStreamer<>();
+
+ sockStmr.setIgnite(ignite);
+
+ sockStmr.setStreamer(stmr);
+
+ sockStmr.setPort(port);
+
+ sockStmr.setSingleTupleExtractor(new StreamSingleTupleExtractor<Exploit, Integer, String>() {
+ @Override public Map.Entry<Integer, String> extract(Exploit msg) {
+ return new IgniteBiTuple<>(1, "val");
+ }
+ });
+
+ sockStmr.start();
+
+ try (Socket sock = new Socket(InetAddress.getLocalHost(), port);
+ OutputStream os = new BufferedOutputStream(sock.getOutputStream())) {
+ Marshaller marsh = new JdkMarshaller();
+
+ byte[] msg = marsh.marshal(new Exploit());
+
+ os.write(msg.length >>> 24);
+ os.write(msg.length >>> 16);
+ os.write(msg.length >>> 8);
+ os.write(msg.length);
+
+ os.write(msg);
+ }
+ catch (IOException | IgniteCheckedException e) {
+ throw new IgniteException(e);
+ }
+
+ boolean res = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return SHARED.get();
+ }
+ }, 3000L);
+
+ if (positive)
+ assertTrue(res);
+ else
+ assertFalse(res);
+ }
+ finally {
+ if (sockStmr != null)
+ sockStmr.stop();
+ }
+ }
+ finally {
+ stopAllGrids();
+ }
+ }
+
+ /** */
+ private static class Exploit implements Serializable {
+ /**
+ * @param is Input stream.
+ */
+ private void readObject(ObjectInputStream is) throws ClassNotFoundException, IOException {
+ SHARED.set(true);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
index 6b39faa..cfc0abe 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
@@ -32,6 +32,7 @@ import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.plugin.PluginProvider;
import org.apache.ignite.testframework.GridTestUtils;
@@ -78,7 +79,8 @@ public class GridTestKernalContext extends GridKernalContextImpl {
null,
null,
null,
- U.allPluginProviders()
+ U.allPluginProviders(),
+ null
);
GridTestUtils.setFieldValue(grid(), "cfg", config());
@@ -132,6 +134,11 @@ public class GridTestKernalContext extends GridKernalContextImpl {
}
/** {@inheritDoc} */
+ @Override public IgnitePredicate<String> classNameFilter() {
+ return super.classNameFilter();
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridTestKernalContext.class, this, super.toString());
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index 1b4e2da..9fee224 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -20,6 +20,7 @@ package org.apache.ignite.testsuites;
import java.util.Set;
import junit.framework.TestSuite;
import org.apache.ignite.GridSuppressedExceptionSelfTest;
+import org.apache.ignite.internal.ClassSetTest;
import org.apache.ignite.internal.ClusterGroupHostsSelfTest;
import org.apache.ignite.internal.ClusterGroupSelfTest;
import org.apache.ignite.internal.GridFailFastNodeFailureDetectionSelfTest;
@@ -191,6 +192,8 @@ public class IgniteBasicTestSuite extends TestSuite {
suite.addTestSuite(GridCleanerTest.class);
+ suite.addTestSuite(ClassSetTest.class);
+
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
index 626875c..6e51c36 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteSpiDiscoverySelfTestSuite.java
@@ -21,6 +21,7 @@ import junit.framework.TestSuite;
import org.apache.ignite.spi.GridTcpSpiForwardingSelfTest;
import org.apache.ignite.spi.discovery.AuthenticationRestartTest;
import org.apache.ignite.spi.discovery.IgniteDiscoveryCacheReuseSelfTest;
+import org.apache.ignite.spi.discovery.tcp.DiscoveryUnmarshalVulnerabilityTest;
import org.apache.ignite.spi.discovery.tcp.IgniteClientConnectTest;
import org.apache.ignite.spi.discovery.tcp.IgniteClientReconnectMassiveShutdownTest;
import org.apache.ignite.spi.discovery.tcp.TcpClientDiscoveryMarshallerCheckSelfTest;
@@ -111,6 +112,8 @@ public class IgniteSpiDiscoverySelfTestSuite extends TestSuite {
// Disco cache reuse.
suite.addTest(new TestSuite(IgniteDiscoveryCacheReuseSelfTest.class));
+ suite.addTest(new TestSuite(DiscoveryUnmarshalVulnerabilityTest.class));
+
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/38a48831/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamSelfTestSuite.java
index d7c677c..9eac277 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteStreamSelfTestSuite.java
@@ -19,6 +19,7 @@ package org.apache.ignite.testsuites;
import junit.framework.TestSuite;
import org.apache.ignite.stream.socket.SocketStreamerSelfTest;
+import org.apache.ignite.stream.socket.SocketStreamerUnmarshalVulnerabilityTest;
/**
* Stream test suite.
@@ -32,6 +33,7 @@ public class IgniteStreamSelfTestSuite extends TestSuite {
TestSuite suite = new TestSuite("Ignite Stream Test Suite");
suite.addTest(new TestSuite(SocketStreamerSelfTest.class));
+ suite.addTest(new TestSuite(SocketStreamerUnmarshalVulnerabilityTest.class));
return suite;
}
[04/11] ignite git commit: IGNITE-7505 Node not in baseline should
not initialize local partition
Posted by ag...@apache.org.
IGNITE-7505 Node not in baseline should not initialize local partition
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8d42789f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8d42789f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8d42789f
Branch: refs/heads/ignite-6643
Commit: 8d42789fd58903587c2d3fa708b14248d5665993
Parents: a6840b5
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Wed Jan 24 10:28:20 2018 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Wed Jan 24 10:28:20 2018 +0300
----------------------------------------------------------------------
.../internal/managers/discovery/DiscoCache.java | 8 +++++++
.../dht/GridDhtPartitionTopologyImpl.java | 22 ++++++++++++++------
.../GridDhtPartitionsExchangeFuture.java | 1 +
.../GridCacheDatabaseSharedManager.java | 7 +++++--
.../IgniteCacheDatabaseSharedManager.java | 7 +++++++
.../IgniteClusterActivateDeactivateTest.java | 4 ++--
6 files changed, 39 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/8d42789f/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
index aa47168..f73f420 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
@@ -213,6 +213,14 @@ public class DiscoCache {
return baselineNodes;
}
+ /**
+ * @param nodeId Node ID to check.
+ * @return {@code True} if baseline is not set or the node is in the baseline topology.
+ */
+ public boolean baselineNode(UUID nodeId) {
+ return nodeIdToConsIdx == null || nodeIdToConsIdx.containsKey(nodeId);
+ }
+
/** @return All nodes. */
public List<ClusterNode> allNodes() {
return allNodes;
http://git-wip-us.apache.org/repos/asf/ignite/blob/8d42789f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index 9ccaecf..0a2c154 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -359,12 +359,7 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
assert exchId.isJoined() || added;
for (int p = 0; p < num; p++) {
- IgnitePageStoreManager storeMgr = ctx.pageStore();
-
- if (localNode(p, aff)
- || (storeMgr instanceof FilePageStoreManager
- && grp.persistenceEnabled()
- && Files.exists(((FilePageStoreManager)storeMgr).getPath(grp.sharedGroup(), grp.cacheOrGroupName(), p)))) {
+ if (localNode(p, aff) || initLocalPartition(p, discoCache)) {
GridDhtLocalPartition locPart = createPartition(p);
if (grp.persistenceEnabled()) {
@@ -431,6 +426,21 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
/**
+ * @param p Partition ID to restore.
+ * @param discoCache Disco cache to use.
+ * @return {@code True} if should restore local partition.
+ */
+ private boolean initLocalPartition(int p, DiscoCache discoCache) {
+ IgnitePageStoreManager storeMgr = ctx.pageStore();
+
+ return
+ grp.persistenceEnabled() &&
+ storeMgr instanceof FilePageStoreManager &&
+ discoCache.baselineNode(ctx.localNodeId()) &&
+ Files.exists(((FilePageStoreManager)storeMgr).getPath(grp.sharedGroup(), grp.cacheOrGroupName(), p));
+ }
+
+ /**
* @param affVer Affinity version.
* @param aff Affinity assignments.
* @param updateSeq Update sequence.
http://git-wip-us.apache.org/repos/asf/ignite/blob/8d42789f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 883cac6..6c09b6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1577,6 +1577,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
}
cctx.database().releaseHistoryForExchange();
+ cctx.database().rebuildIndexesIfNeeded(this);
if (err == null) {
for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/8d42789f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 205365b..a636464 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -1126,7 +1126,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
// Before local node join event.
if (clusterInTransitionStateToActive || (joinEvt && locNode && isSrvNode))
restoreState();
+ }
+ /** {@inheritDoc} */
+ @Override public void rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture fut) {
if (cctx.kernalContext().query().moduleEnabled()) {
for (final GridCacheContext cacheCtx : (Collection<GridCacheContext>)cctx.cacheContexts()) {
if (cacheCtx.startTopologyVersion().equals(fut.initialVersion()) &&
@@ -1145,8 +1148,8 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
CacheConfiguration ccfg = cacheCtx.config();
if (ccfg != null) {
- log().info("Finished indexes rebuilding for cache: [name=" + ccfg.getName()
- + ", grpName=" + ccfg.getGroupName());
+ log().info("Finished indexes rebuilding for cache [name=" + ccfg.getName()
+ + ", grpName=" + ccfg.getGroupName() + ']');
}
}
});
http://git-wip-us.apache.org/repos/asf/ignite/blob/8d42789f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
index 237dacc..3242e74 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
@@ -753,6 +753,13 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
}
/**
+ * @param fut Partition exchange future.
+ */
+ public void rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture fut) {
+ // No-op.
+ }
+
+ /**
* Needed action before any cache will stop
*/
public void prepareCachesStop() {
http://git-wip-us.apache.org/repos/asf/ignite/blob/8d42789f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
index 27739a2..71718c9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
@@ -124,11 +124,11 @@ public class IgniteClusterActivateDeactivateTest extends GridCommonAbstractTest
DataStorageConfiguration memCfg = new DataStorageConfiguration();
memCfg.setPageSize(4 * 1024);
memCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
- .setMaxSize(10 * 1024 * 1024)
+ .setMaxSize(300 * 1024 * 1024)
.setPersistenceEnabled(persistenceEnabled()));
memCfg.setDataRegionConfigurations(new DataRegionConfiguration()
- .setMaxSize(10 * 1024 * 1024)
+ .setMaxSize(300 * 1024 * 1024)
.setName(NO_PERSISTENCE_REGION)
.setPersistenceEnabled(false));
[06/11] ignite git commit: Versions updated to 2.5-SNAPSHOT
Posted by ag...@apache.org.
Versions updated to 2.5-SNAPSHOT
Signed-off-by: Anton Vinogradov <av...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/09a94e8a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/09a94e8a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/09a94e8a
Branch: refs/heads/ignite-6643
Commit: 09a94e8afe7d8be1ecb4171f003228360dc0e6d9
Parents: fa15645
Author: Anton Vinogradov <av...@apache.org>
Authored: Wed Jan 24 12:18:12 2018 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Wed Jan 24 12:18:12 2018 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/apache-license-gen/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/benchmarks/pom.xml | 2 +-
modules/camel/pom.xml | 2 +-
modules/cassandra/pom.xml | 2 +-
modules/cassandra/serializers/pom.xml | 4 ++--
modules/cassandra/store/pom.xml | 4 ++--
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/compatibility/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/dev-utils/pom.xml | 2 +-
modules/direct-io/pom.xml | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/platform/pom.xml | 2 +-
modules/extdata/uri/modules/uri-dependency/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/flink/pom.xml | 2 +-
modules/flume/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate-4.2/pom.xml | 2 +-
modules/hibernate-5.1/pom.xml | 2 +-
modules/hibernate-core/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jms11/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/kafka/pom.xml | 2 +-
modules/kubernetes/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/log4j2/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/ml/pom.xml | 2 +-
modules/mqtt/pom.xml | 2 +-
modules/osgi-karaf/pom.xml | 2 +-
modules/osgi-paxlogging/pom.xml | 2 +-
modules/osgi/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/rocketmq/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring-data/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/sqlline/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/storm/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/twitter/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web-console/pom.xml | 2 +-
modules/web-console/web-agent/pom.xml | 2 +-
modules/web/ignite-appserver-test/pom.xml | 2 +-
modules/web/ignite-websphere-test/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
modules/yarn/pom.xml | 2 +-
modules/zeromq/pom.xml | 2 +-
modules/zookeeper/pom.xml | 2 +-
pom.xml | 2 +-
72 files changed, 74 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index f977ebd..a992820 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 3e20931..3e727d9 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index fab20e1..31ab20e 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,7 +31,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-apache-license-gen</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<build>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 1300374..8540b84 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/modules/benchmarks/pom.xml b/modules/benchmarks/pom.xml
index 0caec7c..9e000d4 100644
--- a/modules/benchmarks/pom.xml
+++ b/modules/benchmarks/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-benchmarks</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/camel/pom.xml
----------------------------------------------------------------------
diff --git a/modules/camel/pom.xml b/modules/camel/pom.xml
index 5172ab2..a5017e1 100644
--- a/modules/camel/pom.xml
+++ b/modules/camel/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-camel</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cassandra/pom.xml b/modules/cassandra/pom.xml
index 4d42a7e..e01a955 100644
--- a/modules/cassandra/pom.xml
+++ b/modules/cassandra/pom.xml
@@ -32,7 +32,7 @@
<artifactId>ignite-cassandra</artifactId>
<packaging>pom</packaging>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencyManagement>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/cassandra/serializers/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cassandra/serializers/pom.xml b/modules/cassandra/serializers/pom.xml
index ad32d45..58c08a9 100644
--- a/modules/cassandra/serializers/pom.xml
+++ b/modules/cassandra/serializers/pom.xml
@@ -26,12 +26,12 @@
<parent>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-cassandra</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>ignite-cassandra-serializers</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/cassandra/store/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cassandra/store/pom.xml b/modules/cassandra/store/pom.xml
index 3f6be82..b62050b 100644
--- a/modules/cassandra/store/pom.xml
+++ b/modules/cassandra/store/pom.xml
@@ -26,12 +26,12 @@
<parent>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-cassandra</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>ignite-cassandra-store</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 1ad7980..e75600b 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 249adea..00ec33b 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index bf20d06..345f713 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -32,7 +32,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/compatibility/pom.xml
----------------------------------------------------------------------
diff --git a/modules/compatibility/pom.xml b/modules/compatibility/pom.xml
index 73f1362..a04d734 100644
--- a/modules/compatibility/pom.xml
+++ b/modules/compatibility/pom.xml
@@ -33,7 +33,7 @@
</parent>
<artifactId>ignite-compatibility</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index e946789..68c19a7 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<repositories>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 1f1f4d0..e70660b 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=2.4.0-SNAPSHOT
+ignite.version=2.5.0-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/dev-utils/pom.xml
----------------------------------------------------------------------
diff --git a/modules/dev-utils/pom.xml b/modules/dev-utils/pom.xml
index e57b17d..2a0cf48 100644
--- a/modules/dev-utils/pom.xml
+++ b/modules/dev-utils/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-dev-utils</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/direct-io/pom.xml
----------------------------------------------------------------------
diff --git a/modules/direct-io/pom.xml b/modules/direct-io/pom.xml
index 1d24672..51842c3 100644
--- a/modules/direct-io/pom.xml
+++ b/modules/direct-io/pom.xml
@@ -32,7 +32,7 @@
</parent>
<artifactId>ignite-direct-io</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 9faeac6..02bed30 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/extdata/platform/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/platform/pom.xml b/modules/extdata/platform/pom.xml
index 1b2c900..6fd6189 100644
--- a/modules/extdata/platform/pom.xml
+++ b/modules/extdata/platform/pom.xml
@@ -32,7 +32,7 @@
</parent>
<artifactId>ignite-extdata-platform</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/extdata/uri/modules/uri-dependency/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/modules/uri-dependency/pom.xml b/modules/extdata/uri/modules/uri-dependency/pom.xml
index 10b35f4..100b0c2 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -27,7 +27,7 @@
<artifactId>ignite-extdata-uri-dep</artifactId>
<packaging>jar</packaging>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index d17260a..283e07e 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -32,7 +32,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/flink/pom.xml
----------------------------------------------------------------------
diff --git a/modules/flink/pom.xml b/modules/flink/pom.xml
index 9666793..1013e4c 100644
--- a/modules/flink/pom.xml
+++ b/modules/flink/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-flink</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/flume/pom.xml
----------------------------------------------------------------------
diff --git a/modules/flume/pom.xml b/modules/flume/pom.xml
index 2c09512..dcee0db 100644
--- a/modules/flume/pom.xml
+++ b/modules/flume/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-flume</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index db72308..797d3bb 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 7215092..395c8db 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 6ae792d..5ed3278 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/hibernate-4.2/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate-4.2/pom.xml b/modules/hibernate-4.2/pom.xml
index f32bb45..7765690 100644
--- a/modules/hibernate-4.2/pom.xml
+++ b/modules/hibernate-4.2/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate_4.2</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/hibernate-5.1/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate-5.1/pom.xml b/modules/hibernate-5.1/pom.xml
index 63db544..20390dd 100644
--- a/modules/hibernate-5.1/pom.xml
+++ b/modules/hibernate-5.1/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate_5.1</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/hibernate-core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate-core/pom.xml b/modules/hibernate-core/pom.xml
index 2dd2907..f939f3f 100644
--- a/modules/hibernate-core/pom.xml
+++ b/modules/hibernate-core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate-core</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index f2e1797..d8f5f25 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index dbec550..d973db4 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/jms11/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jms11/pom.xml b/modules/jms11/pom.xml
index a941f6e..321cde4 100644
--- a/modules/jms11/pom.xml
+++ b/modules/jms11/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jms11</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 01160ad..c7cfa25 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index f806cfa..04cb839 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-kafka</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/kubernetes/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kubernetes/pom.xml b/modules/kubernetes/pom.xml
index 3ec8c0d..eef79a0 100644
--- a/modules/kubernetes/pom.xml
+++ b/modules/kubernetes/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-kubernetes</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index f2dc488..88e965c 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/log4j2/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j2/pom.xml b/modules/log4j2/pom.xml
index 574700a..fc8be7f 100644
--- a/modules/log4j2/pom.xml
+++ b/modules/log4j2/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j2</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 792191b..620e1f1 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mesos</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/ml/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ml/pom.xml b/modules/ml/pom.xml
index a20a596..2e64582 100644
--- a/modules/ml/pom.xml
+++ b/modules/ml/pom.xml
@@ -30,7 +30,7 @@
</parent>
<artifactId>ignite-ml</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/mqtt/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mqtt/pom.xml b/modules/mqtt/pom.xml
index bf6404f..b9ec5d7 100644
--- a/modules/mqtt/pom.xml
+++ b/modules/mqtt/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mqtt</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/osgi-karaf/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi-karaf/pom.xml b/modules/osgi-karaf/pom.xml
index 7650b26..42d89be 100644
--- a/modules/osgi-karaf/pom.xml
+++ b/modules/osgi-karaf/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-osgi-karaf</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<packaging>pom</packaging>
<build>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/osgi-paxlogging/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi-paxlogging/pom.xml b/modules/osgi-paxlogging/pom.xml
index 09baec9..b732e94 100644
--- a/modules/osgi-paxlogging/pom.xml
+++ b/modules/osgi-paxlogging/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-osgi-paxlogging</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/osgi/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi/pom.xml b/modules/osgi/pom.xml
index a8b5067..4d92be2 100644
--- a/modules/osgi/pom.xml
+++ b/modules/osgi/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-osgi</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index fe21d5a..d653bfd 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/rocketmq/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rocketmq/pom.xml b/modules/rocketmq/pom.xml
index 9e63109..c28793e 100644
--- a/modules/rocketmq/pom.xml
+++ b/modules/rocketmq/pom.xml
@@ -32,7 +32,7 @@
</parent>
<artifactId>ignite-rocketmq</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index bf51964..b233fdb 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar_2.10</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index b0029d1..a38719b 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 78aee37..f21d4ff 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 332ff24..f506022 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index b973afb..c6145c7 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark_2.10</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index 3f4d96d..6648ea9 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/spring-data/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring-data/pom.xml b/modules/spring-data/pom.xml
index 13e6392..cf0c035 100644
--- a/modules/spring-data/pom.xml
+++ b/modules/spring-data/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring-data</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 743397e..09375a6 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/sqlline/pom.xml
----------------------------------------------------------------------
diff --git a/modules/sqlline/pom.xml b/modules/sqlline/pom.xml
index 30a72db..9c26a15 100644
--- a/modules/sqlline/pom.xml
+++ b/modules/sqlline/pom.xml
@@ -32,7 +32,7 @@
</parent>
<artifactId>ignite-sqlline</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index eb6c779..7b3aee6 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/storm/pom.xml
----------------------------------------------------------------------
diff --git a/modules/storm/pom.xml b/modules/storm/pom.xml
index 0e242da..b78f8f3 100644
--- a/modules/storm/pom.xml
+++ b/modules/storm/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-storm</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index b4f0769..d685c206 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/twitter/pom.xml
----------------------------------------------------------------------
diff --git a/modules/twitter/pom.xml b/modules/twitter/pom.xml
index 75585fb..60708dc 100644
--- a/modules/twitter/pom.xml
+++ b/modules/twitter/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-twitter</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 379c795..d24ead3 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
index f06d139..30c480f 100644
--- a/modules/visor-console-2.10/pom.xml
+++ b/modules/visor-console-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console_2.10</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 5e3b12b..54c2eb3 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 019189e..21ef092 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/web-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web-console/pom.xml b/modules/web-console/pom.xml
index f398378..66a8f50 100644
--- a/modules/web-console/pom.xml
+++ b/modules/web-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web-console</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/web-console/web-agent/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web-console/web-agent/pom.xml b/modules/web-console/web-agent/pom.xml
index 8ae12a3..17deeef 100644
--- a/modules/web-console/web-agent/pom.xml
+++ b/modules/web-console/web-agent/pom.xml
@@ -32,7 +32,7 @@
<artifactId>ignite-web-agent</artifactId>
<packaging>jar</packaging>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/web/ignite-appserver-test/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-appserver-test/pom.xml b/modules/web/ignite-appserver-test/pom.xml
index 44819de..945a274 100644
--- a/modules/web/ignite-appserver-test/pom.xml
+++ b/modules/web/ignite-appserver-test/pom.xml
@@ -30,7 +30,7 @@
<artifactId>ignite-appserver-test</artifactId>
<packaging>jar</packaging>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/web/ignite-websphere-test/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/ignite-websphere-test/pom.xml b/modules/web/ignite-websphere-test/pom.xml
index 45bbbbd..77ea651 100644
--- a/modules/web/ignite-websphere-test/pom.xml
+++ b/modules/web/ignite-websphere-test/pom.xml
@@ -30,7 +30,7 @@
<artifactId>ignite-websphere-test</artifactId>
<packaging>war</packaging>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 460e88d..d5e82c6 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 6327288..8cad24b 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index 8f64890..ce7217b 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yarn</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/zeromq/pom.xml
----------------------------------------------------------------------
diff --git a/modules/zeromq/pom.xml b/modules/zeromq/pom.xml
index 3457254..5ecc6aa 100644
--- a/modules/zeromq/pom.xml
+++ b/modules/zeromq/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-zeromq</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<properties>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/modules/zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/modules/zookeeper/pom.xml b/modules/zookeeper/pom.xml
index d981220..c3c3679 100644
--- a/modules/zookeeper/pom.xml
+++ b/modules/zookeeper/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-zookeeper</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
<dependencies>
http://git-wip-us.apache.org/repos/asf/ignite/blob/09a94e8a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index eab1ec8..4d62d28 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>apache-ignite</artifactId>
- <version>2.4.0-SNAPSHOT</version>
+ <version>2.5.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>