[ignite] branch master updated: IGNITE-13387 Update ignite-gce dependencies

2020-08-28 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 426866c  IGNITE-13387 Update ignite-gce dependencies
426866c is described below

commit 426866c618f0286fae2d41f9fb0d2e0b7495ae94
Author: mstepachev 
AuthorDate: Fri Aug 28 19:11:15 2020 +0300

IGNITE-13387 Update ignite-gce dependencies

Signed-off-by: Ivan Rakov 
---
 modules/gce/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 4725061..9098569 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -44,7 +44,7 @@
 
 com.google.api-client
 google-api-client
-1.22.0
+1.30.10
 
 
 commons-codec



[ignite] branch master updated: IGNITE-13379 Exception occur on SQL caches when client reconnect - Fixes #8178

2020-08-24 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 6180cbe  IGNITE-13379 Exception occur on SQL caches when client 
reconnect - Fixes #8178
6180cbe is described below

commit 6180cbe96c84f16e745d290f06357ad33a16629b
Author: Vladislav Pyatkov 
AuthorDate: Mon Aug 24 17:26:20 2020 +0300

IGNITE-13379 Exception occur on SQL caches when client reconnect - Fixes 
#8178

Signed-off-by: Ivan Rakov 
---
 .../processors/cache/GridCacheProcessor.java   |   6 +
 .../ClientReconnectWithSqlTableConfiguredTest.java | 166 +
 .../testsuites/IgnitePdsWithIndexingTestSuite.java |   4 +-
 3 files changed, 175 insertions(+), 1 deletion(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 0c84fe3..aec5f58 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -915,6 +915,12 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 
 final List stoppedCaches = new ArrayList<>();
 
+// Close SQL caches which were not started by client.
+for (String cacheToStop: reconnectRes.stoppedCaches()) {
+if (!caches.keySet().contains(cacheToStop))
+ctx.query().onCacheStop(cacheToStop);
+}
+
 for (final GridCacheAdapter cache : caches.values()) {
 boolean stopped = 
reconnectRes.stoppedCacheGroups().contains(cache.context().groupId())
 || reconnectRes.stoppedCaches().contains(cache.name());
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ClientReconnectWithSqlTableConfiguredTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ClientReconnectWithSqlTableConfiguredTest.java
new file mode 100644
index 000..1956bb2
--- /dev/null
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ClientReconnectWithSqlTableConfiguredTest.java
@@ -0,0 +1,166 @@
+/*
+ * 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.index;
+
+import java.util.Arrays;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.QueryEntity;
+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.events.Event;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.junit.Test;
+
+import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_RECONNECTED;
+
+/**
+ * Tests for checking reconnect client with SQL caches.
+ */
+public class ClientReconnectWithSqlTableConfiguredTest extends 
AbstractIndexingCommonTest {
+/** True means that the caches belong a same group, or false otherwise. */
+private boolean sameGrp;
+
+/** {@inheritDoc} */
+@Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
+return super.getConfiguration(igniteInstanceName)
+.setConsistentId(igniteInstanceName)
+.setDataStorageConfiguration(new DataStorageConfiguration()
+.setDefaultDataRegionConfiguration(ne

[ignite] branch master updated: IGNITE-13375 Operations started on client nodes are not traced. - Fixes #8170

2020-08-20 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new ccce7be  IGNITE-13375 Operations started on client nodes are not 
traced. - Fixes #8170
ccce7be is described below

commit ccce7be1594944740ef9b4076ace5d26d06ab8cd
Author: Alexander Lapin 
AuthorDate: Thu Aug 20 15:48:31 2020 +0300

IGNITE-13375 Operations started on client nodes are not traced. - Fixes 
#8170

Signed-off-by: Ivan Rakov 
---
 .../ignite/spi/discovery/tcp/ClientImpl.java   |  41 ++-
 .../monitoring/opencensus/AbstractTracingTest.java |  33 ++
 .../opencensus/IgniteOpenCensusSuite.java  |   3 +-
 .../opencensus/OpenCensusDiscoveryTracingTest.java | 339 +
 4 files changed, 413 insertions(+), 3 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 66de170..8d19662 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -70,6 +70,7 @@ import 
org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.IgniteNodeAttributes;
 import org.apache.ignite.internal.managers.discovery.CustomMessageWrapper;
 import 
org.apache.ignite.internal.managers.discovery.DiscoveryServerOnlyCustomMessage;
+import org.apache.ignite.internal.processors.tracing.Span;
 import org.apache.ignite.internal.processors.tracing.SpanTags;
 import org.apache.ignite.internal.processors.tracing.messages.SpanContainer;
 import org.apache.ignite.internal.processors.tracing.messages.TraceableMessage;
@@ -509,7 +510,7 @@ class ClientImpl extends TcpDiscoveryImpl {
 throw new IgniteClientDisconnectedException(null, "Failed to send 
custom message: client is disconnected.");
 
 try {
-TcpDiscoveryAbstractMessage msg;
+TcpDiscoveryCustomEventMessage msg;
 
 if (((CustomMessageWrapper)evt).delegate() instanceof 
DiscoveryServerOnlyCustomMessage)
 msg = new 
TcpDiscoveryServerOnlyCustomEventMessage(getLocalNodeId(), evt,
@@ -518,7 +519,19 @@ class ClientImpl extends TcpDiscoveryImpl {
 msg = new TcpDiscoveryCustomEventMessage(getLocalNodeId(), evt,
 U.marshal(spi.marshaller(), evt));
 
+Span rootSpan = 
tracing.create(TraceableMessagesTable.traceName(msg.getClass()))
+.addTag(SpanTags.tag(SpanTags.EVENT_NODE, SpanTags.ID), () -> 
getLocalNodeId().toString())
+.addTag(SpanTags.tag(SpanTags.EVENT_NODE, 
SpanTags.CONSISTENT_ID),
+() -> locNode.consistentId().toString())
+.addTag(SpanTags.MESSAGE_CLASS, () -> 
((CustomMessageWrapper)evt).delegate().getClass().getSimpleName())
+.addLog(() -> "Created");
+
+// This root span will be parent both from local and remote nodes.
+
msg.spanContainer().serializedSpanBytes(tracing.serialize(rootSpan));
+
 sockWriter.sendMessage(msg);
+
+rootSpan.addLog(() -> "Sent").end();
 }
 catch (IgniteCheckedException e) {
 throw new IgniteSpiException("Failed to marshal custom event: " + 
evt, e);
@@ -1778,11 +1791,21 @@ class ClientImpl extends TcpDiscoveryImpl {
 assert spi.getSpiContext().isStopping();
 
 if (connected && currSock != null) {
-TcpDiscoveryAbstractMessage leftMsg = new 
TcpDiscoveryNodeLeftMessage(getLocalNodeId());
+TcpDiscoveryNodeLeftMessage leftMsg = new 
TcpDiscoveryNodeLeftMessage(getLocalNodeId());
 
 leftMsg.client(true);
 
+Span rootSpan = 
tracing.create(TraceableMessagesTable.traceName(leftMsg.getClass()))
+.addTag(SpanTags.tag(SpanTags.EVENT_NODE, 
SpanTags.ID), () -> locNode.id().toString())
+.addTag(SpanTags.tag(SpanTags.EVENT_NODE, 
SpanTags.CONSISTENT_ID),
+() -> locNode.consistentId().toString())
+.addLog(() -> "Created");
+
+
leftMsg.spanContainer().serializedSpanBytes(tracing.serialize(rootSpan));
+
 sockWriter.sendMessage(leftMsg);
+
+rootSpan.addLog(() -> "Sent").end();
 }
 else
 leaveLatch.countDown();
@@ -2693,6 +2716,20 @@ class ClientImpl extends TcpD

[ignite] branch master updated: IGNITE-13373 WAL segmentns do not released on releaseHistoryForPreloading() - Fixes #8165

2020-08-20 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 06a2348  IGNITE-13373 WAL segmentns do not released on 
releaseHistoryForPreloading() - Fixes #8165
06a2348 is described below

commit 06a234821b0322acbe4c8c359c87540e0f99c8ab
Author: Alexander Lapin 
AuthorDate: Thu Aug 20 15:23:06 2020 +0300

IGNITE-13373 WAL segmentns do not released on releaseHistoryForPreloading() 
- Fixes #8165

Signed-off-by: Ivan Rakov 
---
 .../GridCacheDatabaseSharedManager.java| 124 ++-
 .../persistence/checkpoint/CheckpointHistory.java  |  14 +--
 .../checkpoint/CheckpointHistoryResult.java|  66 ++
 .../WALPreloadingWithCompactionTest.java   | 135 +
 .../ignite/testsuites/IgnitePdsTestSuite2.java |   3 +
 5 files changed, 278 insertions(+), 64 deletions(-)

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 246e363..3716226 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
@@ -42,7 +42,6 @@ import java.util.NoSuchElementException;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
@@ -117,6 +116,7 @@ import 
org.apache.ignite.internal.processors.cache.mvcc.txlog.TxState;
 import 
org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointEntry;
 import 
org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointEntryType;
 import 
org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointHistory;
+import 
org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointHistoryResult;
 import 
org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress;
 import 
org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpointer;
 import 
org.apache.ignite.internal.processors.cache.persistence.checkpoint.ReservationReason;
@@ -264,7 +264,7 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 ReentrantReadWriteLock checkpointLock = new ReentrantReadWriteLock();
 
 /** */
-private CheckpointHistory cpHistory;
+private CheckpointHistory cpHist;
 
 /** */
 private FilePageStoreManager storeMgr;
@@ -301,9 +301,8 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 /** This is the earliest WAL pointer that was reserved during exchange and 
would release after exchange completed. */
 private WALPointer reservedForExchange;
 
-/** */
-private final ConcurrentMap, 
T2>
-reservedForPreloading = new ConcurrentHashMap<>();
+/** This is the earliest WAL pointer that was reserved during preloading. 
*/
+private volatile WALPointer reservedForPreloading;
 
 /** Snapshot manager. */
 private IgniteCacheSnapshotManager snapshotMgr;
@@ -378,8 +377,8 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 cfgCheckpointReadLockTimeout != null
 ? cfgCheckpointReadLockTimeout
 : (ctx.workersRegistry() != null
-? ctx.workersRegistry().getSystemWorkerBlockedTimeout()
-: ctx.config().getFailureDetectionTimeout()));
+? ctx.workersRegistry().getSystemWorkerBlockedTimeout()
+: ctx.config().getFailureDetectionTimeout()));
 }
 
 /**
@@ -483,7 +482,7 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 if (!kernalCtx.clientNode()) {
 
kernalCtx.internalSubscriptionProcessor().registerDatabaseListener(new 
MetastorageRecoveryLifecycle());
 
-cpHistory = new CheckpointHistory(kernalCtx);
+cpHist = new CheckpointHistory(kernalCtx);
 
 IgnitePageStoreManager store = cctx.pageStore();
 
@@ -509,7 +508,7 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 snapshotMgr,
 checkpointLock,
 cctx.wal(),
-cpHistory,
+cpHist,
 persistentStoreMetricsImpl(),
 this::dataRegions,
 ioFactory,
@@ -532,8 +531,8 @@ pub

[ignite] branch master updated: IGNITE-13327 Add a metric for processed keys when rebuilding indexes. - Fixes #8126

2020-08-18 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new c4e444b  IGNITE-13327 Add a metric for processed keys when rebuilding 
indexes. - Fixes #8126
c4e444b is described below

commit c4e444b69fce7216ea85326d99abd436076363a3
Author: Kirill Tkalenko 
AuthorDate: Tue Aug 18 19:36:33 2020 +0300

IGNITE-13327 Add a metric for processed keys when rebuilding indexes. - 
Fixes #8126

Signed-off-by: Ivan Rakov 
---
 .../java/org/apache/ignite/cache/CacheMetrics.java |  15 ++
 .../cache/CacheClusterMetricsMXBeanImpl.java   |  12 +-
 .../cache/CacheLocalMetricsMXBeanImpl.java |  12 +-
 .../processors/cache/CacheMetricsImpl.java |  45 -
 .../processors/cache/CacheMetricsSnapshot.java |  19 ++
 .../processors/cache/CacheMetricsSnapshotV2.java   |  19 ++
 .../schema/SchemaIndexCachePartitionWorker.java|   2 +
 .../query/schema/SchemaIndexCacheVisitorImpl.java  |   1 +
 .../apache/ignite/mxbean/CacheMetricsMXBean.java   |   9 +
 .../platform/PlatformCacheWriteMetricsTask.java|  10 ++
 .../processors/cache/index/IndexMetricsTest.java   | 196 ++---
 11 files changed, 308 insertions(+), 32 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java 
b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
index 09bf550..0372ab7 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
@@ -720,4 +720,19 @@ public interface CacheMetrics {
  * @return Key collisions and appropriate queue size string representation.
  */
 @NotNull public String getTxKeyCollisions();
+
+/**
+ * Return {@code true} if index rebuild is in progress.
+ *
+ * @return {@code true} if index rebuild is in progress.
+ */
+public boolean isIndexRebuildInProgress();
+
+/**
+ * Return number of keys processed during index rebuilding.
+ * To get remaining number of keys for rebuilding, subtract current value 
from {@link #getCacheSize}.
+ *
+ * @return Number of keys processed during index rebuilding.
+ */
+public long getIndexRebuildKeysProcessed();
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
index 9403e5c..32031ec3 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
@@ -24,7 +24,7 @@ import org.apache.ignite.mxbean.CacheMetricsMXBean;
 /**
  * Management bean that provides access to {@link IgniteCache IgniteCache}.
  */
-class CacheClusterMetricsMXBeanImpl implements CacheMetricsMXBean {
+public class CacheClusterMetricsMXBeanImpl implements CacheMetricsMXBean {
 /** Cache. */
 private GridCacheAdapter cache;
 
@@ -518,4 +518,14 @@ class CacheClusterMetricsMXBeanImpl implements 
CacheMetricsMXBean {
 throw new RuntimeException(e.getMessage());
 }
 }
+
+/** {@inheritDoc} */
+@Override public boolean isIndexRebuildInProgress() {
+return cache.clusterMetrics().isIndexRebuildInProgress();
+}
+
+/** {@inheritDoc} */
+@Override public long getIndexRebuildKeysProcessed() {
+return cache.clusterMetrics().getIndexRebuildKeysProcessed();
+}
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
index 89c7c04..ea2f81b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
@@ -29,7 +29,7 @@ import org.apache.ignite.mxbean.CacheMetricsMXBean;
  * @deprecated Use {@link GridMetricManager} instead.
  */
 @Deprecated
-class CacheLocalMetricsMXBeanImpl implements CacheMetricsMXBean {
+public class CacheLocalMetricsMXBeanImpl implements CacheMetricsMXBean {
 /** Cache. */
 private GridCacheAdapter cache;
 
@@ -516,4 +516,14 @@ class CacheLocalMetricsMXBeanImpl implements 
CacheMetricsMXBean {
 @Override public String getTxKeyCollisions() {
 return cache.metrics0().getTxKeyCollisions();
 }
+
+/** {@inheritDoc} */
+@Override public boolean isIndexRebuildInProgress() {
+return cache.metrics0().isIndexRebuildInProgress();
+}
+
+/** {@inheritDoc} */
+@Override public long

[ignite] branch master updated: IGNITE-13253 Advanced heuristics for historical rebalance - Fixes #8160

2020-08-18 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new b82b650  IGNITE-13253 Advanced heuristics for historical rebalance - 
Fixes #8160
b82b650 is described below

commit b82b65050c50e8820bd1480a38aefb2d20e4b0f1
Author: Ivan Rakov 
AuthorDate: Tue Aug 18 16:55:10 2020 +0300

IGNITE-13253 Advanced heuristics for historical rebalance - Fixes #8160
---
 .../org/apache/ignite/IgniteSystemProperties.java  |   7 +
 .../preloader/GridDhtPartitionsExchangeFuture.java |  83 +++---
 .../GridCacheDatabaseSharedManager.java|  18 ++-
 .../apache/ignite/cache/CircledRebalanceTest.java  |  15 +-
 ...CachePartitionLostAfterSupplierHasLeftTest.java |  11 +-
 .../HistoricalRebalanceHeuristicsTest.java | 172 +
 ...itePdsAtomicCacheHistoricalRebalancingTest.java |   4 +-
 .../IgnitePdsTxHistoricalRebalancingTest.java  |   4 +-
 .../db/FullHistRebalanceOnClientStopTest.java  |   3 +-
 .../db/wal/IgniteWalRebalanceLoggingTest.java  |   3 +-
 .../persistence/db/wal/IgniteWalRebalanceTest.java |  26 +++-
 ...ounterStateConsistencyHistoryRebalanceTest.java |   4 +-
 ...ounterStateConsistencyHistoryRebalanceTest.java |   4 +-
 ...ateOnePrimaryOneBackupHistoryRebalanceTest.java |   4 +-
 ...imaryTwoBackupsFailAllHistoryRebalanceTest.java |   4 +-
 ...teOnePrimaryTwoBackupsHistoryRebalanceTest.java |   4 +-
 .../DistributedMetaStoragePersistentTest.java  |   6 +-
 .../ignite/testsuites/IgnitePdsTestSuite2.java |   3 +
 18 files changed, 319 insertions(+), 56 deletions(-)

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 18b351f..d1f59af 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -746,6 +746,13 @@ public final class IgniteSystemProperties {
  */
 public static final String IGNITE_PDS_WAL_REBALANCE_THRESHOLD = 
"IGNITE_PDS_WAL_REBALANCE_THRESHOLD";
 
+/**
+ * Prefer historical rebalance if there's enough history regardless off 
all heuristics.
+ * This property is intended for integration or performance tests.
+ * Default is {@code false}.
+ */
+public static final String IGNITE_PREFER_WAL_REBALANCE = 
"IGNITE_PREFER_WAL_REBALANCE";
+
 /** Ignite page memory concurrency level. */
 public static final String IGNITE_OFFHEAP_LOCK_CONCURRENCY_LEVEL = 
"IGNITE_OFFHEAP_LOCK_CONCURRENCY_LEVEL";
 
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 2cc9f76..0dd4b35 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
@@ -100,6 +100,7 @@ import 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.Grid
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionTopology;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionsStateValidator;
 import 
org.apache.ignite.internal.processors.cache.persistence.DatabaseLifecycleListener;
+import 
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
 import 
org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDiscoveryMessage;
 import 
org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
@@ -3526,7 +3527,9 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 ) {
 Map> partHistReserved0 = partHistReserved;
 
-Map localReserved = partHistReserved0 != null ? 
partHistReserved0.get(top.groupId()) : null;
+int grpId = top.groupId();
+
+Map localReserved = partHistReserved0 != null ? 
partHistReserved0.get(grpId) : null;
 
 List list = new ArrayList<>();
 
@@ -3549,33 +3552,17 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 Long localHistCntr = localReserved.get(p);
 
 if (localHistCntr != null && 
maxCntrObj.nodes.contains(cctx.localNodeId())) {
-Long ceilingMinReserved = 
nonMaxCntrs.ceiling(localHistCntr);
-
-   

[ignite] branch master updated: IGNITE-5038 BinaryMarshaller might need to use context class loader for deserialization - Fixes #5038

2020-08-14 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new b991e3b  IGNITE-5038 BinaryMarshaller might need to use context class 
loader for deserialization - Fixes #5038
b991e3b is described below

commit b991e3b60f83fe399e4dacb4b8cf5dce99e24e64
Author: Ivan Rakov 
AuthorDate: Fri Aug 14 15:48:28 2020 +0300

IGNITE-5038 BinaryMarshaller might need to use context class loader for 
deserialization - Fixes #5038
---
 .../org/apache/ignite/binary/BinaryObject.java |  11 +
 .../internal/binary/BinaryClassDescriptor.java |  44 ++-
 .../ignite/internal/binary/BinaryContext.java  |  64 -
 .../internal/binary/BinaryEnumObjectImpl.java  |  45 ++-
 .../ignite/internal/binary/BinaryObjectImpl.java   |  16 ++
 .../internal/binary/BinaryObjectOffheapImpl.java   |  31 ++-
 .../ignite/internal/binary/BinaryReaderExImpl.java |   7 +-
 .../apache/ignite/internal/binary/BinaryUtils.java |  42 ++-
 .../internal/binary/GridBinaryMarshaller.java  |   3 +
 .../optimized/OptimizedClassDescriptor.java|  38 ++-
 .../marshaller/optimized/OptimizedMarshaller.java  |  31 ++-
 .../optimized/OptimizedMarshallerUtils.java|  68 -
 .../optimized/OptimizedObjectInputStream.java  |  17 +-
 .../optimized/OptimizedObjectOutputStream.java |   3 +
 .../OptimizedObjectSharedStreamRegistry.java   |  17 ++
 .../apache/ignite/internal/util/IgniteUtils.java   |  27 +-
 .../binary/BinaryClassLoaderMultiJvmTest.java  | 304 +
 .../internal/binary/BinaryClassLoaderTest.java | 248 +
 .../optimized/OptimizedObjectStreamSelfTest.java   |   2 +-
 .../IgniteBinaryObjectsCacheTestSuite3.java|   4 +
 .../org/apache/ignite/tests/p2p/cache/Address.java |  57 
 .../org/apache/ignite/tests/p2p/cache/Color.java   |  50 
 .../ignite/tests/p2p/cache/Organization.java   |  49 
 23 files changed, 1141 insertions(+), 37 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java 
b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
index 8803df9..d6ac766 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryObject.java
@@ -134,6 +134,17 @@ public interface BinaryObject extends Serializable, 
Cloneable {
 public  T deserialize() throws BinaryObjectException;
 
 /**
+ * Gets fully deserialized instance of binary object. If ldr 
was not specified, configured class loader
+ * will be used {@link 
org.apache.ignite.configuration.IgniteConfiguration#getClassLoader}.
+ *
+ * @param ldr Class loader.
+ * @return Fully deserialized instance of binary object.
+ * @throws BinaryInvalidTypeException If class doesn't exist.
+ * @throws BinaryObjectException In case of any other error.
+ */
+public  T deserialize(ClassLoader ldr) throws BinaryObjectException;
+
+/**
  * Copies this binary object.
  *
  * @return Copy of this binary object.
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
index 732c4c5..5b58300 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
@@ -151,6 +151,48 @@ public class BinaryClassDescriptor {
 boolean metaDataEnabled,
 boolean registered
 ) throws BinaryObjectException {
+this(
+ctx,
+cls,
+userType,
+typeId,
+typeName,
+affKeyFieldName,
+mapper,
+serializer,
+metaDataEnabled,
+registered,
+MarshallerExclusions.isExcluded(cls)
+);
+}
+
+/**
+ * @param ctx Context.
+ * @param cls Class.
+ * @param userType User type flag.
+ * @param typeId Type ID.
+ * @param typeName Type name.
+ * @param affKeyFieldName Affinity key field name.
+ * @param mapper Mapper.
+ * @param serializer Serializer.
+ * @param metaDataEnabled Metadata enabled flag.
+ * @param registered Whether typeId has been successfully registered by 
MarshallerContext or not.
+ * @param excluded If true class values are explicitly excluded from 
marshalling, otherwise false.
+ * @throws BinaryObjectException In case of error.
+ */
+BinaryClassDescriptor(
+BinaryContext ctx,
+Class cls,
+boolean userType,
+int typeId,
+String typeName,
+@Nullable String affKeyFieldName,
+@Nullable BinaryInternalMapper mapper

[ignite-teamcity-bot] branch master updated: Improved flaky test detection to avoid reporting redundant messages #173

2020-08-11 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new a3c72c7  Improved flaky test detection to avoid reporting redundant 
messages #173
a3c72c7 is described below

commit a3c72c70b756a6abc014f70962d7ad5a8b61b827
Author: sergeyuttsel 
AuthorDate: Tue Aug 11 17:47:36 2020 +0300

Improved flaky test detection to avoid reporting redundant messages #173

Signed-off-by: Ivan Rakov 
---
 .../main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java  | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
index fe1ef2b..19b0c26 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
@@ -517,7 +517,12 @@ public class IssueDetector {
 
 if (flakyRate > cfg.flakyRate()) {
 type = IssueType.newTestWithHighFlakyRate;
-firstFailedBuildId = 
lastInvocations.get(confidenceOkTestsRow).buildId();
+
+firstFailedBuildId = lastInvocations.stream()
+.filter(invocation -> invocation.status() == 
RES_FAILURE.getCode())
+.findFirst()
+.orElseGet(() -> 
lastInvocations.get(confidenceOkTestsRow))
+.buildId();
 }
 }
 }



[ignite-teamcity-bot] branch master updated: Improved exception handling on periodic check servers queue failed. Added slack notification. #172

2020-08-03 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new b0b3580  Improved exception handling on periodic check servers queue 
failed. Added slack notification. #172
b0b3580 is described below

commit b0b358058c787108d290d380ca6791c0f1a64986
Author: sergeyuttsel 
AuthorDate: Mon Aug 3 22:19:31 2020 +0300

Improved exception handling on periodic check servers queue failed. Added 
slack notification. #172

Signed-off-by: Ivan Rakov 
---
 build.gradle   |  2 +-
 .../org/apache/ignite/ci/jobs/CheckQueueJob.java   | 28 +++---
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/build.gradle b/build.gradle
index 2c8ce94..aa98d36 100644
--- a/build.gradle
+++ b/build.gradle
@@ -47,7 +47,7 @@ allprojects {
 jettyVer = '9.4.12.v20180830'
 
 // ignVer = '2.7.0'
-ignVer = '2.8.0'
+ignVer = '2.8.1'
 //  ignVer = '2.7.0-SNAPSHOT'
 
 guavaVer = '26.0-jre'
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jobs/CheckQueueJob.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jobs/CheckQueueJob.java
index 4f83fad..418f7e5 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jobs/CheckQueueJob.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jobs/CheckQueueJob.java
@@ -30,7 +30,6 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import javax.inject.Inject;
 import org.apache.ignite.ci.teamcity.ignited.BuildRefCompacted;
@@ -43,6 +42,8 @@ import 
org.apache.ignite.tcbot.common.interceptor.MonitoredTask;
 import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
 import org.apache.ignite.tcbot.engine.conf.ITrackedBranch;
 import org.apache.ignite.tcbot.engine.conf.ITrackedChain;
+import org.apache.ignite.tcbot.engine.conf.NotificationsConfig;
+import org.apache.ignite.tcbot.notify.ISlackSender;
 import org.apache.ignite.tcbot.persistence.IStringCompactor;
 import org.apache.ignite.tcignited.ITeamcityIgnited;
 import org.apache.ignite.tcignited.ITeamcityIgnitedProvider;
@@ -53,6 +54,8 @@ import org.apache.ignite.tcservice.model.user.User;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static java.util.stream.Collectors.toList;
+
 /**
  * Trigger build if half of agents are available and there is no 
self-triggered builds in build queue.
  */
@@ -80,6 +83,9 @@ public class CheckQueueJob implements Runnable {
 @Inject private ITcBotConfig cfg;
 
 /** */
+@Inject private ISlackSender slackSender;
+
+/** */
 private final Map startTimes = new HashMap<>();
 
 /**
@@ -94,10 +100,26 @@ public class CheckQueueJob implements Runnable {
 try {
 runEx();
 }
-catch (Exception e) {
+catch (Throwable e) {
 e.printStackTrace();
 
 logger.error("Check Queue periodic check failed: " + 
e.getMessage(), e);
+
+NotificationsConfig notifications = cfg.notifications();
+
+String msg = ":warning: Periodic check servers queue and build 
triggering failed";
+
+notifications.channels().forEach(channel -> {
+String chName = channel.slack();
+
+if (chName != null && chName.startsWith("#"))
+try {
+slackSender.sendMessage(chName, msg, 
notifications);
+}
+catch (Exception ex) {
+logger.warn("Unable to notify address [" + chName 
+ "] about periodic check queue failure", e);
+}
+});
 }
 }
 
@@ -136,7 +158,7 @@ public class CheckQueueJob implements Runnable {
 List chainsAll = entry.getValue();
 List chains = chainsAll.stream()
 .filter(c -> Objects.equals(c.serverCode(), srvCode))
-.collect(Collectors.toList());
+.collect(toList());
 
 srvsChecked++;
 



[ignite] branch master updated: IGNITE-13306 Add Java 11 specific JVM flag for fixing CPU load metric - Fixes #8088

2020-07-30 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 65e0ca8  IGNITE-13306 Add Java 11 specific JVM flag for fixing CPU 
load metric - Fixes #8088
65e0ca8 is described below

commit 65e0ca879975d7aa88d9d94dbb19db1d8ac9a39f
Author: Mirza Aliev 
AuthorDate: Thu Jul 30 18:13:16 2020 +0300

IGNITE-13306 Add Java 11 specific JVM flag for fixing CPU load metric - 
Fixes #8088

Signed-off-by: Ivan Rakov 
---
 bin/control.bat|  1 +
 bin/control.sh |  1 +
 bin/ignite.bat |  1 +
 bin/ignite.sh  |  1 +
 bin/ignitevisorcmd.bat |  1 +
 bin/ignitevisorcmd.sh  |  1 +
 examples/README.md |  1 +
 .../ignite/internal/util/FeatureChecker.java   |  3 ++-
 .../internal/ClusterNodeMetricsSelfTest.java   | 29 ++
 modules/dev-utils/ignite-modules-test/build.gradle |  1 +
 modules/platforms/cpp/core/src/ignition.cpp|  1 +
 .../Apache.Ignite.Core/Impl/Unmanaged/Jni/Jvm.cs   |  1 +
 modules/sqlline/bin/sqlline.bat|  1 +
 modules/sqlline/bin/sqlline.sh |  1 +
 parent/pom.xml |  2 +-
 15 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/bin/control.bat b/bin/control.bat
index 77a3f3f..45a8042 100644
--- a/bin/control.bat
+++ b/bin/control.bat
@@ -244,6 +244,7 @@ if %MAJOR_JAVA_VER% GEQ 11 (
 --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED ^
 --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED ^
 --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED 
^
+--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED ^
 --illegal-access=permit ^
 %JVM_OPTS%
 )
diff --git a/bin/control.sh b/bin/control.sh
index 6396d4a..5d615d4 100755
--- a/bin/control.sh
+++ b/bin/control.sh
@@ -175,6 +175,7 @@ elif [ $version -ge 11 ] ; then
 --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \
 --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \
 
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
+--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED \
 --illegal-access=permit \
 ${JVM_OPTS}"
 fi
diff --git a/bin/ignite.bat b/bin/ignite.bat
index 98c20b8..b06bb1c 100644
--- a/bin/ignite.bat
+++ b/bin/ignite.bat
@@ -254,6 +254,7 @@ if %MAJOR_JAVA_VER% GEQ 11 (
 --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED ^
 --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED ^
 --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED 
^
+--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED ^
 --illegal-access=permit ^
 %JVM_OPTS%
 )
diff --git a/bin/ignite.sh b/bin/ignite.sh
index 265b214..baec5c2 100755
--- a/bin/ignite.sh
+++ b/bin/ignite.sh
@@ -172,6 +172,7 @@ elif [ $version -ge 11 ] ; then
 --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \
 --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \
 
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
+--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED \
 --illegal-access=permit \
 ${JVM_OPTS}"
 fi
diff --git a/bin/ignitevisorcmd.bat b/bin/ignitevisorcmd.bat
index 4852038..18da4e8 100644
--- a/bin/ignitevisorcmd.bat
+++ b/bin/ignitevisorcmd.bat
@@ -183,6 +183,7 @@ if %MAJOR_JAVA_VER% GEQ 11 (
 --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED ^
 --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED ^
 --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED 
^
+--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED ^
 --illegal-access=permit ^
 %JVM_OPTS%
 )
diff --git a/bin/ignitevisorcmd.sh b/bin/ignitevisorcmd.sh
index f7ee4e0..411efa4 100755
--- a/bin/ignitevisorcmd.sh
+++ b/bin/ignitevisorcmd.sh
@@ -141,6 +141,7 @@ elif [ $version -ge 11 ] ; then
 --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \
 --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \
 
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
+--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED \
 --illegal-access=permit \
 ${JVM_OPTS}"
 fi
diff --git a/examples/README.md b/examples/README.md
index 88de890..720c664 100644
--- a/examples/README.md
+++ b/examples/README.md

[ignite] branch master updated: IGNITE-13271 Add new type of WAL records to track/debug atomic updates on backup nodes - Fixes #8060

2020-07-22 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 4a57f7d  IGNITE-13271 Add new type of WAL records to track/debug 
atomic updates on backup nodes - Fixes #8060
4a57f7d is described below

commit 4a57f7d5caef29a9ac84ecfee542439404339c7c
Author: sk0x50 
AuthorDate: Wed Jul 22 20:53:37 2020 +0300

IGNITE-13271 Add new type of WAL records to track/debug atomic updates on 
backup nodes - Fixes #8060

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/internal/pagemem/wal/record/WALRecord.java   | 5 -
 .../internal/processors/cache/persistence/tree/io/PageIO.java  | 3 +++
 .../org/apache/ignite/testframework/wal/record/RecordUtils.java| 7 +++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/WALRecord.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/WALRecord.java
index 21388bc..da8e03e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/WALRecord.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/WALRecord.java
@@ -230,7 +230,10 @@ public abstract class WALRecord {
 MASTER_KEY_CHANGE_RECORD(60, LOGICAL),
 
 /** Record that indicates that "corrupted" flag should be removed from 
tracking page. */
-TRACKING_PAGE_REPAIR_DELTA(61, PHYSICAL);
+TRACKING_PAGE_REPAIR_DELTA(61, PHYSICAL),
+
+/** Atomic out-of-order update. */
+OUT_OF_ORDER_UPDATE(62, LOGICAL);
 
 /** Index for serialization. Should be consistent throughout all 
versions. */
 private final int idx;
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/PageIO.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/PageIO.java
index e9032ec..070d426 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/PageIO.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/tree/io/PageIO.java
@@ -255,6 +255,9 @@ public abstract class PageIO {
 /** */
 public static final short T_DATA_PART = 32;
 
+/** */
+public static final short T_MARKER_PAGE = 33;
+
 /** Index for payload == 1. */
 public static final short T_H2_EX_REF_LEAF_START = 10_000;
 
diff --git 
a/modules/core/src/test/java/org/apache/ignite/testframework/wal/record/RecordUtils.java
 
b/modules/core/src/test/java/org/apache/ignite/testframework/wal/record/RecordUtils.java
index 793825e..4892cf4 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/testframework/wal/record/RecordUtils.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/testframework/wal/record/RecordUtils.java
@@ -127,6 +127,7 @@ import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType
 import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.MVCC_DATA_PAGE_TX_STATE_HINT_UPDATED_RECORD;
 import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.MVCC_DATA_RECORD;
 import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.MVCC_TX_RECORD;
+import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.OUT_OF_ORDER_UPDATE;
 import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.PAGES_LIST_ADD_PAGE;
 import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.PAGES_LIST_INIT_NEW_PAGE;
 import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.PAGES_LIST_REMOVE_PAGE;
@@ -219,6 +220,7 @@ public class RecordUtils {
 put(MVCC_TX_RECORD, RecordUtils::buildMvccTxRecord);
 put(CONSISTENT_CUT, RecordUtils::buildConsistentCutRecord);
 put(BTREE_META_PAGE_INIT_ROOT_V3, 
RecordUtils::buildBtreeMetaPageInitRootV3);
+put(OUT_OF_ORDER_UPDATE, RecordUtils::buildOutOfOrderRecord);
 }};
 
 /** **/
@@ -572,6 +574,11 @@ public class RecordUtils {
 return new UnsupportedWalRecord(BTREE_META_PAGE_INIT_ROOT_V3);
 }
 
+/** **/
+public static UnsupportedWalRecord buildOutOfOrderRecord() {
+return new UnsupportedWalRecord(OUT_OF_ORDER_UPDATE);
+}
+
 /**
  * Return {@code true} if include to write-ahead log.
  *



[ignite] branch master updated: IGNITE-12320 Partial index rebuild fails in case indexed cache contains different datatypes - Fixes #8018

2020-07-13 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new b11a868  IGNITE-12320 Partial index rebuild fails in case indexed 
cache contains different datatypes - Fixes #8018
b11a868 is described below

commit b11a868a5803bf383c06a71c0d3ac368ab33618e
Author: alapin 
AuthorDate: Mon Jul 13 21:00:02 2020 +0300

IGNITE-12320 Partial index rebuild fails in case indexed cache contains 
different datatypes - Fixes #8018

Signed-off-by: Ivan Rakov 
---
 .../processors/query/GridQueryProcessor.java   |  43 -
 .../schema/SchemaIndexCachePartitionWorker.java|  13 +-
 .../query/schema/SchemaIndexCacheVisitorImpl.java  |   8 +-
 .../processors/query/h2/IgniteH2Indexing.java  |   4 +-
 .../processors/query/h2/IndexBuildClosure.java |  54 --
 .../query/h2/IndexRebuildPartialClosure.java   |  24 ++-
 .../processors/query/h2/SchemaManager.java |   6 +-
 .../cache/index/AbstractIndexingCommonTest.java|   2 +-
 ...lRebuildTest.java => GridIndexRebuildTest.java} | 198 ++---
 .../IgniteBinaryCacheQueryTestSuite.java   |   4 +-
 10 files changed, 205 insertions(+), 151 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index b6cc81e..2da189c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -84,7 +84,6 @@ import 
org.apache.ignite.internal.processors.cache.query.GridCacheQueryType;
 import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
 import 
org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessor;
 import 
org.apache.ignite.internal.processors.query.property.QueryBinaryProperty;
-import 
org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheFilter;
 import 
org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitor;
 import 
org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitorClosure;
 import 
org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheVisitorImpl;
@@ -111,13 +110,11 @@ import 
org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.lang.GridCloseableIterator;
 import org.apache.ignite.internal.util.lang.GridClosureException;
 import org.apache.ignite.internal.util.lang.IgniteOutClosureX;
-import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.T3;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.LT;
-import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
@@ -1860,7 +1857,6 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
 
 visitor = new SchemaIndexCacheVisitorImpl(
 cacheInfo.cacheContext(),
-new TableCacheFilter(cctx, op0.tableName()),
 cancelTok,
 createIdxFut
 ) {
@@ -3746,45 +3742,6 @@ public class GridQueryProcessor extends 
GridProcessorAdapter {
 }
 }
 
-/** */
-private static class TableCacheFilter implements SchemaIndexCacheFilter {
-/** */
-@GridToStringExclude
-private final GridCacheContext cctx;
-
-/** */
-@GridToStringExclude
-private final GridQueryProcessor query;
-
-/** */
-private final String cacheName;
-
-/** */
-private final String tableName;
-
-/**
- * @param cctx Cache context.
- * @param tableName Target table name.
- */
-TableCacheFilter(GridCacheContext cctx, String tableName) {
-this.cctx = cctx;
-this.tableName = tableName;
-
-cacheName = cctx.name();
-query = cctx.kernalContext().query();
-}
-
-/** {@inheritDoc} */
-@Override public boolean apply(CacheDataRow row) throws 
IgniteCheckedException {
-return query.belongsToTable(cctx, cacheName, tableName, row.key(), 
row.value());
-}
-
-/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(TableCacheFilter.class, this);
-}
-}
-
 /**
  * Funct

[ignite] branch master updated: IGNITE-12307 Data types coverage for basic cache operations. - Fixes #8015

2020-07-13 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 91388a3  IGNITE-12307 Data types coverage for basic cache operations. 
- Fixes #8015
91388a3 is described below

commit 91388a3fe167ea5a95e77d53e010160e18a463c0
Author: alapin 
AuthorDate: Mon Jul 13 20:47:49 2020 +0300

IGNITE-12307 Data types coverage for basic cache operations. - Fixes #8015

Signed-off-by: Ivan Rakov 
---
 modules/clients/pom.xml|   7 +
 .../jdbc/suite/IgniteJdbcDriverTestSuite.java  |   6 +
 .../JdbcThinCacheToJdbcDataTypesCoverageTest.java  | 621 +
 .../JdbcThinJdbcToCacheDataTypesCoverageTest.java  | 209 ++
 modules/core/pom.xml   |   7 +
 .../cache/AbstractDataTypesCoverageTest.java   | 752 +
 .../cache/GridCacheDataTypesCoverageTest.java  | 507 ++
 .../ignite/testsuites/IgniteCacheTestSuite9.java   |   4 +
 .../ignite/sqltests/SqlDataTypesCoverageTests.java | 492 ++
 .../IgniteBinaryCacheQueryTestSuite2.java  |   4 +
 parent/pom.xml |   1 +
 11 files changed, 2610 insertions(+)

diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index bcb3316..132f276 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -126,6 +126,13 @@
 ${h2.version}
 test
 
+
+
+org.apache.commons
+commons-lang3
+${commons.lang3.version}
+test
+
 
 
 
diff --git 
a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
 
b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
index 27d694d..ea529d0 100644
--- 
a/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
+++ 
b/modules/clients/src/test/java/org/apache/ignite/jdbc/suite/IgniteJdbcDriverTestSuite.java
@@ -41,6 +41,7 @@ import 
org.apache.ignite.jdbc.thin.JdbcThinAuthenticateConnectionSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinAutoCloseServerCursorTest;
 import org.apache.ignite.jdbc.thin.JdbcThinBatchSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinBulkLoadSelfTest;
+import org.apache.ignite.jdbc.thin.JdbcThinCacheToJdbcDataTypesCoverageTest;
 import org.apache.ignite.jdbc.thin.JdbcThinComplexDmlDdlCustomSchemaSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinComplexDmlDdlSelfTest;
 import 
org.apache.ignite.jdbc.thin.JdbcThinComplexDmlDdlSkipReducerOnUpdateSelfTest;
@@ -65,6 +66,7 @@ import org.apache.ignite.jdbc.thin.JdbcThinEmptyCacheSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinErrorsSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinInsertStatementSelfTest;
 import 
org.apache.ignite.jdbc.thin.JdbcThinInsertStatementSkipReducerOnUpdateSelfTest;
+import org.apache.ignite.jdbc.thin.JdbcThinJdbcToCacheDataTypesCoverageTest;
 import org.apache.ignite.jdbc.thin.JdbcThinLocalQueriesSelfTest;
 import org.apache.ignite.jdbc.thin.JdbcThinMergeStatementSelfTest;
 import 
org.apache.ignite.jdbc.thin.JdbcThinMergeStatementSkipReducerOnUpdateSelfTest;
@@ -235,6 +237,10 @@ import org.junit.runners.Suite;
 JdbcThinPreparedStatementLeakTest.class,
 JdbcThinTransactionsLeaksMvccTest.class,
 JdbcThinSqlMergeTest.class,
+
+// Data types coverage.
+JdbcThinCacheToJdbcDataTypesCoverageTest.class,
+JdbcThinJdbcToCacheDataTypesCoverageTest.class
 })
 public class IgniteJdbcDriverTestSuite {
 /**
diff --git 
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinCacheToJdbcDataTypesCoverageTest.java
 
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinCacheToJdbcDataTypesCoverageTest.java
new file mode 100644
index 000..daeb570
--- /dev/null
+++ 
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinCacheToJdbcDataTypesCoverageTest.java
@@ -0,0 +1,621 @@
+/*
+ * 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.apa

[ignite] branch master updated: IGNITE-13245 Rebalance future might hangs in no final state though all partitions are owned - Fixes #8025

2020-07-13 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new d49580e  IGNITE-13245 Rebalance future might hangs in no final state 
though all partitions are owned - Fixes #8025
d49580e is described below

commit d49580e22fb8e7fe949bddb5c08669662eaa16eb
Author: vd_pyatkov 
AuthorDate: Mon Jul 13 15:58:11 2020 +0300

IGNITE-13245 Rebalance future might hangs in no final state though all 
partitions are owned - Fixes #8025

Signed-off-by: Ivan Rakov 
---
 .../internal/commandline/CommandHandler.java   |   8 +-
 .../dht/preloader/GridDhtPartitionDemander.java|   2 +
 ...lanceIsProcessingWhenAssignmentIsEmptyTest.java | 157 +
 .../ignite/testsuites/IgniteCacheTestSuite2.java   |   2 +
 4 files changed, 167 insertions(+), 2 deletions(-)

diff --git 
a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
 
b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
index 52566f6..32875b7 100644
--- 
a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
+++ 
b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.commandline;
 import java.io.File;
 import java.time.Duration;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
@@ -124,6 +125,9 @@ public class CommandHandler {
 /** */
 private Object lastOperationRes;
 
+/** Date format. */
+private final DateTimeFormatter formatter = 
DateTimeFormatter.ofPattern("-MM-dd'T'HH:mm:ss.SSS");
+
 /**
  * @param args Arguments to parse and apply.
  */
@@ -217,7 +221,7 @@ public class CommandHandler {
 logger.info("Control utility [ver. " + ACK_VER_STR + "]");
 logger.info(COPYRIGHT);
 logger.info("User: " + System.getProperty("user.name"));
-logger.info("Time: " + startTime);
+logger.info("Time: " + startTime.format(formatter));
 
 String commandName = "";
 
@@ -368,7 +372,7 @@ public class CommandHandler {
 if (nonNull(err))
 logger.info("Error stack trace:" + System.lineSeparator() + 
X.getFullStackTrace(err));
 
-logger.info("Control utility has completed execution at: " + 
endTime);
+logger.info("Control utility has completed execution at: " + 
endTime.format(formatter));
 logger.info("Execution time: " + diff.toMillis() + " ms");
 
 Arrays.stream(logger.getHandlers())
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index 514dd1f..8969b31 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -314,6 +314,8 @@ public class GridDhtPartitionDemander {
 
 if (oldFut.isInitial())
 oldFut.onDone(true);
+else if (!oldFut.isDone())
+oldFut.tryCancel();
 
 ((GridFutureAdapter)grp.preloader().syncFuture()).onDone();
 
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/RebalanceIsProcessingWhenAssignmentIsEmptyTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/RebalanceIsProcessingWhenAssignmentIsEmptyTest.java
new file mode 100644
index 000..11e7d9e
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/RebalanceIsProcessingWhenAssignmentIsEmptyTest.java
@@ -0,0 +1,157 @@
+/*
+ * 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 

[ignite-teamcity-bot] 03/04: New tests list doesn't contain ignored and muted tests. Fix visa text. #169

2020-07-09 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 177bd1e7bcf0b7fc3290328e249e5b68d73a8de2
Author: sergeyuttsel 
AuthorDate: Thu Jul 9 23:16:13 2020 +0300

New tests list doesn't contain ignored and muted tests. Fix visa text. #169

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java  | 2 +-
 .../main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java  | 2 +-
 .../src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index c4de5ca..4523a57 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -962,7 +962,7 @@ public class TcBotTriggerAndSignOffService {
 
 cnt++;
 if (cnt > 10) {
-newTests.append("... and ").append(totalNewTests - 
cnt).append(" tests blockers\\n");
+newTests.append("... and ").append(totalNewTests - 
cnt).append(" new tests\\n");
 
 break;
 }
diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
index 0f93b99..698a8b7 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
@@ -393,7 +393,7 @@ public class PrChainsProcessor {
 .map((ctx) -> {
 List missingTests = ctx.getFilteredTests(test -> {
 IRunHistory history = test.history(tcIgnited, 
baseBranchId, null);
-return history == null;
+return history == null && !test.isMutedOrIgored();
 })
 .stream()
 .map(occurrence -> new ShortTestUi().initFrom(occurrence, 
occurrence.isPassed()))
diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
index ec47896..cf2147e 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
@@ -302,7 +302,7 @@ public class DsChainUi {
 .map((suite) -> {
 List missingTests = suite.getFilteredTests(test 
-> {
 IRunHistory history = test.history(tcIgnited, 
baseBranchId, null);
-return history == null;
+return history == null && !test.isMutedOrIgored();
 })
 .stream()
 .map(occurrence -> {



[ignite-teamcity-bot] 02/04: Increased the number of files to save logs in 2 weeks #168

2020-07-09 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit b745f638c715d232b1c40c10647e285ec2f912e8
Author: sergeyuttsel 
AuthorDate: Thu Jul 9 23:13:47 2020 +0300

Increased the number of files to save logs in 2 weeks #168

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/ci/db/Ignite2Configurer.java |  2 +-
 .../apache/ignite/ci/tcbot/TcBotWebAppModule.java  |  2 +
 .../ignite/tcbot/engine/cleaner/Cleaner.java   | 90 --
 .../ignite/tcbot/engine/defect/DefectsStorage.java |  9 ++-
 .../ignite/tcbot/engine/issue/IssuesStorage.java   |  9 ++-
 .../apache/ignite/tcignited/build/FatBuildDao.java | 24 +-
 6 files changed, 103 insertions(+), 33 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/Ignite2Configurer.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/Ignite2Configurer.java
index 6b0257c..69ddad8 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/Ignite2Configurer.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/Ignite2Configurer.java
@@ -56,7 +56,7 @@ public class Ignite2Configurer {
 logFilePolicy.setContext(logCtx);
 logFilePolicy.setParent(rollingFa);
 logFilePolicy.setFileNamePattern(new File(logs, 
"logfile-%d{-MM-dd_HH}.log").getAbsolutePath());
-logFilePolicy.setMaxHistory(7);
+logFilePolicy.setMaxHistory(24*7*2);
 logFilePolicy.start();
 
 final String activeFileName = logFilePolicy.getActiveFileName();
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
index 969e6b6..29ef04b 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
@@ -38,6 +38,7 @@ import 
org.apache.ignite.tcbot.common.conf.IDataSourcesConfigSupplier;
 import org.apache.ignite.tcbot.common.exeption.ExceptionUtil;
 import org.apache.ignite.tcbot.common.exeption.ServicesStartingException;
 import org.apache.ignite.tcbot.engine.TcBotEngineModule;
+import org.apache.ignite.tcbot.engine.cleaner.Cleaner;
 import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
 import org.apache.ignite.tcbot.engine.pool.TcUpdatePool;
 import org.apache.ignite.tcbot.notify.TcBotNotificationsModule;
@@ -78,6 +79,7 @@ public class TcBotWebAppModule extends AbstractModule {
 bind(ObserverTask.class).in(new SingletonScope());
 bind(BuildObserver.class).in(new SingletonScope());
 bind(VisasHistoryStorage.class).in(new SingletonScope());
+bind(Cleaner.class).in(new SingletonScope());
 
 install(new TcBotPersistenceModule());
 install(new TeamcityIgnitedModule());
diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/cleaner/Cleaner.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/cleaner/Cleaner.java
index 4c5ac1f..6d14a26 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/cleaner/Cleaner.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/cleaner/Cleaner.java
@@ -18,12 +18,16 @@ package org.apache.ignite.tcbot.engine.cleaner;
 
 import java.io.File;
 import java.time.ZonedDateTime;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Collectors;
 import javax.inject.Inject;
 import org.apache.ignite.ci.teamcity.ignited.buildcondition.BuildConditionDao;
+import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.tcbot.common.conf.TcBotWorkDir;
 import org.apache.ignite.tcbot.common.interceptor.AutoProfiling;
 import org.apache.ignite.tcbot.common.interceptor.MonitoredTask;
@@ -39,6 +43,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class Cleaner {
+private final AtomicBoolean init = new AtomicBoolean();
+
 @Inject IIssuesStorage issuesStorage;
 @Inject FatBuildDao fatBuildDao;
 @Inject SuiteInvocationHistoryDao suiteInvocationHistoryDao;
@@ -55,41 +61,62 @@ public class Cleaner {
 private ScheduledExecutorService executorService;
 
 @AutoProfiling
-@MonitoredTask(name = "Clean ignite cache data and logs")
+@MonitoredTask(name = "Clean old cache data and log files")
 public void clean() {
-if (cfg.getCleanerConfig().enabled()) {
-try {
+try {
+if (cfg.getCleanerConfig().enabled()) {
 long safeDays = cfg.getCleanerConfig().safeDays();
+
 int numOfIte

[ignite-teamcity-bot] branch master updated (6fa6ce6 -> 82c3594)

2020-07-09 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git.


from 6fa6ce6  Revert "Checkbox 'Delete all files in checkout directory 
before each snapshot dependency build' added (#161)"
 new 272ad28  Checkbox 'delete all files in checkout directory before each 
snapshot dependency build' #167
 new b745f63  Increased the number of files to save logs in 2 weeks #168
 new 177bd1e  New tests list doesn't contain ignored and muted tests. Fix 
visa text. #169
 new 82c3594  Added web link to suite names in new tests list #170

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/ignite/ci/db/Ignite2Configurer.java |  2 +-
 .../apache/ignite/ci/tcbot/TcBotWebAppModule.java  |  2 +
 .../tcbot/visa/TcBotTriggerAndSignOffService.java  |  9 ++-
 .../apache/ignite/ci/web/rest/TriggerBuilds.java   |  5 +-
 .../src/main/webapp/js/testfails-2.2.js| 27 ---
 .../ignite/tcbot/engine/cleaner/Cleaner.java   | 90 --
 .../ignite/tcbot/engine/defect/DefectsStorage.java |  9 ++-
 .../ignite/tcbot/engine/issue/IssuesStorage.java   |  9 ++-
 .../ignite/tcbot/engine/pr/PrChainsProcessor.java  |  4 +-
 .../apache/ignite/tcbot/engine/ui/DsChainUi.java   |  4 +-
 .../tcbot/engine/ui/ShortSuiteNewTestsUi.java  | 12 ++-
 .../apache/ignite/tcignited/build/FatBuildDao.java | 24 +-
 .../tcservice/TeamcityServiceConnection.java   |  2 +-
 13 files changed, 145 insertions(+), 54 deletions(-)



[ignite-teamcity-bot] 01/04: Checkbox 'delete all files in checkout directory before each snapshot dependency build' #167

2020-07-09 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 272ad2844e91b026960d59071f5c8b2e1802b2d0
Author: sergeyuttsel 
AuthorDate: Thu Jul 9 23:12:17 2020 +0300

Checkbox 'delete all files in checkout directory before each snapshot 
dependency build' #167

Signed-off-by: Ivan Rakov 
---
 .../tcbot/visa/TcBotTriggerAndSignOffService.java  |  3 ++-
 .../apache/ignite/ci/web/rest/TriggerBuilds.java   |  5 +++--
 .../src/main/webapp/js/testfails-2.2.js| 24 ++
 .../tcservice/TeamcityServiceConnection.java   |  2 +-
 4 files changed, 21 insertions(+), 13 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 8acb1e1..c4de5ca 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -267,6 +267,7 @@ public class TcBotTriggerAndSignOffService {
 @Nullable String ticketId,
 @Nullable String prNum,
 @Nullable String baseBranchForTc,
+@Nonnull Boolean cleanRebuild,
 @Nullable ITcBotUserCreds prov) {
 String jiraRes = "";
 
@@ -297,7 +298,7 @@ public class TcBotTriggerAndSignOffService {
 Set buildidsToSync = new HashSet<>();
 
 for (int i = 0; i < suiteIds.length; i++) {
-T2> objects = 
teamcity.triggerBuild(suiteIds[i], branchForTc, false, top != null && top, new 
HashMap<>(),
+T2> objects = 
teamcity.triggerBuild(suiteIds[i], branchForTc, cleanRebuild, top != null && 
top, new HashMap<>(),
 false, "");
 buildidsToSync.addAll(objects.get2());
 builds[i] = objects.get1();
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
index 75a8d69..afb8a68 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
@@ -83,7 +83,8 @@ public class TriggerBuilds {
 @Nullable @QueryParam("observe") Boolean observe,
 @Nullable @QueryParam("ticketId") String ticketId,
 @Nullable @QueryParam("prNum") String prNum,
-@Nullable @QueryParam("baseBranchForTc") String baseBranchForTc
+@Nullable @QueryParam("baseBranchForTc") String baseBranchForTc,
+@Nonnull @QueryParam("cleanRebuild") Boolean cleanRebuild
 ) {
 ITcBotUserCreds prov = ITcBotUserCreds.get(req);
 Injector injector = CtxListener.getInjector(ctx);
@@ -95,7 +96,7 @@ public class TriggerBuilds {
 
 String jiraRes = injector
 .getInstance(TcBotTriggerAndSignOffService.class)
-.triggerBuildsAndObserve(srvCodeOrAlias, branchForTc, 
parentSuiteId, suiteIdList, top, observe, ticketId, prNum, baseBranchForTc, 
prov);
+.triggerBuildsAndObserve(srvCodeOrAlias, branchForTc, 
parentSuiteId, suiteIdList, top, observe, ticketId, prNum, baseBranchForTc, 
cleanRebuild, prov);
 
 return new TriggerResult("Tests started." + (!jiraRes.isEmpty() ? 
"" + jiraRes : ""));
 }
diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js 
b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
index 09eb64b..5a0b573 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
@@ -237,12 +237,12 @@ function showChainCurrentStatusData(chain, settings) {
 moreInfoTxt += "Trigger failed " + cntFailed + " builds";
 moreInfoTxt += " Comment JIRA";
+"\"" + baseBranchForTc + "\")'>Comment JIRA";
 
 var blockersList = "";
 
@@ -319,6 +319,8 @@ function showChainCurrentStatusData(chain, settings) {
 }
 }
 
+res += "Delete all files in checkout directory before each snapshot 
dependency build"
+
 res += " " +
 "Re-run possible blockers";
 
@@ -341,7 +344,9 @@ function showChainCurrentStatusData(chain, settings) {
 "false, " + //observe
 "null, " + // ticketId
 "\"" + chain.prNum + "\", " + //prNum
-"\"" + baseBranchForTc + "\")'> &q

[ignite-teamcity-bot] 04/04: Added web link to suite names in new tests list #170

2020-07-09 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 82c3594269fa07cba9c6a572f8299af92d47df2f
Author: sergeyuttsel 
AuthorDate: Thu Jul 9 23:17:13 2020 +0300

Added web link to suite names in new tests list #170

Signed-off-by: Ivan Rakov 
---
 .../ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java  |  4 ++--
 ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js |  3 +++
 .../org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java |  2 +-
 .../java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java|  2 +-
 .../apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java  | 12 +++-
 5 files changed, 18 insertions(+), 5 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 4523a57..ff4f5e8 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -928,13 +928,13 @@ public class TcBotTriggerAndSignOffService {
 newTests.append(jiraEscText(suite.name)).append("{color}");
 
 int totalNewTests = suite.tests.size();
-newTests.append(" [tests ").append(totalNewTests);
+newTests.append(" [[tests ").append(totalNewTests);
 
 int cnt = 0;
 
 newTestsCount += suite.tests().size();
 
-newTests.append("]\\n");
+newTests.append('|').append(suite.webToBuild).append("]]\\n");
 
 for (ShortTestUi test : suite.tests()) {
 String testColor;
diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js 
b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
index 5a0b573..bc4313e 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
@@ -111,6 +111,9 @@ function showNewTestsData(chain, settings) {
 
 for (var i = 0; i < chain.length; i++) {
 var newTests = chain[i].tests;
+newTestRows += "";
+newTestRows += "" + chain[i].name + "" + "";
+newTestRows += "";
 for (var j = 0; j < newTests.length; j++) {
 newTestsFounded = true
 var newTest = newTests[j];
diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
index 698a8b7..8f0d56b 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
@@ -403,7 +403,7 @@ public class PrChainsProcessor {
 if (!missingTests.isEmpty()) {
 return new ShortSuiteNewTestsUi()
 .tests(missingTests)
-.initFrom(ctx);
+.initFrom(ctx, tcIgnited);
 }
 return null;
 })
diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
index cf2147e..f31aafe 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
@@ -314,7 +314,7 @@ public class DsChainUi {
 if (!missingTests.isEmpty()) {
 return new ShortSuiteNewTestsUi()
 .tests(missingTests)
-.initFrom(suite);
+.initFrom(suite, tcIgnited);
 }
 return null;
 })
diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java
index 8bfb2e5..7e37efb 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.List;
 import javax.annotation.Nonnull;
 import org.apache.ignite.tcbot.engine.chain.MultBuildRunCtx;
+import org.apache.ignite.tcignited.ITeamcityIgnited;
 
 public class ShortSuiteNewTestsUi extends DsHistoryStatUi {
 /** Suite Name */
@@ -28,6 +29,9 @@ public class ShortSuiteNewTestsUi extends DsHistoryStatUi {
 
 public List tests = new ArrayList<>

[ignite-teamcity-bot] branch master updated: Revert "Checkbox 'Delete all files in checkout directory before each snapshot dependency build' added (#161)"

2020-06-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new 6fa6ce6  Revert "Checkbox 'Delete all files in checkout directory 
before each snapshot dependency build' added (#161)"
6fa6ce6 is described below

commit 6fa6ce616c69d846b6473cdedbe4323bebc2ab29
Author: Ivan Rakov 
AuthorDate: Thu Jun 25 14:39:34 2020 +0300

Revert "Checkbox 'Delete all files in checkout directory before each 
snapshot dependency build' added (#161)"

This reverts commit 6d9f9a5d
---
 .../ci/tcbot/visa/TcBotTriggerAndSignOffService.java |  3 +--
 .../org/apache/ignite/ci/web/rest/TriggerBuilds.java |  5 ++---
 ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js | 16 +---
 3 files changed, 8 insertions(+), 16 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 4898b19..8acb1e1 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -267,7 +267,6 @@ public class TcBotTriggerAndSignOffService {
 @Nullable String ticketId,
 @Nullable String prNum,
 @Nullable String baseBranchForTc,
-@Nonnull Boolean cleanSources,
 @Nullable ITcBotUserCreds prov) {
 String jiraRes = "";
 
@@ -298,7 +297,7 @@ public class TcBotTriggerAndSignOffService {
 Set buildidsToSync = new HashSet<>();
 
 for (int i = 0; i < suiteIds.length; i++) {
-T2> objects = 
teamcity.triggerBuild(suiteIds[i], branchForTc, cleanSources, top != null && 
top, new HashMap<>(),
+T2> objects = 
teamcity.triggerBuild(suiteIds[i], branchForTc, false, top != null && top, new 
HashMap<>(),
 false, "");
 buildidsToSync.addAll(objects.get2());
 builds[i] = objects.get1();
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
index ed93be6..75a8d69 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
@@ -83,8 +83,7 @@ public class TriggerBuilds {
 @Nullable @QueryParam("observe") Boolean observe,
 @Nullable @QueryParam("ticketId") String ticketId,
 @Nullable @QueryParam("prNum") String prNum,
-@Nullable @QueryParam("baseBranchForTc") String baseBranchForTc,
-@Nonnull @QueryParam("cleanSources") Boolean cleanSources
+@Nullable @QueryParam("baseBranchForTc") String baseBranchForTc
 ) {
 ITcBotUserCreds prov = ITcBotUserCreds.get(req);
 Injector injector = CtxListener.getInjector(ctx);
@@ -96,7 +95,7 @@ public class TriggerBuilds {
 
 String jiraRes = injector
 .getInstance(TcBotTriggerAndSignOffService.class)
-.triggerBuildsAndObserve(srvCodeOrAlias, branchForTc, 
parentSuiteId, suiteIdList, top, observe, ticketId, prNum, baseBranchForTc, 
cleanSources, prov);
+.triggerBuildsAndObserve(srvCodeOrAlias, branchForTc, 
parentSuiteId, suiteIdList, top, observe, ticketId, prNum, baseBranchForTc, 
prov);
 
 return new TriggerResult("Tests started." + (!jiraRes.isEmpty() ? 
"" + jiraRes : ""));
 }
diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js 
b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
index e3c5ebc..09eb64b 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
@@ -302,7 +302,7 @@ function showChainCurrentStatusData(chain, settings) {
 "\"" + chain.branchName + "\", " +
 "\"" + parentSuitId + "\", " +
 "\"\", " + // ticket id
-"\"" + baseBranchForTc + "\")'>Comment JIRA";
+"\"" + baseBranchForTc + "\")'>Comment JIRA";
 
 var blockersList = "";
 
@@ -319,8 +319,6 @@ function showChainCurrentStatusData(chain, settings) {
 }
 }
 
-res += "Delete all files in checkout directory before each snapshot 
dependency build"
-
 res += " " +
 

[ignite-teamcity-bot] branch master updated: Fixed license headers

2020-06-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new f724478  Fixed license headers
f724478 is described below

commit f724478260049d6e4533681c99a9d93aae53bf46
Author: Ivan Rakov 
AuthorDate: Thu Jun 25 14:34:06 2020 +0300

Fixed license headers
---
 .../org/apache/ignite/tcbot/engine/cleaner/Cleaner.java  | 16 
 .../apache/ignite/tcbot/engine/conf/CleanerConfig.java   | 16 
 .../apache/ignite/tcbot/engine/conf/ICleanerConfig.java  | 16 
 3 files changed, 48 insertions(+)

diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/cleaner/Cleaner.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/cleaner/Cleaner.java
index 4460ffb..4c5ac1f 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/cleaner/Cleaner.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/cleaner/Cleaner.java
@@ -1,3 +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.
+ */
 package org.apache.ignite.tcbot.engine.cleaner;
 
 import java.io.File;
diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/conf/CleanerConfig.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/conf/CleanerConfig.java
index a97f093..b4a63b3 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/conf/CleanerConfig.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/conf/CleanerConfig.java
@@ -1,3 +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.
+ */
 package org.apache.ignite.tcbot.engine.conf;
 
 public class CleanerConfig implements ICleanerConfig{
diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/conf/ICleanerConfig.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/conf/ICleanerConfig.java
index e19642d..ab0cded 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/conf/ICleanerConfig.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/conf/ICleanerConfig.java
@@ -1,3 +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.
+ */
 package org.apache.ignite.tcbot.engine.conf;
 
 public interface ICleanerConfig {



[ignite] branch master updated: IGNITE-13168 Retrigger historical rebalance if it was cancelled in case WAL history is still available - Fixes #7948.

2020-06-23 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new c915cea  IGNITE-13168 Retrigger historical rebalance if it was 
cancelled in case WAL history is still available - Fixes #7948.
c915cea is described below

commit c915ceaa2d12f73ae653f894d7159176aed7f9a3
Author: vd_pyatkov 
AuthorDate: Tue Jun 23 15:35:09 2020 +0300

IGNITE-13168 Retrigger historical rebalance if it was cancelled in case WAL 
history is still available - Fixes #7948.

Signed-off-by: Ivan Rakov 
---
 .../preloader/GridDhtPartitionsExchangeFuture.java | 167 +++
 .../dht/preloader/GridDhtPreloader.java|   9 +-
 .../IgniteDhtPartitionHistorySuppliersMap.java |  15 +-
 .../db/wal/WalRebalanceRestartTest.java| 321 +
 .../TxPartitionCounterStateConsistencyTest.java| 121 
 .../ignite/testsuites/IgnitePdsTestSuite4.java |   2 +
 6 files changed, 513 insertions(+), 122 deletions(-)

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 4f9e1dd..c940813 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
@@ -27,8 +27,10 @@ import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.NavigableSet;
 import java.util.Optional;
 import java.util.Set;
+import java.util.TreeSet;
 import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
@@ -532,9 +534,9 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
  * @param grpId Cache group ID.
  * @param partId Partition ID.
  * @param cntrSince Partition update counter since history supplying is 
requested.
- * @return ID of history supplier node or null if it doesn't exist.
+ * @return List of IDs of history supplier nodes or empty list if these 
doesn't exist.
  */
-@Nullable public UUID partitionHistorySupplier(int grpId, int partId, long 
cntrSince) {
+@Nullable public List partitionHistorySupplier(int grpId, int 
partId, long cntrSince) {
 return partHistSuppliers.getSupplier(grpId, partId, cntrSince);
 }
 
@@ -3274,10 +3276,11 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
  * Collects and determines new owners of partitions for all nodes for 
given {@code top}.
  *
  * @param top Topology to assign.
+ * @param resetOwners True if need to reset partition state considering of 
counter, false otherwise.
  */
-private void assignPartitionStates(GridDhtPartitionTopology top) {
+private void assignPartitionStates(GridDhtPartitionTopology top, boolean 
resetOwners) {
 Map maxCntrs = new HashMap<>();
-Map minCntrs = new HashMap<>();
+Map> varCntrs = new HashMap<>();
 
 for (Map.Entry e : 
msgs.entrySet()) {
 CachePartitionPartialCountersMap nodeCntrs = 
e.getValue().partitionUpdateCounters(top.groupId(),
@@ -3288,9 +3291,9 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 for (int i = 0; i < nodeCntrs.size(); i++) {
 int p = nodeCntrs.partitionAt(i);
 
-UUID uuid = e.getKey();
+UUID remoteNodeId = e.getKey();
 
-GridDhtPartitionState state = top.partitionState(uuid, p);
+GridDhtPartitionState state = top.partitionState(remoteNodeId, 
p);
 
 if (state != GridDhtPartitionState.OWNING && state != 
GridDhtPartitionState.MOVING)
 continue;
@@ -3299,10 +3302,7 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 nodeCntrs.initialUpdateCounterAt(i) :
 nodeCntrs.updateCounterAt(i);
 
-Long minCntr = minCntrs.get(p);
-
-if (minCntr == null || minCntr > cntr)
-minCntrs.put(p, cntr);
+varCntrs.computeIfAbsent(p, key -> new TreeSet<>()).add(cntr);
 
 if (state != GridDhtPartitionState.OWNING)
 continue;
@@ -3310,9 +3310,9 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 CounterWithNodes maxCntr = maxCntrs.get(p);
 
  

[ignite-teamcity-bot] branch master updated: Highlight newly added tests in TC bot visa #166

2020-06-16 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new 5079361  Highlight newly added tests in TC bot visa #166
5079361 is described below

commit 5079361e0c762ef96be43f57be1c32ffd3912ff8
Author: sergeyuttsel 
AuthorDate: Tue Jun 16 14:54:26 2020 +0300

Highlight newly added tests in TC bot visa #166

Signed-off-by: Ivan Rakov 
---
 .../apache/ignite/ci/tcbot/TcBotWebAppModule.java  |  3 +
 .../tcbot/visa/TcBotTriggerAndSignOffService.java  | 84 +-
 .../src/main/webapp/js/testfails-2.2.js| 49 -
 .../ci/tcbot/chain/MockBasedTcBotModule.java   |  1 +
 .../tcbot/engine/chain/TestCompactedMult.java  | 10 ++-
 .../ignite/tcbot/engine/pr/PrChainsProcessor.java  | 84 +-
 .../apache/ignite/tcbot/engine/ui/DsChainUi.java   | 37 ++
 .../tcbot/engine/ui/ShortSuiteNewTestsUi.java  | 46 
 .../apache/ignite/tcbot/engine/ui/ShortTestUi.java | 70 ++
 9 files changed, 376 insertions(+), 8 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
index c4affe0..969e6b6 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
@@ -44,6 +44,8 @@ import 
org.apache.ignite.tcbot.notify.TcBotNotificationsModule;
 import org.apache.ignite.tcbot.persistence.TcBotPersistenceModule;
 import org.apache.ignite.tcbot.persistence.scheduler.SchedulerModule;
 import org.apache.ignite.tcignited.TeamcityIgnitedModule;
+import org.apache.ignite.tcservice.ITeamcityConn;
+import org.apache.ignite.tcservice.TeamcityServiceConnection;
 
 /**
  *
@@ -70,6 +72,7 @@ public class TcBotWebAppModule extends AbstractModule {
 }
 });
 
+bind(ITeamcityConn.class).toInstance(new TeamcityServiceConnection());
 bind(TcUpdatePool.class).in(new SingletonScope());
 bind(IssueDetector.class).in(new SingletonScope());
 bind(ObserverTask.class).in(new SingletonScope());
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 8a05a79..4898b19 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -69,7 +69,9 @@ import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
 import org.apache.ignite.tcbot.engine.pr.BranchTicketMatcher;
 import org.apache.ignite.tcbot.engine.pr.PrChainsProcessor;
 import org.apache.ignite.tcbot.engine.ui.ShortSuiteUi;
+import org.apache.ignite.tcbot.engine.ui.ShortSuiteNewTestsUi;
 import org.apache.ignite.tcbot.engine.ui.ShortTestFailureUi;
+import org.apache.ignite.tcbot.engine.ui.ShortTestUi;
 import org.apache.ignite.tcbot.persistence.IStringCompactor;
 import org.apache.ignite.tcignited.ITeamcityIgnited;
 import org.apache.ignite.tcignited.ITeamcityIgnitedProvider;
@@ -829,13 +831,17 @@ public class TcBotTriggerAndSignOffService {
 SyncMode.RELOAD_QUEUED,
 baseBranch);
 
+List newTestsStatuses = 
prChainsProcessor.getNewTestsSuitesStatuses(buildTypeId, build.branchName, 
srvCodeOrAlias, prov,
+SyncMode.RELOAD_QUEUED,
+baseBranch);
+
 if (suitesStatuses == null)
 return new Visa("JIRA wasn't commented - no finished builds to 
analyze." +
 " Check builds availabiliy for branch: " + 
build.branchName + "/" + baseBranch);
 
 blockers = 
suitesStatuses.stream().mapToInt(ShortSuiteUi::totalBlockers).sum();
 
-String comment = generateJiraComment(suitesStatuses, build.webUrl, 
buildTypeId, tcIgnited, blockers, build.branchName, baseBranch);
+String comment = generateJiraComment(suitesStatuses, 
newTestsStatuses, build.webUrl, buildTypeId, tcIgnited, blockers, 
build.branchName, baseBranch);
 
 
 res = objMapper.readValue(jira.postJiraComment(ticket, comment), 
JiraCommentResponse.class);
@@ -862,7 +868,7 @@ public class TcBotTriggerAndSignOffService {
  * @param baseBranch TC Base branch used for comment
  * @return Comment, which should be sent to the JIRA ticket.
  */
-private String generateJiraComment(List suites, String 
webUrl, String buildTypeId,
+private String generateJiraComment(List suites, 
List newTestsStatuses, Str

[ignite-teamcity-bot] branch master updated: Cleanup team tags if issue on board is partially fixed - Fixes #164.

2020-06-10 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new 4194d17  Cleanup team tags if issue on board is partially fixed - 
Fixes #164.
4194d17 is described below

commit 4194d17fce37bf039362539b54770c14ad4f45a3
Author: sergeyuttsel 
AuthorDate: Wed Jun 10 19:30:05 2020 +0300

Cleanup team tags if issue on board is partially fixed - Fixes #164.

Signed-off-by: Ivan Rakov 
---
 .../java/org/apache/ignite/tcbot/engine/board/BoardService.java| 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/board/BoardService.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/board/BoardService.java
index 9042e1e..809f686 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/board/BoardService.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/board/BoardService.java
@@ -25,6 +25,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.Set;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -112,7 +113,6 @@ public class BoardService {
 Map build = next.buildsInvolved();
 for (DefectFirstBuild cause : build.values()) {
 FatBuildCompacted firstBuild = cause.build();
-
defectUi.addTags(SingleBuildRunCtx.getBuildTagsFromParameters(cfg, compactor, 
firstBuild));
 FatBuildCompacted fatBuild = 
fatBuildDao.getFatBuild(next.tcSrvId(), firstBuild.id());
 
 List> futures = 
buildChainProcessor.replaceWithRecent(fatBuild, allBuildsMap, tcIgn);
@@ -124,9 +124,12 @@ public class BoardService {
 
 rebuild = !freshRebuild.isEmpty() ? 
freshRebuild.stream().findFirst() : Optional.empty();
 
+Set tags = 
SingleBuildRunCtx.getBuildTagsFromParameters(cfg, compactor, firstBuild);
+
 for (DefectIssue issue : cause.issues()) {
 BoardDefectIssueUi issueUi = processIssue(tcIgn, rebuild, 
issue, firstBuild.buildTypeId());
-
+if (issueUi.status() != IssueResolveStatus.FIXED)
+defectUi.addTags(tags);
 defectUi.addIssue(issueUi);
 }
 }



[ignite] branch master updated: IGNITE-13052 Calculate result of reserveHistoryForExchange in advance - Fixes #7911.

2020-06-10 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new b4bdddf  IGNITE-13052 Calculate result of reserveHistoryForExchange in 
advance - Fixes #7911.
b4bdddf is described below

commit b4bdddf1504413b5cfee08fd007be0a020932168
Author: Vladislav Pyatkov 
AuthorDate: Wed Jun 10 19:07:45 2020 +0300

IGNITE-13052 Calculate result of reserveHistoryForExchange in advance - 
Fixes #7911.

Signed-off-by: Ivan Rakov 
---
 .../preloader/GridDhtPartitionsExchangeFuture.java |  44 ++-
 .../GridCacheDatabaseSharedManager.java|  63 ++---
 .../cache/persistence/GridCacheOffheapManager.java |  15 +-
 .../IgniteCacheDatabaseSharedManager.java  |   8 +-
 .../persistence/checkpoint/CheckpointEntry.java|  15 +-
 .../persistence/checkpoint/CheckpointHistory.java  | 294 +++--
 .../persistence/WalPreloadingConcurrentTest.java   |  10 +-
 .../db/wal/HistoricalReservationTest.java  | 227 
 .../db/wal/IgniteWalHistoryReservationsTest.java   | 144 ++
 .../ignite/testsuites/IgnitePdsTestSuite4.java |   6 +-
 10 files changed, 604 insertions(+), 222 deletions(-)

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 8dde2bd..a18ecc0 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
@@ -1530,22 +1530,6 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 
 timeBag.finishGlobalStage("Preloading notification");
 
-cctx.exchange().exchangerBlockingSectionBegin();
-
-try {
-cctx.database().releaseHistoryForPreloading();
-
-// To correctly rebalance when persistence is enabled, it is 
necessary to reserve history within exchange.
-partHistReserved = cctx.database().reserveHistoryForExchange();
-}
-finally {
-cctx.exchange().exchangerBlockingSectionEnd();
-}
-
-clearingPartitions = new HashMap();
-
-timeBag.finishGlobalStage("WAL history reservation");
-
 // Skipping wait on local join is available when all cluster nodes 
have the same protocol.
 boolean skipWaitOnLocalJoin = localJoinExchange()
 && cctx.exchange().latch().canSkipJoiningNodes(initialVersion());
@@ -1672,6 +1656,22 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 
 timeBag.finishGlobalStage("After states restored callback");
 
+cctx.exchange().exchangerBlockingSectionBegin();
+
+try {
+cctx.database().releaseHistoryForPreloading();
+
+// To correctly rebalance when persistence is enabled, it is 
necessary to reserve history within exchange.
+partHistReserved = cctx.database().reserveHistoryForExchange();
+}
+finally {
+cctx.exchange().exchangerBlockingSectionEnd();
+}
+
+clearingPartitions = new HashMap();
+
+timeBag.finishGlobalStage("WAL history reservation");
+
 changeWalModeIfNeeded();
 
 if (events().hasServerLeft())
@@ -2435,15 +2435,11 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 Map, Long> localReserved = 
partHistSuppliers.getReservations(cctx.localNodeId());
 
 if (localReserved != null) {
-for (Map.Entry, Long> e : 
localReserved.entrySet()) {
-boolean success = 
cctx.database().reserveHistoryForPreloading(
-e.getKey().get1(), e.getKey().get2(), e.getValue());
+boolean success = 
cctx.database().reserveHistoryForPreloading(localReserved);
 
-if (!success) {
-// TODO: how to handle?
-err = new IgniteCheckedException("Could not reserve 
history");
-}
-}
+// TODO: how to handle?
+if (!success)
+err = new IgniteCheckedException("Could not reserve 
history");
 }
 
 cctx.database().releaseHistoryForExchange();
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/proc

[ignite-teamcity-bot] branch master updated: Cache and log cleaner (#162)

2020-06-03 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new d46d694  Cache and log cleaner (#162)
d46d694 is described below

commit d46d69427c15d822244bb579570183e844c9c317
Author: sergeyuttsel 
AuthorDate: Wed Jun 3 21:14:46 2020 +0300

Cache and log cleaner (#162)

Signed-off-by: Ivan Rakov 
---
 .../ci/tcbot/conf/LocalFilesBasedConfig.java   |   8 ++
 .../ignite/ci/web/rest/login/UserService.java  |   4 +
 .../ci/tcbot/chain/MockBasedTcBotModule.java   |   6 ++
 .../ignite/tcbot/engine/cleaner/Cleaner.java   | 115 +
 .../ignite/tcbot/engine/conf/CleanerConfig.java|  41 
 .../ignite/tcbot/engine/conf/ICleanerConfig.java   |  12 +++
 .../ignite/tcbot/engine/conf/ITcBotConfig.java |   2 +
 .../ignite/tcbot/engine/conf/TcBotJsonConfig.java  |   6 ++
 .../tcbot/engine/defect/DefectCompacted.java   |   4 +
 .../ignite/tcbot/engine/defect/DefectsStorage.java |  20 
 .../ignite/tcbot/engine/issue/IIssuesStorage.java  |   2 +
 .../ignite/tcbot/engine/issue/IssuesStorage.java   |  21 
 .../ignited/buildcondition/BuildConditionDao.java  |   4 +
 .../apache/ignite/tcignited/build/FatBuildDao.java |  29 ++
 .../tcignited/buildlog/BuildLogCheckResultDao.java |   4 +
 .../ignite/tcignited/buildref/BuildRefDao.java |   4 +
 .../tcignited/history/BuildStartTimeStorage.java   |   9 ++
 .../history/SuiteInvocationHistoryDao.java |   4 +
 18 files changed, 295 insertions(+)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
index 6be47bc..d6ff6ec 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
@@ -32,7 +32,9 @@ import org.apache.ignite.tcbot.common.exeption.ExceptionUtil;
 import org.apache.ignite.tcbot.common.interceptor.GuavaCached;
 import org.apache.ignite.tcbot.common.conf.ITcServerConfig;
 import org.apache.ignite.tcbot.common.conf.TcBotWorkDir;
+import org.apache.ignite.tcbot.engine.conf.CleanerConfig;
 import org.apache.ignite.tcbot.engine.conf.GitHubConfig;
+import org.apache.ignite.tcbot.engine.conf.ICleanerConfig;
 import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
 import org.apache.ignite.tcbot.engine.conf.ITrackedBranchesConfig;
 import org.apache.ignite.tcbot.engine.conf.JiraServerConfig;
@@ -142,4 +144,10 @@ public class LocalFilesBasedConfig implements ITcBotConfig 
{
 return HelperConfig.loadAuthProperties(workDir, cfgName);
 }
 
+/** {@inheritDoc} */
+@Override public ICleanerConfig getCleanerConfig() {
+CleanerConfig cfg = getConfig().getCleanerConfig();
+return cfg != null ? cfg : CleanerConfig.getDefaultCleanerConfig();
+}
+
 }
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/login/UserService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/login/UserService.java
index d88f36f..b686414 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/login/UserService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/login/UserService.java
@@ -32,6 +32,7 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Form;
 import javax.ws.rs.core.MediaType;
 import org.apache.ignite.ci.tcbot.ITcBotBgAuth;
+import org.apache.ignite.tcbot.engine.cleaner.Cleaner;
 import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
 import org.apache.ignite.ci.tcbot.issue.IssueDetector;
 import org.apache.ignite.tcbot.engine.user.IUserStorage;
@@ -105,6 +106,9 @@ public class UserService {
 
 
CtxListener.getInjector(ctx).getInstance(TcBotTriggerAndSignOffService.class).startObserver();
 
+Cleaner cleaner = injector.getInstance(Cleaner.class);
+cleaner.startBackgroundClean();
+
 return userMenu(prov,
 injector.getInstance(IUserStorage.class),
 issueDetector);
diff --git 
a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/MockBasedTcBotModule.java
 
b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/MockBasedTcBotModule.java
index 09d3677..f56522c 100644
--- 
a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/MockBasedTcBotModule.java
+++ 
b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/MockBasedTcBotModule.java
@@ -29,6 +29,8 @@ import org.apache.ignite.jiraignited.IJiraIgnited;
 import org.apache.ignite.jiraignited.IJiraIgnitedProvider;
 import org.apache.ignite.jiraservice.IJiraIntegration;
 import

[ignite-teamcity-bot] branch master updated: Added regex for test class and method name (#163)

2020-06-03 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new 6d6da9d  Added regex for test class and method name (#163)
6d6da9d is described below

commit 6d6da9d12ef15a28136110b4866a96b2a27fd6ce
Author: sergeyuttsel 
AuthorDate: Wed Jun 3 21:02:19 2020 +0300

Added regex for test class and method name (#163)

Signed-off-by: Ivan Rakov 
---
 .../apache/ignite/tcbot/engine/ui/ShortTestFailureUi.java| 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortTestFailureUi.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortTestFailureUi.java
index 92a2319..a1a8560 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortTestFailureUi.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortTestFailureUi.java
@@ -17,6 +17,8 @@
 package org.apache.ignite.tcbot.engine.ui;
 
 import com.google.common.base.Strings;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import org.apache.ignite.tcbot.engine.chain.TestCompactedMult;
@@ -24,6 +26,8 @@ import org.apache.ignite.tcignited.ITeamcityIgnited;
 import org.apache.ignite.tcignited.history.IRunHistory;
 
 public class ShortTestFailureUi {
+private static final Pattern TEST_CLASS_AND_METHOD_PATTERN = 
Pattern.compile("([^.]+[.][^.]+(\\[.+\\])?$)");
+
 /** Test full Name */
 public String name;
 
@@ -62,13 +66,11 @@ public class ShortTestFailureUi {
 
 public static String extractTest(String s) {
 String testShort = s.trim();
-String[] testComps = testShort.split("\\.");
-if (testComps.length > 2)
-return testComps[testComps.length - 2] + "." + 
testComps[testComps.length - 1];
-return null;
+Matcher matcher = TEST_CLASS_AND_METHOD_PATTERN.matcher(testShort);
+return matcher.find() ? matcher.group(0) : null;
 }
 
-public static   String extractSuite(String s) {
+public static String extractSuite(String s) {
 String suiteShort = s.trim();
 String[] suiteComps = suiteShort.split("\\.");
 if (suiteComps.length > 1)



[ignite] branch IGNITE-13060 updated: IGNITE-13060 Fixed package names + performance optimizations for NoopTracingSpi case

2020-06-03 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch IGNITE-13060
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/IGNITE-13060 by this push:
 new 8bf5551  IGNITE-13060 Fixed package names + performance optimizations 
for NoopTracingSpi case
8bf5551 is described below

commit 8bf555189bd3733a7e9e774650d8614caffa9049
Author: alapin 
AuthorDate: Wed Jun 3 12:57:07 2020 +0300

IGNITE-13060 Fixed package names + performance optimizations for 
NoopTracingSpi case

Signed-off-by: Ivan Rakov 
---
 .../src/main/java/org/apache/ignite/Ignite.java|   4 +-
 .../ignite/configuration/IgniteConfiguration.java  |   2 +-
 .../org/apache/ignite/internal/IgniteKernal.java   |   2 +-
 .../org/apache/ignite/internal/IgnitionEx.java |   2 +-
 .../commandline/TracingConfigurationCommand.java   |   6 +-
 .../argument/TracingConfigurationCommandArg.java   |   5 +-
 .../TracingConfigurationArguments.java |   6 +-
 .../managers/communication/GridIoManager.java  |  14 +--
 .../managers/tracing/GridTracingManager.java   |  56 ---
 .../cache/CacheAffinitySharedManager.java  |   2 +-
 .../cache/GridCachePartitionExchangeManager.java   |  18 ++--
 .../preloader/GridDhtPartitionsExchangeFuture.java |  19 ++--
 .../cache/transactions/IgniteTransactionsImpl.java |   8 +-
 .../internal/processors/tracing/DeferredSpan.java  |  20 ++--
 .../internal/processors/tracing/NoopSpan.java  |  18 +---
 .../internal/processors/tracing/NoopTracing.java   |   2 +-
 .../ignite/internal/processors/tracing/Span.java   |  32 ++-
 .../internal/processors/tracing/SpanImpl.java  |  29 ++
 .../internal/processors/tracing/SpanType.java  |   2 +
 .../internal/processors/tracing/Tracing.java   |   2 +-
 .../GridTracingConfigurationManager.java   |   5 +-
 .../NoopTracingConfigurationManager.java   |   5 +-
 .../tracing/messages/TraceableMessagesHandler.java |   6 +-
 .../ignite/internal/util/nio/GridNioServer.java|   4 +-
 .../util/nio/GridSelectorNioSessionImpl.java   |   4 +-
 .../VisorTracingConfigurationItem.java |   6 +-
 .../VisorTracingConfigurationTask.java |   6 +-
 .../VisorTracingConfigurationTaskArg.java  |   4 +-
 .../VisorTracingConfigurationTaskResult.java   |   4 +-
 .../spi/communication/tcp/TcpCommunicationSpi.java |   6 +-
 .../ignite/spi/discovery/tcp/ClientImpl.java   |   8 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java   | 105 +++--
 .../tracing/NoopSpiSpecificSpan.java   |   2 +-
 .../processors => spi}/tracing/NoopTracingSpi.java |   2 +-
 .../processors => spi}/tracing/Scope.java  |   2 +-
 .../processors => spi}/tracing/SpanStatus.java |   2 +-
 .../tracing/SpiSpecificSpan.java   |   3 +-
 .../tracing}/TracingConfigurationCoordinates.java  |   3 +-
 .../tracing}/TracingConfigurationManager.java  |   5 +-
 .../tracing}/TracingConfigurationParameters.java   |  11 +--
 .../processors => spi}/tracing/TracingSpi.java |   2 +-
 .../processors => spi}/tracing/TracingSpiType.java |   2 +-
 .../tracing/package-info.java} |  14 +--
 .../main/resources/META-INF/classnames.properties  |   2 +
 .../commandline/CommandHandlerParsingTest.java |   2 +-
 .../internal/processors/igfs/IgfsIgniteMock.java   |   2 +-
 .../ignite/testframework/junits/IgniteMock.java|   2 +-
 .../junits/multijvm/IgniteProcessProxy.java|   2 +-
 ...GridCommandHandlerTracingConfigurationTest.java |  14 +--
 ...andHandlerClusterByClassWithSSLTest_help.output |  18 
 .../tracing/opencensus/OpenCensusSpanAdapter.java  |   5 +-
 .../tracing/opencensus/OpenCensusTracingSpi.java   |  10 +-
 .../tracing/opencensus}/StatusMatchTable.java  |   4 +-
 .../ignite/TracingConfigurationValidationTest.java |  14 +--
 .../monitoring/opencensus/AbstractTracingTest.java |  16 ++--
 .../monitoring/opencensus/MixedTracingSpiTest.java |   2 +-
 .../OpenCensusTracingConfigurationGetAllTest.java  |  12 +--
 .../OpenCensusTracingConfigurationGetTest.java |  12 +--
 ...OpenCensusTracingConfigurationResetAllTest.java |  13 +--
 .../OpenCensusTracingConfigurationResetTest.java   |   9 +-
 .../opencensus/OpenCensusTracingSpiTest.java   |  16 ++--
 .../OpenCensusTxTracingConfigurationTest.java  |  14 +--
 .../opencensus/OpenCensusTxTracingTest.java|  10 +-
 .../java/org/apache/ignite/IgniteSpringBean.java   |   2 +-
 parent/pom.xml |   4 +
 65 files changed, 336 insertions(+), 309 deletions(-)

diff --git a/modules/core/src/main/java/org/apache/ignite/Ignite.java 
b/modules/core/src/main/java/org/apache/ignite/Ignite.java
index 03a1296..194a7e9 100644
--- a/modules/core/src/main/java/org/apache/ignite/Ignite.java
+++ b/modules/core/src/main/java/org/apache/ignite/Ignit

[ignite] branch master updated: IGNITE-13044 Additional possibility to check for high contending keys generated by the transaction payload. - Fixes #7824

2020-05-29 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 9479377  IGNITE-13044 Additional possibility to check for high 
contending keys generated by the transaction payload. - Fixes #7824
9479377 is described below

commit 947937733cc7da8d9dde81c38570aded6b57008a
Author: zstan 
AuthorDate: Fri May 29 20:35:56 2020 +0300

IGNITE-13044 Additional possibility to check for high contending keys 
generated by the transaction payload. - Fixes #7824

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/IgniteSystemProperties.java  |   8 +
 .../java/org/apache/ignite/cache/CacheMetrics.java |  12 +
 .../org/apache/ignite/internal/IgniteFeatures.java |  10 +-
 .../org/apache/ignite/internal/IgniteKernal.java   |  43 ---
 .../ignite/internal/TransactionsMXBeanImpl.java|  10 +
 .../cache/CacheClusterMetricsMXBeanImpl.java   |   5 +
 .../cache/CacheLocalMetricsMXBeanImpl.java |   5 +
 .../processors/cache/CacheMetricsImpl.java |  61 
 .../processors/cache/CacheMetricsSnapshot.java |   5 +
 .../processors/cache/CacheMetricsSnapshotV2.java   |  12 +
 .../cache/LongOperationsDumpSettingsClosure.java   |   8 +-
 .../distributed/GridDistributedCacheEntry.java |   4 +
 .../cache/transactions/IgniteTxManager.java| 291 +++---
 .../TxCollisionsDumpSettingsClosure.java}  |  33 +-
 .../apache/ignite/internal/util/IgniteUtils.java   |  30 ++
 .../apache/ignite/mxbean/CacheMetricsMXBean.java   |  17 +-
 .../apache/ignite/mxbean/TransactionsMXBean.java   |  20 ++
 .../processors/cache/CacheMetricsManageTest.java   | 342 -
 .../transactions/TxWithKeyContentionSelfTest.java  | 338 
 .../TxWithSmallTimeoutAndContentionOneKeyTest.java |   9 +
 .../platform/PlatformCacheWriteMetricsTask.java|   5 +
 .../ignite/testsuites/IgniteCacheTestSuite7.java   |   3 +
 22 files changed, 1156 insertions(+), 115 deletions(-)

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 ee5b2d1..b362a36 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -1319,6 +1319,14 @@ public final class IgniteSystemProperties {
 public static final String IGNITE_TCP_COMM_SET_ATTR_HOST_NAMES = 
"IGNITE_TCP_COMM_SET_ATTR_HOST_NAMES";
 
 /**
+ * When above zero, prints tx key collisions once per interval.
+ * Each transaction besides OPTIMISTIC SERIALIZABLE capture locks on all 
enlisted keys, for some reasons
+ * per key lock queue may rise. This property sets the interval during 
which statistics are collected.
+ * Default is 1000 ms.
+ */
+public static final String IGNITE_DUMP_TX_COLLISIONS_INTERVAL = 
"IGNITE_DUMP_TX_COLLISIONS_INTERVAL";
+
+/**
  * Enforces singleton.
  */
 private IgniteSystemProperties() {
diff --git 
a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java 
b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
index 1921dbb..09bf550 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
@@ -21,6 +21,9 @@ import javax.cache.Cache;
 import javax.cache.integration.CacheLoader;
 import javax.cache.integration.CacheWriter;
 import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.mxbean.TransactionsMXBean;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * Cache metrics used to obtain statistics on cache itself.
@@ -708,4 +711,13 @@ public interface CacheMetrics {
  * @return {@code true} when cache topology is valid for writing.
  */
 public boolean isValidForWriting();
+
+/**
+ * Checks if there were any tx key collisions last time.
+ * Interval for check specified throught: {@link 
IgniteSystemProperties#IGNITE_DUMP_TX_COLLISIONS_INTERVAL} or
+ * {@link TransactionsMXBean#setTxKeyCollisionsInterval(int)}.
+ *
+ * @return Key collisions and appropriate queue size string representation.
+ */
+@NotNull public String getTxKeyCollisions();
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
index 0bba3f2..904d93e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
@@ -98,8 +98,14 @@ public enum IgniteFeatures {
 /** Persistence caches can be snapshot.  */
 PERSISTEN

[ignite] branch master updated: IGNITE-13041 PDS (Indexing) is failed with 137 code - Fixes #7820.

2020-05-28 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 41e8a93  IGNITE-13041 PDS (Indexing) is failed with 137 code - Fixes 
#7820.
41e8a93 is described below

commit 41e8a93f4991278c94503c186b60cdc9b2776fd4
Author: Anton Kalashnikov 
AuthorDate: Thu May 28 21:06:53 2020 +0300

IGNITE-13041 PDS (Indexing) is failed with 137 code - Fixes #7820.

Signed-off-by: Ivan Rakov 
---
 .../IgnitePdsBinaryMetadataAsyncWritingTest.java   | 18 --
 .../IgnitePdsCacheRebalancingAbstractTest.java |  8 
 .../cache/persistence/IgnitePdsCorruptedIndexTest.java |  2 +-
 .../db/IgniteSequentialNodeCrashRecoveryTest.java  |  2 +-
 .../persistence/db/wal/IgniteWalRecoveryPPCTest.java   |  8 
 .../cache/persistence/db/wal/WalOnNodeStartTest.java   |  1 +
 .../persistence/db/wal/IgniteWalRecoveryTest.java  |  4 ++--
 7 files changed, 29 insertions(+), 14 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java
index 2003ade..f75f5c7 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java
@@ -85,6 +85,7 @@ public class IgnitePdsBinaryMetadataAsyncWritingTest extends 
GridCommonAbstractT
 new DataStorageConfiguration()
 .setDefaultDataRegionConfiguration(
 new DataRegionConfiguration()
+.setMaxSize(50 * 1024 * 1024)
 .setPersistenceEnabled(true)
 )
 .setFileIOFactory(
@@ -473,7 +474,7 @@ public class IgnitePdsBinaryMetadataAsyncWritingTest 
extends GridCommonAbstractT
 
 fileWriteLatch.countDown();
 
-assertTrue(GridTestUtils.waitForCondition(() -> map.isEmpty(), 5_000));
+assertTrue(GridTestUtils.waitForCondition(map::isEmpty, 15_000));
 }
 
 /**
@@ -581,13 +582,26 @@ public class IgnitePdsBinaryMetadataAsyncWritingTest 
extends GridCommonAbstractT
 private int findAffinityKeyForNode(Affinity aff, ClusterNode targetNode, 
Integer... excludeKeys) {
 int key = 0;
 
-while (true) {
+while (key < 100) {
 if (aff.isPrimary(targetNode, key)
 && (excludeKeys != null ? 
!Arrays.asList(excludeKeys).contains(Integer.valueOf(key)) : true))
 return key;
 
 key++;
 }
+//Unreachable line in success scenario.
+//Diagnostic info:
+while (key >= 0) {
+log.warning("Unmapped KEY = " + key
++ " : nodes = " + aff.mapKeyToPrimaryAndBackups(key)
++ " : parition = " + aff.partition(key));
+
+key--;
+}
+
+log.warning("Target node primary partitions : " + 
Arrays.toString(aff.primaryPartitions(targetNode)));
+
+throw new IllegalStateException("Impossible to find affinity key for 
node = " + targetNode + ", affinity = " + aff);
 }
 
 /** */
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java
index fde3ee8..1720469 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache.persistence;
 
-import com.google.common.collect.Lists;
+import javax.cache.Cache;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -34,7 +34,7 @@ import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
-import javax.cache.Cache;
+import com.google.common.collect.Lists;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteDataStreamer;
@@ -160,10 +160,10 @@ public abstract class 
IgnitePdsCacheRebalancingAbstractTest extends GridCommonAb
 .setDefaultDataRegionConfiguration(new DataRegionConfiguration()
   

[ignite-teamcity-bot] branch master updated (173e4b7 -> 6d9f9a5)

2020-05-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git.


from 173e4b7  Revert "Highlight newly added tests in TC bot visa (#158)"
 new 9d2f5c4  Consider fail exit code and oom as a critical problem to show 
on board (#160)
 new 6d9f9a5  Checkbox 'Delete all files in checkout directory before each 
snapshot dependency build' added (#161)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../ci/tcbot/visa/TcBotTriggerAndSignOffService.java |  3 ++-
 .../org/apache/ignite/ci/web/rest/TriggerBuilds.java |  5 +++--
 ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js | 16 +++-
 .../ignite/tcbot/engine/chain/MultBuildRunCtx.java   |  4 +++-
 .../ci/teamcity/ignited/fatbuild/ProblemCompacted.java   |  4 +++-
 5 files changed, 22 insertions(+), 10 deletions(-)



[ignite-teamcity-bot] 01/02: Consider fail exit code and oom as a critical problem to show on board (#160)

2020-05-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 9d2f5c4bbc8a79fb7172273a1345068c64da66d1
Author: sergeyuttsel 
AuthorDate: Mon May 25 20:30:20 2020 +0300

Consider fail exit code and oom as a critical problem to show on board 
(#160)

Signed-off-by: Ivan Rakov 
---
 .../java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java| 4 +++-
 .../apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java  | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
index 22ec872..dd639f9 100644
--- 
a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
+++ 
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
@@ -597,7 +597,9 @@ public class MultBuildRunCtx implements ISuiteResults {
 return hasJvmCrashProblem()
 || hasTimeoutProblem()
 || hasCompilationProblem()
-|| hasMetricProblem();
+|| hasMetricProblem()
+|| hasExitCodeProblem()
+|| hasOomeProblem();
 }
 
 public int totalTests() {
diff --git 
a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java
 
b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java
index 313b273..8fa8785 100644
--- 
a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java
+++ 
b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java
@@ -183,7 +183,9 @@ public class ProblemCompacted {
 return isExecutionTimeout(compactor)
 || isJvmCrash(compactor)
 || isBuildFailureOnMetric(compactor)
-|| isCompilationError(compactor);
+|| isCompilationError(compactor)
+|| isExitCode(compactor)
+|| isOome(compactor);
 }
 
 public boolean isBuildFailureOnMessage(IStringCompactor compactor) {



[ignite-teamcity-bot] 02/02: Checkbox 'Delete all files in checkout directory before each snapshot dependency build' added (#161)

2020-05-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 6d9f9a5d78293de5a9377786f3227c5bb101c4f9
Author: sergeyuttsel 
AuthorDate: Mon May 25 20:32:22 2020 +0300

Checkbox 'Delete all files in checkout directory before each snapshot 
dependency build' added (#161)

Signed-off-by: Ivan Rakov 
---
 .../ci/tcbot/visa/TcBotTriggerAndSignOffService.java |  3 ++-
 .../org/apache/ignite/ci/web/rest/TriggerBuilds.java |  5 +++--
 ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js | 16 +++-
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index c97fd66..8a05a79 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -265,6 +265,7 @@ public class TcBotTriggerAndSignOffService {
 @Nullable String ticketId,
 @Nullable String prNum,
 @Nullable String baseBranchForTc,
+@Nonnull Boolean cleanSources,
 @Nullable ITcBotUserCreds prov) {
 String jiraRes = "";
 
@@ -295,7 +296,7 @@ public class TcBotTriggerAndSignOffService {
 Set buildidsToSync = new HashSet<>();
 
 for (int i = 0; i < suiteIds.length; i++) {
-T2> objects = 
teamcity.triggerBuild(suiteIds[i], branchForTc, false, top != null && top, new 
HashMap<>(),
+T2> objects = 
teamcity.triggerBuild(suiteIds[i], branchForTc, cleanSources, top != null && 
top, new HashMap<>(),
 false, "");
 buildidsToSync.addAll(objects.get2());
 builds[i] = objects.get1();
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
index 75a8d69..ed93be6 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
@@ -83,7 +83,8 @@ public class TriggerBuilds {
 @Nullable @QueryParam("observe") Boolean observe,
 @Nullable @QueryParam("ticketId") String ticketId,
 @Nullable @QueryParam("prNum") String prNum,
-@Nullable @QueryParam("baseBranchForTc") String baseBranchForTc
+@Nullable @QueryParam("baseBranchForTc") String baseBranchForTc,
+@Nonnull @QueryParam("cleanSources") Boolean cleanSources
 ) {
 ITcBotUserCreds prov = ITcBotUserCreds.get(req);
 Injector injector = CtxListener.getInjector(ctx);
@@ -95,7 +96,7 @@ public class TriggerBuilds {
 
 String jiraRes = injector
 .getInstance(TcBotTriggerAndSignOffService.class)
-.triggerBuildsAndObserve(srvCodeOrAlias, branchForTc, 
parentSuiteId, suiteIdList, top, observe, ticketId, prNum, baseBranchForTc, 
prov);
+.triggerBuildsAndObserve(srvCodeOrAlias, branchForTc, 
parentSuiteId, suiteIdList, top, observe, ticketId, prNum, baseBranchForTc, 
cleanSources, prov);
 
 return new TriggerResult("Tests started." + (!jiraRes.isEmpty() ? 
"" + jiraRes : ""));
 }
diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js 
b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
index 0424aec..9475f30 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
@@ -256,7 +256,7 @@ function showChainCurrentStatusData(chain, settings) {
 "\"" + chain.branchName + "\", " +
 "\"" + parentSuitId + "\", " +
 "\"\", " + // ticket id
-"\"" + baseBranchForTc + "\")'>Comment JIRA";
+"\"" + baseBranchForTc + "\")'>Comment JIRA";
 
 var blockersList = "";
 
@@ -273,6 +273,8 @@ function showChainCurrentStatusData(chain, settings) {
 }
 }
 
+res += "Delete all files in checkout directory before each snapshot 
dependency build"
+
 res += " " +
 "Re-run possible blockers";
 
@@ -295,7 +298,9 @@ function showChainCurrentStatusData(chain, settings) {
 "false, " + //observe
 "null, " + // ticketId
 "\""

[ignite] 02/03: IGNITE-13060 Merge issue fixed.

2020-05-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch IGNITE-13060
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 06bfc3805e3a7ad6e643d884a26e482267d10115
Author: sanpwc 
AuthorDate: Mon May 25 12:47:40 2020 +0300

IGNITE-13060 Merge issue fixed.
---
 .../ignite/internal/managers/discovery/GridDiscoveryManager.java   | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 5642ee5..aaf68c0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2873,6 +2873,9 @@ public class GridDiscoveryManager extends 
GridManagerAdapter {
 void addEvent(NotificationEvent notificationEvt) {
 assert notificationEvt.node != null : notificationEvt.data;
 
+if (notificationEvt.type == EVT_CLIENT_NODE_DISCONNECTED)
+discoWrk.disconnectEvtFut = new GridFutureAdapter();
+
 evts.add(notificationEvt);
 }
 



[ignite] branch IGNITE-13060 created (now 9d58d7a)

2020-05-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a change to branch IGNITE-13060
in repository https://gitbox.apache.org/repos/asf/ignite.git.


  at 9d58d7a  IGNITE-13060 Removing tracing from .net.

This branch includes the following new commits:

 new 3d205f9  Merge branch 'master' of 
https://gitbox.apache.org/repos/asf/ignite into IGNITE-13060
 new 06bfc38  IGNITE-13060 Merge issue fixed.
 new 9d58d7a  IGNITE-13060 Removing tracing from .net.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[ignite] 01/03: Merge branch 'master' of https://gitbox.apache.org/repos/asf/ignite into IGNITE-13060

2020-05-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch IGNITE-13060
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 3d205f92f52f3804b7cd490f5dd50afbbe64089d
Merge: 5f39834 5e3cadc
Author: alapin 
AuthorDate: Mon May 25 11:49:43 2020 +0300

Merge branch 'master' of https://gitbox.apache.org/repos/asf/ignite into 
IGNITE-13060

 .../processors/cache/ClusterCachesInfo.java|   7 +-
 .../processors/cache/DynamicCacheDescriptor.java   |   6 +-
 .../platform/services/PlatformAbstractService.java |   8 +-
 .../platform/services/PlatformService.java |  13 +
 .../processors/platform/utils/PlatformUtils.java   |  16 +-
 .../processors/service/GridServiceProcessor.java   |  10 +-
 .../processors/service/GridServiceProxy.java   |  81 -
 .../processors/service/IgniteServiceProcessor.java |  14 +-
 .../ignite/platform/PlatformServiceMethod.java |  48 +++
 ...acheConfigurationSerializationAbstractTest.java | 218 +
 ...eConfigurationSerializationOnDiscoveryTest.java | 162 +-
 ...heConfigurationSerializationOnExchangeTest.java | 189 +--
 .../platform/AbstractPlatformServiceCallTask.java  | 278 +
 .../PlatformServiceCallCollectionsTask.java|  93 ++
 .../ignite/platform/PlatformServiceCallTask.java   |  81 +
 .../Apache.Ignite.Core.Tests.DotNetCore.csproj |   1 +
 .../Apache.Ignite.Core.Tests.csproj|   1 +
 .../Services/CallPlatformServiceTest.cs| 345 +
 18 files changed, 1219 insertions(+), 352 deletions(-)



[ignite] 03/03: IGNITE-13060 Removing tracing from .net.

2020-05-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch IGNITE-13060
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 9d58d7ab8ac75c801f4bc674d6895e839c6a657e
Author: sanpwc 
AuthorDate: Mon May 25 13:41:35 2020 +0300

IGNITE-13060 Removing tracing from .net.
---
 .../dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj   |  4 
 .../dotnet/Apache.Ignite.Core/IgniteConfiguration.cs  | 11 ---
 .../dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd  |  5 -
 3 files changed, 20 deletions(-)

diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj 
b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index 6bd10af..09e6c8c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -201,10 +201,6 @@
 
 
 
-
-
-
-
 
 
 
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs 
b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
index 11cd080..4bfefd1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfiguration.cs
@@ -52,7 +52,6 @@ namespace Apache.Ignite.Core
 using Apache.Ignite.Core.PersistentStore;
 using Apache.Ignite.Core.Plugin;
 using Apache.Ignite.Core.Ssl;
-using Apache.Ignite.Core.Tracing;
 using Apache.Ignite.Core.Transactions;
 using BinaryReader = Apache.Ignite.Core.Impl.Binary.BinaryReader;
 using BinaryWriter = Apache.Ignite.Core.Impl.Binary.BinaryWriter;
@@ -1128,16 +1127,6 @@ namespace Apache.Ignite.Core
 public IEncryptionSpi EncryptionSpi { get; set; }
 
 /// 
-/// Gets or sets the MetricExporterSpi.
-/// 
-public IMetricExporterSpi MetricExporterSpi { get; set; }
-
-/// 
-/// Gets or sets the TracingSpi.
-/// 
-public ITracingSpi TracingSpi { get; set; }
-
-/// 
 /// Gets or sets a value indicating whether node should start in 
client mode.
 /// Client node cannot hold data in the caches.
 /// 
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd 
b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
index a611b3c..0ab59ec 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd
@@ -973,11 +973,6 @@
 
 
 
-
-
-Metrics exporter spi. Null for NoOp 
implementation.
-
-
 
 
 Discovery service provider. Null for 
default discovery.



[ignite] branch master updated: IGNITE-10504 If client have cache resource with not configurate data region it stop by handler - Fixes #7757.

2020-05-20 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 2a28242  IGNITE-10504 If client have cache resource with not 
configurate data region it stop by handler - Fixes #7757.
2a28242 is described below

commit 2a282429154676c3d9b9625186a77574ce368796
Author: Kirill Tkalenko 
AuthorDate: Wed May 20 23:26:06 2020 +0300

IGNITE-10504 If client have cache resource with not configurate data region 
it stop by handler - Fixes #7757.

Signed-off-by: Ivan Rakov 
---
 .../cache/CacheDataRegionConfigurationTest.java| 128 -
 1 file changed, 101 insertions(+), 27 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
index 2754390..7b8fdec 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
@@ -17,7 +17,8 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import java.util.concurrent.Callable;
+import java.util.UUID;
+import javax.cache.CacheException;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
@@ -29,18 +30,22 @@ import org.apache.ignite.configuration.DataPageEvictionMode;
 import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.failure.FailureHandler;
+import org.apache.ignite.failure.StopNodeOrHaltFailureHandler;
 import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.ListeningTestLogger;
 import org.apache.ignite.testframework.LogListener;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.jetbrains.annotations.Nullable;
 import org.junit.Test;
 
+import static java.util.Objects.nonNull;
 import static 
org.apache.ignite.configuration.DataStorageConfiguration.DFLT_PAGE_SIZE;
+import static org.apache.ignite.testframework.GridTestUtils.assertThrows;
+import static org.apache.ignite.testframework.LogListener.matches;
 
 /**
  *
@@ -52,6 +57,9 @@ public class CacheDataRegionConfigurationTest extends 
GridCommonAbstractTest {
 /** */
 private volatile DataStorageConfiguration memCfg;
 
+/** Failure handler. */
+@Nullable private FailureHandler failureHnd;
+
 /** */
 private IgniteLogger logger;
 
@@ -65,19 +73,22 @@ public class CacheDataRegionConfigurationTest extends 
GridCommonAbstractTest {
 @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
 IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-if (logger != null)
+if (nonNull(logger))
 cfg.setGridLogger(logger);
 
+if (nonNull(failureHnd))
+cfg.setFailureHandler(failureHnd);
+
 if (gridName.contains("client")) {
 cfg.setClientMode(true);
 
 return cfg;
 }
 
-if (memCfg != null)
+if (nonNull(memCfg))
 cfg.setDataStorageConfiguration(memCfg);
 
-if (ccfg != null)
+if (nonNull(ccfg))
 cfg.setCacheConfiguration(ccfg);
 
 return cfg;
@@ -85,12 +96,17 @@ public class CacheDataRegionConfigurationTest extends 
GridCommonAbstractTest {
 
 /** {@inheritDoc} */
 @Override protected void afterTest() throws Exception {
+super.afterTest();
+
 stopAllGrids();
 
 cleanPersistenceDir();
 }
 
+/** {@inheritDoc} */
 @Override protected void beforeTest() throws Exception {
+super.beforeTest();
+
 stopAllGrids();
 
 cleanPersistenceDir();
@@ -98,11 +114,10 @@ public class CacheDataRegionConfigurationTest extends 
GridCommonAbstractTest {
 
 /** */
 private void checkStartGridException(Class ex, String 
message) {
-GridTestUtils.assertThrows(log(), new Callable() {
-@Nullable @Override public Object call() throws Exception {
-startGrid(0);
-return null;
-}
+assertThrows(log(), () -> {
+startGrid(0);
+
+return null;
 }, ex, message);
 }
 
@@ -284,9 +299,9 @@ public class CacheDataRegionConfiguratio

[ignite-teamcity-bot] branch master updated: Revert "Highlight newly added tests in TC bot visa (#158)"

2020-05-08 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new 173e4b7  Revert "Highlight newly added tests in TC bot visa (#158)"
173e4b7 is described below

commit 173e4b77bef813b2a4fe6e3d4f20fcdb7b2a9ca9
Author: Ivan Rakov 
AuthorDate: Fri May 8 19:56:12 2020 +0300

Revert "Highlight newly added tests in TC bot visa (#158)"
---
 .../apache/ignite/ci/tcbot/TcBotWebAppModule.java  |   3 -
 .../tcbot/visa/TcBotTriggerAndSignOffService.java  |  84 +---
 .../src/main/webapp/js/testfails-2.2.js|  49 +
 .../ci/tcbot/chain/MockBasedTcBotModule.java   |   3 -
 .../tcbot/engine/chain/TestCompactedMult.java  |  10 +-
 .../ignite/tcbot/engine/pr/PrChainsProcessor.java  | 109 +
 .../apache/ignite/tcbot/engine/ui/DsChainUi.java   |  43 
 .../tcbot/engine/ui/ShortSuiteNewTestsUi.java  |  46 -
 .../apache/ignite/tcbot/engine/ui/ShortTestUi.java |  68 -
 .../org/apache/ignite/tcservice/ITeamcityConn.java |   7 --
 .../tcservice/TeamcityServiceConnection.java   |  10 --
 11 files changed, 8 insertions(+), 424 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
index 969e6b6..c4affe0 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
@@ -44,8 +44,6 @@ import 
org.apache.ignite.tcbot.notify.TcBotNotificationsModule;
 import org.apache.ignite.tcbot.persistence.TcBotPersistenceModule;
 import org.apache.ignite.tcbot.persistence.scheduler.SchedulerModule;
 import org.apache.ignite.tcignited.TeamcityIgnitedModule;
-import org.apache.ignite.tcservice.ITeamcityConn;
-import org.apache.ignite.tcservice.TeamcityServiceConnection;
 
 /**
  *
@@ -72,7 +70,6 @@ public class TcBotWebAppModule extends AbstractModule {
 }
 });
 
-bind(ITeamcityConn.class).toInstance(new TeamcityServiceConnection());
 bind(TcUpdatePool.class).in(new SingletonScope());
 bind(IssueDetector.class).in(new SingletonScope());
 bind(ObserverTask.class).in(new SingletonScope());
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 8acb1e1..c97fd66 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -69,9 +69,7 @@ import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
 import org.apache.ignite.tcbot.engine.pr.BranchTicketMatcher;
 import org.apache.ignite.tcbot.engine.pr.PrChainsProcessor;
 import org.apache.ignite.tcbot.engine.ui.ShortSuiteUi;
-import org.apache.ignite.tcbot.engine.ui.ShortSuiteNewTestsUi;
 import org.apache.ignite.tcbot.engine.ui.ShortTestFailureUi;
-import org.apache.ignite.tcbot.engine.ui.ShortTestUi;
 import org.apache.ignite.tcbot.persistence.IStringCompactor;
 import org.apache.ignite.tcignited.ITeamcityIgnited;
 import org.apache.ignite.tcignited.ITeamcityIgnitedProvider;
@@ -830,17 +828,13 @@ public class TcBotTriggerAndSignOffService {
 SyncMode.RELOAD_QUEUED,
 baseBranch);
 
-List newTestsStatuses = 
prChainsProcessor.getNewTestsSuitesStatuses(buildTypeId, build.branchName, 
srvCodeOrAlias, prov,
-SyncMode.RELOAD_QUEUED,
-baseBranch);
-
 if (suitesStatuses == null)
 return new Visa("JIRA wasn't commented - no finished builds to 
analyze." +
 " Check builds availabiliy for branch: " + 
build.branchName + "/" + baseBranch);
 
 blockers = 
suitesStatuses.stream().mapToInt(ShortSuiteUi::totalBlockers).sum();
 
-String comment = generateJiraComment(suitesStatuses, 
newTestsStatuses, build.webUrl, buildTypeId, tcIgnited, blockers, 
build.branchName, baseBranch);
+String comment = generateJiraComment(suitesStatuses, build.webUrl, 
buildTypeId, tcIgnited, blockers, build.branchName, baseBranch);
 
 
 res = objMapper.readValue(jira.postJiraComment(ticket, comment), 
JiraCommentResponse.class);
@@ -867,7 +861,7 @@ public class TcBotTriggerAndSignOffService {
  * @param baseBranch TC Base branch used for comment
  * @return Comment, which should be sent to the JIRA ticket.
  */
-private String generateJiraComment(List suites, 
List n

[ignite] branch master updated: IGNITE-12942 control.sh add command for checking that inline size is same on all cluster nodes - Fixes #7728.

2020-05-07 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 8065fd9  IGNITE-12942 control.sh add command for checking that inline 
size is same on all cluster nodes - Fixes #7728.
8065fd9 is described below

commit 8065fd9bc71c1a351d68ad45a18ae7768bb4bd7a
Author: Sergey Antonov 
AuthorDate: Thu May 7 21:24:08 2020 +0300

IGNITE-12942 control.sh add command for checking that inline size is same 
on all cluster nodes - Fixes #7728.

Signed-off-by: Ivan Rakov 
---
 .../ClientTcpUnreachableMultiNodeSelfTest.java |   8 +
 .../ignite/internal/client/GridClientNode.java |  17 ++
 .../client/impl/GridClientComputeImpl.java |  16 +-
 .../internal/client/impl/GridClientNodeImpl.java   |  14 ++
 .../internal/commandline/BaselineCommand.java  |   5 +-
 .../commandline/cache/CacheCommandList.java|   5 +
 .../internal/commandline/cache/CacheCommands.java  |   1 +
 .../commandline/cache/CacheSubcommands.java|   7 +-
 .../commandline/cache/CheckIndexInlineSizes.java   | 152 +
 .../CheckIndexInlineSizesResult.java   |  96 
 .../CheckIndexInlineSizesTask.java |  99 +
 .../processors/query/GridQueryIndexing.java|  12 +
 .../processors/query/GridQueryProcessor.java   | 180 ---
 .../main/resources/META-INF/classnames.properties  |   3 +
 .../internal/client/thin/ComputeTaskTest.java  |  12 +-
 .../testframework/junits/GridAbstractTest.java |   2 +-
 .../junits/multijvm/IgniteProcessProxy.java|   3 +-
 ...mandHandlerClusterByClassTest_cache_help.output |   3 +
 ...dlerClusterByClassWithSSLTest_cache_help.output |   3 +
 .../processors/query/h2/IgniteH2Indexing.java  |  17 ++
 ...eckIndexesInlineSizeOnNodeJoinMultiJvmTest.java | 245 +
 .../IgniteBinaryCacheQueryTestSuite.java   |   2 +
 ...teCacheWithIndexingAndPersistenceTestSuite.java |   2 +
 ...idCommandHandlerCheckIndexesInlineSizeTest.java | 153 +
 ...idCommandHandlerIndexingClusterByClassTest.java |  16 ++
 25 files changed, 1018 insertions(+), 55 deletions(-)

diff --git 
a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
 
b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
index 362b978..25bab63 100644
--- 
a/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
+++ 
b/modules/clients/src/test/java/org/apache/ignite/internal/client/integration/ClientTcpUnreachableMultiNodeSelfTest.java
@@ -124,6 +124,14 @@ public class ClientTcpUnreachableMultiNodeSelfTest extends 
ClientTcpMultiNodeSel
 @Override public long order() {
 return node.order();
 }
+
+@Override public boolean isClient() {
+return node.isClient();
+}
+
+@Override public boolean isDaemon() {
+return node.isDaemon();
+}
 };
 }
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
index 1df1c21..4cdf9ad 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientNode.java
@@ -22,6 +22,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
+import org.apache.ignite.configuration.IgniteConfiguration;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -126,4 +127,20 @@ public interface GridClientNode {
  * @return Node startup order.
  */
 public long order();
+
+/**
+ * Whether this node is client (see {@link 
IgniteConfiguration#isClientMode()}).
+ *
+ * @return {@code True if client}.
+ * @see IgniteConfiguration#isClientMode()
+ */
+public boolean isClient();
+
+/**
+ * Tests whether or not this node is a daemon (see {@link 
IgniteConfiguration#isDaemon()}).
+ *
+ * @return {@code True} if this node is a daemon, {@code false} otherwise.
+ * @see IgniteConfiguration#isDaemon()
+ */
+public boolean isDaemon();
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
index cabce32..fd79ea9 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl

[ignite-teamcity-bot] branch master updated: Show tests on TC board that were stable and have become flaky (#159)

2020-04-27 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new 12a535e  Show tests on TC board that were stable and have become flaky 
(#159)
12a535e is described below

commit 12a535e1477c1cbeae8b8153e98b5227a9043eb8
Author: sergeyuttsel 
AuthorDate: Mon Apr 27 20:34:15 2020 +0300

Show tests on TC board that were stable and have become flaky (#159)

Signed-off-by: Ivan Rakov 
---
 .../ci/tcbot/conf/LocalFilesBasedConfig.java   | 14 ++
 .../ignite/ci/tcbot/issue/IssueDetector.java   | 54 +++---
 .../ci/tcbot/chain/MockBasedTcBotModule.java   |  8 
 .../ignite/ci/tcbot/issue/IssueDetectorTest.java   |  4 +-
 .../java/org/apache/ignite/ci/issue/Issue.java |  2 +
 .../ignite/tcbot/engine/board/BoardService.java| 50 ++--
 .../ignite/tcbot/engine/conf/ITcBotConfig.java | 12 +
 .../ignite/tcbot/engine/conf/TcBotJsonConfig.java  | 20 
 .../tcbot/engine/defect/DefectFirstBuild.java  |  4 +-
 .../ignite/tcbot/engine/defect/DefectIssue.java|  9 +++-
 .../ignite/tcbot/engine/issue/EventTemplates.java  | 12 +++--
 .../ignite/tcbot/engine/issue/IssueType.java   |  5 +-
 .../ignited/fatbuild/FatBuildCompacted.java|  4 ++
 .../ignite/tcignited/history/IRunHistory.java  | 10 ++--
 14 files changed, 182 insertions(+), 26 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
index b80d67b..6be47bc 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
@@ -114,6 +114,20 @@ public class LocalFilesBasedConfig implements ITcBotConfig 
{
 return Strings.isNullOrEmpty(srvCode) ? 
ITcBotConfig.DEFAULT_SERVER_CODE : srvCode;
 }
 
+/** {@inheritDoc} */
+@Override public Integer flakyRate() {
+Integer flakyRate = getConfig().flakyRate();
+
+return flakyRate == null || flakyRate < 0 || flakyRate > 100 ? 
ITcBotConfig.DEFAULT_FLAKY_RATE : flakyRate;
+}
+
+/** {@inheritDoc} */
+@Override public Double confidence() {
+Double confidence = getConfig().confidence();
+
+return confidence == null || confidence < 0 || confidence > 1 ? 
ITcBotConfig.DEFAULT_CONFIDENCE : confidence;
+}
+
 @Override
 public ITrackedBranchesConfig getTrackedBranches() {
 return getConfig();
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
index e96a0be..fe1ef2b 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
@@ -30,11 +30,13 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
 import javax.annotation.Nonnull;
 import javax.inject.Inject;
 import javax.inject.Provider;
 import org.apache.ignite.ci.issue.Issue;
 import org.apache.ignite.ci.issue.IssueKey;
+import org.apache.ignite.ci.teamcity.ignited.runhist.Invocation;
 import org.apache.ignite.tcbot.engine.issue.IIssuesStorage;
 import org.apache.ignite.tcbot.engine.issue.IssueType;
 import org.apache.ignite.ci.jobs.CheckQueueJob;
@@ -64,11 +66,14 @@ import org.apache.ignite.tcignited.ITeamcityIgnited;
 import org.apache.ignite.tcignited.ITeamcityIgnitedProvider;
 import org.apache.ignite.tcignited.SyncMode;
 import org.apache.ignite.tcignited.history.IRunHistory;
+import org.apache.ignite.tcignited.history.InvocationData;
 import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static 
org.apache.ignite.tcignited.buildref.BranchEquivalence.normalizeBranch;
+import static org.apache.ignite.tcignited.history.RunStatus.RES_FAILURE;
+import static org.apache.ignite.tcignited.history.RunStatus.RES_OK;
 
 /**
  *
@@ -471,15 +476,49 @@ public class IssueDetector {
 type = IssueType.newFailure;
 final String flakyComments = runStat.getFlakyComments();
 
-if (!Strings.isNullOrEmpty(flakyComments)) {
-if 
(runStat.detectTemplate(EventTemplates.newFailureForFlakyTest) == null) {
-logger.info("Skipping registering new issue for test 
fail:" +
-" Test

[ignite-teamcity-bot] branch master updated: Highlight newly added tests in TC bot visa (#158)

2020-04-27 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
 new 81c9280  Highlight newly added tests in TC bot visa (#158)
81c9280 is described below

commit 81c92809ff905e58ab3d05a4ae6a6fbba4fcd9a5
Author: sergeyuttsel 
AuthorDate: Mon Apr 27 20:22:22 2020 +0300

Highlight newly added tests in TC bot visa (#158)

Signed-off-by: Ivan Rakov 
---
 build.gradle   |   2 +-
 .../apache/ignite/ci/tcbot/TcBotWebAppModule.java  |   3 +
 .../tcbot/visa/TcBotTriggerAndSignOffService.java  |  84 +++-
 .../src/main/webapp/js/testfails-2.2.js|  49 -
 .../ci/tcbot/chain/MockBasedTcBotModule.java   |   3 +
 .../tcbot/engine/chain/TestCompactedMult.java  |  10 +-
 .../ignite/tcbot/engine/pr/PrChainsProcessor.java  | 109 -
 .../apache/ignite/tcbot/engine/ui/DsChainUi.java   |  43 
 .../tcbot/engine/ui/ShortSuiteNewTestsUi.java  |  46 +
 .../apache/ignite/tcbot/engine/ui/ShortTestUi.java |  68 +
 .../org/apache/ignite/tcservice/ITeamcityConn.java |   7 ++
 .../tcservice/TeamcityServiceConnection.java   |  10 ++
 12 files changed, 425 insertions(+), 9 deletions(-)

diff --git a/build.gradle b/build.gradle
index 7c1c4b7..2c8ce94 100644
--- a/build.gradle
+++ b/build.gradle
@@ -47,7 +47,7 @@ allprojects {
 jettyVer = '9.4.12.v20180830'
 
 // ignVer = '2.7.0'
-ignVer = '2.7.6'
+ignVer = '2.8.0'
 //  ignVer = '2.7.0-SNAPSHOT'
 
 guavaVer = '26.0-jre'
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
index c4affe0..969e6b6 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/TcBotWebAppModule.java
@@ -44,6 +44,8 @@ import 
org.apache.ignite.tcbot.notify.TcBotNotificationsModule;
 import org.apache.ignite.tcbot.persistence.TcBotPersistenceModule;
 import org.apache.ignite.tcbot.persistence.scheduler.SchedulerModule;
 import org.apache.ignite.tcignited.TeamcityIgnitedModule;
+import org.apache.ignite.tcservice.ITeamcityConn;
+import org.apache.ignite.tcservice.TeamcityServiceConnection;
 
 /**
  *
@@ -70,6 +72,7 @@ public class TcBotWebAppModule extends AbstractModule {
 }
 });
 
+bind(ITeamcityConn.class).toInstance(new TeamcityServiceConnection());
 bind(TcUpdatePool.class).in(new SingletonScope());
 bind(IssueDetector.class).in(new SingletonScope());
 bind(ObserverTask.class).in(new SingletonScope());
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index c97fd66..8acb1e1 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -69,7 +69,9 @@ import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
 import org.apache.ignite.tcbot.engine.pr.BranchTicketMatcher;
 import org.apache.ignite.tcbot.engine.pr.PrChainsProcessor;
 import org.apache.ignite.tcbot.engine.ui.ShortSuiteUi;
+import org.apache.ignite.tcbot.engine.ui.ShortSuiteNewTestsUi;
 import org.apache.ignite.tcbot.engine.ui.ShortTestFailureUi;
+import org.apache.ignite.tcbot.engine.ui.ShortTestUi;
 import org.apache.ignite.tcbot.persistence.IStringCompactor;
 import org.apache.ignite.tcignited.ITeamcityIgnited;
 import org.apache.ignite.tcignited.ITeamcityIgnitedProvider;
@@ -828,13 +830,17 @@ public class TcBotTriggerAndSignOffService {
 SyncMode.RELOAD_QUEUED,
 baseBranch);
 
+List newTestsStatuses = 
prChainsProcessor.getNewTestsSuitesStatuses(buildTypeId, build.branchName, 
srvCodeOrAlias, prov,
+SyncMode.RELOAD_QUEUED,
+baseBranch);
+
 if (suitesStatuses == null)
 return new Visa("JIRA wasn't commented - no finished builds to 
analyze." +
 " Check builds availabiliy for branch: " + 
build.branchName + "/" + baseBranch);
 
 blockers = 
suitesStatuses.stream().mapToInt(ShortSuiteUi::totalBlockers).sum();
 
-String comment = generateJiraComment(suitesStatuses, build.webUrl, 
buildTypeId, tcIgnited, blockers, build.branchName, baseBranch);
+String comment = generateJiraComment(suitesStatuses, 
newTestsStatuses, build.webUrl, buildTypeId, tcIgnited, blockers,

[ignite] branch master updated: IGNITE-12906 Add to IgniteWalConverter possibility output only hashes instead real data - Fixes #7678.

2020-04-22 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new e7e34f0  IGNITE-12906 Add to IgniteWalConverter possibility output 
only hashes instead real data - Fixes #7678.
e7e34f0 is described below

commit e7e34f0c3bcf080bc3d0da9b3e72ee72af9d0a32
Author: Kirill Tkalenko 
AuthorDate: Wed Apr 22 18:28:14 2020 +0300

IGNITE-12906 Add to IgniteWalConverter possibility output only hashes 
instead real data - Fixes #7678.

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/IgniteSystemProperties.java  |   7 +-
 .../pagemem/wal/record/MetastoreDataRecord.java|   2 +
 .../pagemem/wal/record/UnwrapDataEntry.java|  14 +-
 .../pagemem/wal/record/UnwrapMvccDataEntry.java|  14 +-
 .../wal/record/WALRecordSerializationTest.java |   8 +-
 .../testframework/wal/record/RecordUtils.java  |  10 +
 modules/dev-utils/pom.xml  |  28 ++
 .../ignite/development/utils/DataEntryWrapper.java |  89 +
 .../development/utils/IgniteWalConverter.java  |  65 +++-
 .../utils/MetastoreDataRecordWrapper.java  |  53 +++
 .../development/utils/ProcessSensitiveData.java|  32 ++
 .../utils/ProcessSensitiveDataUtils.java   |  56 +++
 .../development/utils/DevUtilsTestSuite.java   |  31 ++
 .../utils/IgniteWalConverterSensitiveDataTest.java | 383 +
 14 files changed, 772 insertions(+), 20 deletions(-)

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 bcec9ed..66c3811 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -1347,7 +1347,12 @@ public final class IgniteSystemProperties {
 if (val == null)
 return dflt;
 
-return Enum.valueOf(enumCls, val);
+try {
+return Enum.valueOf(enumCls, val);
+}
+catch (IllegalArgumentException ignore) {
+return dflt;
+}
 }
 
 /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/MetastoreDataRecord.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/MetastoreDataRecord.java
index 9e73424..5cff9ba 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/MetastoreDataRecord.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/MetastoreDataRecord.java
@@ -19,6 +19,7 @@
 package org.apache.ignite.internal.pagemem.wal.record;
 
 import 
org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage;
+import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.jetbrains.annotations.Nullable;
 
@@ -27,6 +28,7 @@ import org.jetbrains.annotations.Nullable;
  */
 public class MetastoreDataRecord extends WALRecord implements 
WalRecordCacheGroupAware {
 /** */
+@GridToStringInclude(sensitive = true)
 private final String key;
 
 /** */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/UnwrapDataEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/UnwrapDataEntry.java
index 5dd268b..ad5e1d0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/UnwrapDataEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/UnwrapDataEntry.java
@@ -23,6 +23,8 @@ import 
org.apache.ignite.internal.processors.cache.CacheObjectValueContext;
 import org.apache.ignite.internal.processors.cache.GridCacheOperation;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.SB;
 
 /**
  * Data Entry for automatic unwrapping key and value from Data Entry
@@ -108,9 +110,13 @@ public class UnwrapDataEntry extends DataEntry implements 
UnwrappedDataEntry {
 
 /** {@inheritDoc} */
 @Override public String toString() {
-return getClass().getSimpleName() + "[k = " + unwrappedKey() + ", v = 
[ "
-+ unwrappedValue()
-+ "], super = ["
-+ super.toString() + "]]";
+SB sb = new SB();
+
+sb.a(getClass().getSimpleName()).a('[');
+
+if (S.includeSensitive())
+sb.a("k = ").a(unwrappedKey()).a(", v = [ 
").a(unwrappedValue()).a("], ");
+
+return sb.a("super = [").a(super.toString()).a("

[ignite] branch master updated: IGNITE-12759 Getting a SecurityContext from GridSecurityProcessor - Fixes #7523.

2020-04-17 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 4e6cd2c  IGNITE-12759 Getting a SecurityContext from 
GridSecurityProcessor - Fixes #7523.
4e6cd2c is described below

commit 4e6cd2ce04e3c2c28e1578ed53076d176403e4ff
Author: Garus Denis 
AuthorDate: Fri Apr 17 16:27:07 2020 +0300

IGNITE-12759 Getting a SecurityContext from GridSecurityProcessor - Fixes 
#7523.

Signed-off-by: Ivan Rakov 
---
 .../processors/security/GridSecurityProcessor.java | 24 -
 .../security/IgniteSecurityProcessor.java  | 42 +++---
 .../processors/security/SecurityContext.java   |  2 +-
 .../client/ThinClientPermissionCheckTest.java  | 13 ---
 .../ThinClientSecurityContextOnRemoteNodeTest.java | 42 ++
 .../security/impl/TestSecurityProcessor.java   | 14 +++-
 .../ignite/testsuites/SecurityTestSuite.java   |  2 ++
 7 files changed, 110 insertions(+), 29 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java
index a80444b..e1dff22 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java
@@ -30,7 +30,19 @@ import org.apache.ignite.plugin.security.SecurityPermission;
 import org.apache.ignite.plugin.security.SecuritySubject;
 
 /**
- * This interface defines a grid authentication processor.
+ * This interface is responsible for:
+ * 
+ * Node authentication;
+ * Thin client authentication;
+ * Providing configuration info whether global node authentication is 
enabled;
+ * Keeping and propagating all authenticated security subjects;
+ * Providing configuration info whether security mode is enabled at 
all;
+ * Handling expired sessions;
+ * Providing configuration info whether sandbox is enabled;
+ * Keeping and propagating authenticated security subject for thin 
clients;
+ * Keeping and propagating authenticated security contexts for nodes 
and thin clients;
+ * Authorizing specific operations (cache put, task execute, so on) 
when session security context is set.
+ * 
  */
 public interface GridSecurityProcessor extends GridProcessor {
 /**
@@ -77,6 +89,16 @@ public interface GridSecurityProcessor extends GridProcessor 
{
 public SecuritySubject authenticatedSubject(UUID subjId) throws 
IgniteCheckedException;
 
 /**
+ * Gets security context for authenticated nodes and thin clients.
+ *
+ * @param subjId Security subject id.
+ * @return Security context or null if not found.
+ */
+public default SecurityContext securityContext(UUID subjId) {
+throw new UnsupportedOperationException();
+}
+
+/**
  * Authorizes grid operation.
  *
  * @param name Cache name or task class name.
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
index c6cd587..060c5d1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
@@ -54,7 +54,17 @@ import static 
org.apache.ignite.internal.processors.security.SecurityUtils.hasSe
 import static 
org.apache.ignite.internal.processors.security.SecurityUtils.nodeSecurityContext;
 
 /**
- * Default IgniteSecurity implementation.
+ * Default {@code IgniteSecurity} implementation.
+ * 
+ * {@code IgniteSecurityProcessor} serves here as a facade with is exposed to 
Ignite internal code,
+ * while {@code GridSecurityProcessor} is hidden and managed from {@code 
IgniteSecurityProcessor}.
+ * 
+ * This implementation of {@code IgniteSecurity} is responsible for:
+ * 
+ * Keeping and propagating authenticated security contexts for cluster 
nodes;
+ * Delegating calls for all actions to {@code 
GridSecurityProcessor};
+ * Managing sandbox and proving point of entry to the internal sandbox 
API.
+ * 
  */
 public class IgniteSecurityProcessor implements IgniteSecurity, GridProcessor {
 /** Internal attribute name constant. */
@@ -107,30 +117,18 @@ public class IgniteSecurityProcessor implements 
IgniteSecurity, GridProcessor {
 }
 
 /** {@inheritDoc} */
-@Override public OperationSecurityContext withContext(UUID nodeId) {
-return withContext(
-secCtxs.computeIfAbsent(nodeId,
-uuid

[ignite] branch master updated: IGNITE-12797 Add command line option to CommandHandler to be able to see full stack trace and cause exception in log in case of error. - Fixes #7544.

2020-04-03 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new ae95eef  IGNITE-12797 Add command line option to CommandHandler to be 
able to see full stack trace and cause exception in log in case of error. - 
Fixes #7544.
ae95eef is described below

commit ae95eefd0bb2f8992dcc28a48bbecc4a8fc11a69
Author: Kirill Tkalenko 
AuthorDate: Fri Apr 3 19:25:05 2020 +0300

IGNITE-12797 Add command line option to CommandHandler to be able to see 
full stack trace and cause exception in log in case of error. - Fixes #7544.

Signed-off-by: Ivan Rakov 
---
 .../internal/commandline/CommandHandler.java   |  37 ++--
 .../internal/commandline/CommonArgParser.java  |  13 ++-
 .../commandline/ConnectionAndSslParameters.java|  16 +++-
 .../commandline/CommandHandlerParsingTest.java |  59 +++-
 .../util/GridCommandHandlerClusterByClassTest.java | 100 -
 ...mandHandlerClusterByClassTest_cache_help.output |   2 +-
 ...ridCommandHandlerClusterByClassTest_help.output |   2 +-
 ...dlerClusterByClassWithSSLTest_cache_help.output |   2 +-
 ...andHandlerClusterByClassWithSSLTest_help.output |   2 +-
 9 files changed, 199 insertions(+), 34 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
index dab5d53..40e9233 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
@@ -55,12 +55,15 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import static java.lang.System.lineSeparator;
+import static java.util.Objects.nonNull;
 import static org.apache.ignite.internal.IgniteVersionUtils.ACK_VER_STR;
 import static org.apache.ignite.internal.IgniteVersionUtils.COPYRIGHT;
 import static 
org.apache.ignite.internal.commandline.CommandLogger.DOUBLE_INDENT;
 import static org.apache.ignite.internal.commandline.CommandLogger.INDENT;
+import static 
org.apache.ignite.internal.commandline.CommandLogger.errorMessage;
 import static org.apache.ignite.internal.commandline.CommandLogger.optional;
 import static 
org.apache.ignite.internal.commandline.CommonArgParser.CMD_AUTO_CONFIRMATION;
+import static 
org.apache.ignite.internal.commandline.CommonArgParser.CMD_VERBOSE;
 import static 
org.apache.ignite.internal.commandline.CommonArgParser.getCommonOptions;
 import static org.apache.ignite.internal.commandline.TaskExecutor.DFLT_HOST;
 import static org.apache.ignite.internal.commandline.TaskExecutor.DFLT_PORT;
@@ -218,6 +221,9 @@ public class CommandHandler {
 
 String commandName = "";
 
+Throwable err = null;
+boolean verbose = false;
+
 try {
 if (F.isEmpty(rawArgs) || (rawArgs.size() == 1 && 
CMD_HELP.equalsIgnoreCase(rawArgs.get(0 {
 printHelp();
@@ -225,6 +231,8 @@ public class CommandHandler {
 return EXIT_CODE_OK;
 }
 
+verbose = F.exist(rawArgs, CMD_VERBOSE::equalsIgnoreCase);
+
 ConnectionAndSslParameters args = new 
CommonArgParser(logger).parseAndValidate(rawArgs.iterator());
 
 Command command = args.command();
@@ -292,18 +300,22 @@ public class CommandHandler {
 return EXIT_CODE_OK;
 }
 catch (IllegalArgumentException e) {
-logger.severe("Check arguments. " + CommandLogger.errorMessage(e));
-
+logger.severe("Check arguments. " + errorMessage(e));
 logger.info("Command [" + commandName + "] finished with code: " + 
EXIT_CODE_INVALID_ARGUMENTS);
 
+if (verbose)
+err = e;
+
 return EXIT_CODE_INVALID_ARGUMENTS;
 }
 catch (Throwable e) {
 if (isAuthError(e)) {
-logger.severe("Authentication error. " + 
CommandLogger.errorMessage(e));
-
+logger.severe("Authentication error. " + errorMessage(e));
 logger.info("Command [" + commandName + "] finished with code: 
" + ERR_AUTHENTICATION_FAILED);
 
+if (verbose)
+err = e;
+
 return ERR_AUTHENTICATION_FAILED;
 }
 
@@ -317,27 +329,35 @@ public class CommandHandler {
 if (isSSLMisconfigurationError(cause))
 e = cause;
 
-logger.severe("Connection to cluster failed. " + 
CommandLogger.errorMessage(e));
+logger.severe("Connection to cluster failed. " + 
e

[ignite] branch master updated: IGNITE-12836 Writing methods to avoid limit of 65535 bytes for java.io.DataOutput#writeUTF - Fixes #7571.

2020-04-02 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 41da31e  IGNITE-12836 Writing methods to avoid limit of 65535 bytes 
for java.io.DataOutput#writeUTF - Fixes #7571.
41da31e is described below

commit 41da31e99c72d7c424ba94a31c0c675dc4b4c79d
Author: Kirill Tkalenko 
AuthorDate: Thu Apr 2 21:36:54 2020 +0300

IGNITE-12836 Writing methods to avoid limit of 65535 bytes for 
java.io.DataOutput#writeUTF - Fixes #7571.

Signed-off-by: Ivan Rakov 
---
 .../apache/ignite/internal/util/IgniteUtils.java   | 198 +
 .../ignite/internal/util/IgniteUtilsSelfTest.java  | 134 +-
 .../resources/org.apache.ignite.util/bigUtf.txt| Bin 0 -> 430138 bytes
 .../resources/org.apache.ignite.util/limitUtf.txt  |  10 ++
 4 files changed, 341 insertions(+), 1 deletion(-)

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 2c27ace..597751d 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
@@ -40,6 +40,7 @@ import java.io.PrintStream;
 import java.io.Reader;
 import java.io.Serializable;
 import java.io.StringWriter;
+import java.io.UTFDataFormatException;
 import java.io.Writer;
 import java.lang.annotation.Annotation;
 import java.lang.management.CompilationMXBean;
@@ -270,6 +271,7 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import sun.misc.Unsafe;
 
+import static java.util.Objects.isNull;
 import static 
org.apache.ignite.IgniteSystemProperties.IGNITE_DISABLE_HOSTNAME_VERIFIER;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_HOME;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_LOCAL_HOST;
@@ -304,6 +306,12 @@ public abstract class IgniteUtils {
 /** */
 public static final long GB = 1024L * 1024 * 1024;
 
+/**
+ * String limit in bytes for {@link DataOutput#writeUTF} and
+ * {@link DataInput#readUTF()}, that use "Modified UTF-8".
+ */
+public static final int UTF_BYTE_LIMIT = 65_535;
+
 /** Minimum checkpointing page buffer size (may be adjusted by Ignite). */
 public static final Long DFLT_MIN_CHECKPOINTING_PAGE_BUFFER_SIZE = GB / 4;
 
@@ -5711,6 +5719,29 @@ public abstract class IgniteUtils {
 
 /**
  * Writes string to output stream accounting for {@code null} values.
+ * 
+ * Limitation for max string lenght of {@link #UTF_BYTE_LIMIT} bytes is 
caused by {@link ObjectOutputStream#writeUTF}
+ * used under the hood to perform an actual write.
+ * 
+ * 
+ * If longer string is passes a {@link UTFDataFormatException} exception 
will be thrown.
+ * 
+ * 
+ * To write longer strings use one of two options:
+ * 
+ * 
+ * {@link #writeLongString(DataOutput, String)} writes string as 
is converting it into binary array of UTF-8
+ * encoded characters.
+ * To read the value back {@link #readLongString(DataInput)} 
should be used.
+ * 
+ * 
+ * {@link #writeCutString(DataOutput, String)} cuts passed string 
to {@link #UTF_BYTE_LIMIT} bytes
+ * and then writes them without converting to byte array.
+ * No exceptions will be thrown for string of any length; written 
string can be read back with regular
+ * {@link #readString(DataInput)} method.
+ * 
+ * 
+ * 
  *
  * @param out Output stream to write to.
  * @param s String to write, possibly {@code null}.
@@ -5727,6 +5758,13 @@ public abstract class IgniteUtils {
 /**
  * Reads string from input stream accounting for {@code null} values.
  *
+ * Method enables to read strings shorter than {@link #UTF_BYTE_LIMIT} 
bytes in UTF-8 otherwise an exception will be thrown.
+ *
+ * Strings written by {@link #writeString(DataOutput, String)} or {@link 
#writeCutString(DataOutput, String)}
+ * can be read by this method.
+ *
+ * @see #writeString(DataOutput, String) for more information about 
writing strings.
+ *
  * @param in Stream to read from.
  * @return Read string, possibly {@code null}.
  * @throws IOException If read failed.
@@ -11699,4 +11737,164 @@ public abstract class IgniteUtils {
 public static String unquote(String s) {
 return s == null ? null : s.replaceAll("^\"|\"$", "");
 }
+
+/**
+ * Writes string to output stream accounting for {@code null} values. 
+ *
+ * This method can write string of any length, no {@link #UTF_BYTE_LIMIT} 
limits are applied.
+ *
+ * @param ou

[ignite] branch master updated: IGNITE-12709 Server latch initialized after client latch in Zookeeper discovery - Fixes #7459.

2020-03-23 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 7aa5cfd  IGNITE-12709 Server latch initialized after client latch in 
Zookeeper discovery - Fixes #7459.
7aa5cfd is described below

commit 7aa5cfd76b604dbb15f9ad3dea69329c7ded63c4
Author: Anton Kalashnikov 
AuthorDate: Mon Mar 23 19:00:26 2020 +0300

IGNITE-12709 Server latch initialized after client latch in Zookeeper 
discovery - Fixes #7459.

Signed-off-by: Ivan Rakov 
---
 .../dht/preloader/latch/ExchangeLatchManager.java  | 13 +++-
 .../preloader/latch/ExchangeLatchManagerTest.java  | 75 ++
 .../CacheContinuousQueryLongP2PTest.java   |  6 +-
 .../continuous/GridEventConsumeSelfTest.java   | 91 ++
 .../testsuites/IgniteCacheMvccTestSuite6.java  |  2 +
 .../ignite/testsuites/IgniteCacheTestSuite6.java   |  2 +
 6 files changed, 132 insertions(+), 57 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
index 53b576a..663f940 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java
@@ -375,13 +375,22 @@ public class ExchangeLatchManager {
 lock.lock();
 
 try {
+CompletableLatchUid latchUid = new 
CompletableLatchUid(message.latchId(), message.topVer());
+
+if(discovery.topologyVersionEx().compareTo(message.topVer()) < 0) {
+// It means that this node doesn't receive changed topology 
version message yet
+// but received ack message from client latch.
+// It can happen when we don't have guarantees of received 
message order for example in ZookeeperSpi.
+pendingAcks.computeIfAbsent(latchUid, id -> new 
GridConcurrentHashSet<>()).add(from);
+
+return;
+}
+
 ClusterNode coordinator = getLatchCoordinator(message.topVer());
 
 if (coordinator == null)
 return;
 
-CompletableLatchUid latchUid = new 
CompletableLatchUid(message.latchId(), message.topVer());
-
 if (message.isFinal()) {
 if (log.isDebugEnabled())
 log.debug("Process final ack [latch=" + latchUid + ", 
from=" + from + "]");
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManagerTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManagerTest.java
new file mode 100644
index 000..c3394e2
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManagerTest.java
@@ -0,0 +1,75 @@
+/*
+ * 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.dht.preloader.latch;
+
+import java.util.concurrent.TimeUnit;
+import org.apache.ignite.internal.GridTopic;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.managers.communication.GridIoPolicy;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+/**
+ * Tests for {@link ExchangeLatchManager} functionality when latch coordinator 
is failed.
+ */
+public class ExchangeLatchManagerTest extends GridCommonAbstractTest {
+/** */
+private static final String LATCH_NAME = "test";
+
+/**
+ * @throws Exception If failed.
+ */
+@Test

[ignite] branch ignite-2.8.1 updated: IGNITE-12746 Regression in GridCacheColocatedDebugTest: putAll of sorted keys causes deadlock - Fixes #7507.

2020-03-13 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch ignite-2.8.1
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-2.8.1 by this push:
 new 8246bd8  IGNITE-12746 Regression in GridCacheColocatedDebugTest: 
putAll of sorted keys causes deadlock - Fixes #7507.
8246bd8 is described below

commit 8246bd8427a93c3a3706c4e24b46d1c8758579b1
Author: Ivan Rakov 
AuthorDate: Fri Mar 13 17:16:38 2020 +0300

IGNITE-12746 Regression in GridCacheColocatedDebugTest: putAll of sorted 
keys causes deadlock - Fixes #7507.

(cherry picked from commit dc547e21e1bd6a0b4e234b05751532feb8216a87)
---
 .../distributed/GridDistributedCacheEntry.java |   7 +-
 .../cache/local/GridLocalCacheEntry.java   |   8 +-
 .../cache/transactions/IgniteTxStateImpl.java  |   2 +-
 .../dht/GridCacheColocatedDebugTest.java   | 109 +
 4 files changed, 121 insertions(+), 5 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
index bb94058..3f0300f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
@@ -678,10 +678,13 @@ public class GridDistributedCacheEntry extends 
GridCacheMapEntry {
 unlockEntry();
 }
 
+boolean lockedByThreadChainVer = owner != null && 
owner.hasCandidate(ver);
+
+// If locked by the thread chain version no need to do recursive 
thread chain scans for the same chain.
 // This call must be made outside of synchronization.
-checkOwnerChanged(prev, owner, val, true);
+checkOwnerChanged(prev, owner, val, lockedByThreadChainVer);
 
-return owner == null || !owner.hasCandidate(ver); // Will return false 
if locked by thread chain version.
+return !lockedByThreadChainVer;
 }
 
 /** {@inheritDoc} */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
index cbcb4b8..dfe9d85 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
@@ -229,9 +229,13 @@ public class GridLocalCacheEntry extends GridCacheMapEntry 
{
 unlockEntry();
 }
 
-checkOwnerChanged(prev, owner, val, true);
+boolean lockedByThreadChainVer = owner != null && 
owner.hasCandidate(ver);
 
-return owner == null || !owner.hasCandidate(ver); // Will return false 
if locked by thread chain version.
+// If locked by the thread chain version no need to do recursive 
thread chain scans for the same chain.
+// This call must be made outside of synchronization.
+checkOwnerChanged(prev, owner, val, lockedByThreadChainVer);
+
+return !lockedByThreadChainVer;
 }
 
 /** {@inheritDoc} */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
index 40299ed..d9d2099 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
@@ -439,7 +439,7 @@ public class IgniteTxStateImpl extends 
IgniteTxLocalStateAdapter {
  * @return All entries. Returned collection is copy of internal collection.
  */
 public synchronized Collection allEntriesCopy() {
-return txMap == null ? Collections.emptySet() : new 
HashSet<>(txMap.values());
+return txMap == null ? Collections.emptySet() : new 
ArrayList<>(txMap.values());
 }
 
 /** {@inheritDoc} */
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
index f211587..9fa226d 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
@@ -24,6 +24,7 @@ import java.util.List;
 i

[ignite] branch master updated: IGNITE-12746 Regression in GridCacheColocatedDebugTest: putAll of sorted keys causes deadlock - Fixes #7507.

2020-03-13 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new dc547e2  IGNITE-12746 Regression in GridCacheColocatedDebugTest: 
putAll of sorted keys causes deadlock - Fixes #7507.
dc547e2 is described below

commit dc547e21e1bd6a0b4e234b05751532feb8216a87
Author: Ivan Rakov 
AuthorDate: Fri Mar 13 17:01:00 2020 +0300

IGNITE-12746 Regression in GridCacheColocatedDebugTest: putAll of sorted 
keys causes deadlock - Fixes #7507.
---
 .../distributed/GridDistributedCacheEntry.java |   7 +-
 .../cache/local/GridLocalCacheEntry.java   |   8 +-
 .../cache/transactions/IgniteTxStateImpl.java  |   2 +-
 .../dht/GridCacheColocatedDebugTest.java   | 109 +
 4 files changed, 121 insertions(+), 5 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
index bb94058..3f0300f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
@@ -678,10 +678,13 @@ public class GridDistributedCacheEntry extends 
GridCacheMapEntry {
 unlockEntry();
 }
 
+boolean lockedByThreadChainVer = owner != null && 
owner.hasCandidate(ver);
+
+// If locked by the thread chain version no need to do recursive 
thread chain scans for the same chain.
 // This call must be made outside of synchronization.
-checkOwnerChanged(prev, owner, val, true);
+checkOwnerChanged(prev, owner, val, lockedByThreadChainVer);
 
-return owner == null || !owner.hasCandidate(ver); // Will return false 
if locked by thread chain version.
+return !lockedByThreadChainVer;
 }
 
 /** {@inheritDoc} */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
index cbcb4b8..dfe9d85 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalCacheEntry.java
@@ -229,9 +229,13 @@ public class GridLocalCacheEntry extends GridCacheMapEntry 
{
 unlockEntry();
 }
 
-checkOwnerChanged(prev, owner, val, true);
+boolean lockedByThreadChainVer = owner != null && 
owner.hasCandidate(ver);
 
-return owner == null || !owner.hasCandidate(ver); // Will return false 
if locked by thread chain version.
+// If locked by the thread chain version no need to do recursive 
thread chain scans for the same chain.
+// This call must be made outside of synchronization.
+checkOwnerChanged(prev, owner, val, lockedByThreadChainVer);
+
+return !lockedByThreadChainVer;
 }
 
 /** {@inheritDoc} */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
index 40299ed..d9d2099 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
@@ -439,7 +439,7 @@ public class IgniteTxStateImpl extends 
IgniteTxLocalStateAdapter {
  * @return All entries. Returned collection is copy of internal collection.
  */
 public synchronized Collection allEntriesCopy() {
-return txMap == null ? Collections.emptySet() : new 
HashSet<>(txMap.values());
+return txMap == null ? Collections.emptySet() : new 
ArrayList<>(txMap.values());
 }
 
 /** {@inheritDoc} */
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
index f211587..9fa226d 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedDebugTest.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concur

[ignite] branch master updated: IGNITE-12627 Control utility does not show corrupted indexes - Fixes #7368.

2020-02-18 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 049266a  IGNITE-12627 Control utility does not show corrupted indexes 
- Fixes #7368.
049266a is described below

commit 049266a615c8f8d84425e394493a839926453ab9
Author: vmalin 
AuthorDate: Tue Feb 18 18:40:22 2020 +0300

IGNITE-12627 Control utility does not show corrupted indexes - Fixes #7368.

Signed-off-by: Ivan Rakov 
---
 .../visor/verify/ValidateIndexesClosure.java   |   2 +
 ...teCacheWithIndexingAndPersistenceTestSuite.java |   4 +-
 .../util/GridCommandHandlerBrokenIndexTest.java| 240 +
 3 files changed, 245 insertions(+), 1 deletion(-)

diff --git 
a/modules/indexing/src/main/java/org/apache/ignite/internal/visor/verify/ValidateIndexesClosure.java
 
b/modules/indexing/src/main/java/org/apache/ignite/internal/visor/verify/ValidateIndexesClosure.java
index c7fa349..8f1d53f 100644
--- 
a/modules/indexing/src/main/java/org/apache/ignite/internal/visor/verify/ValidateIndexesClosure.java
+++ 
b/modules/indexing/src/main/java/org/apache/ignite/internal/visor/verify/ValidateIndexesClosure.java
@@ -658,6 +658,8 @@ public class ValidateIndexesClosure implements 
IgniteCallablehttp://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.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.regex.Pattern;
+import org.apache.ignite.Ignite;
+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.GridCacheContext;
+import org.apache.ignite.internal.processors.query.GridQueryProcessor;
+import org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor;
+import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
+import org.apache.ignite.internal.processors.query.h2.database.H2TreeIndexBase;
+import org.apache.ignite.internal.processors.query.h2.opt.GridH2Table;
+import org.apache.ignite.internal.processors.query.h2.opt.H2CacheRow;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.spi.indexing.IndexingQueryCacheFilter;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.testframework.LogListener;
+import org.h2.engine.Session;
+import org.h2.index.Cursor;
+import org.h2.index.Index;
+import org.h2.result.SearchRow;
+import org.junit.Test;
+
+import static 
org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK;
+import static 
org.apache.ignite.util.GridCommandHandlerIndexingUtils.CACHE_NAME;
+import static 
org.apache.ignite.util.GridCommandHandlerIndexingUtils.GROUP_NAME;
+import static 
org.apache.ignite.util.GridCommandHandlerIndexingUtils.createAndFillCache;
+
+/**
+ * Tests failed start of iteration through index.
+ */
+public class GridCommandHandlerBrokenIndexTest extends 
GridCommandHandlerClusterPerMethodAbstractTest{
+/** */
+private static final String EXCEPTION_MSG = "Exception from BadIndex#find";
+
+/** */
+private static final String IDX_ISSUE_STR = "IndexValidationIssue 
\\[key=[0-9]*, cacheName=" + CACHE_NAME +
+", idxName=null], class java.lang.RuntimeException: " + EXCEPTION_MSG;
+
+/** */
+private List lsnrs = new ArrayList<>();
+
+/**
+ * Adds error message listeners to server nodes.
+ */
+@Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
+IgniteConfiguration cfg =  super.getConfiguration(igniteInstanceName);
+
+if (cfg.isClientMode())
+return cfg;
+
+ListeningTestLogger testLog = new ListeningTestLogger(false, log);
+
+Pattern logErrMsgPattern = Pattern.compile("Failed to lookup key: " + 
IDX_ISSUE_STR);
+
+LogListener lsnr = LogListener.matches(logErrMsgPattern).build();
+
+testLog.registerListener(lsnr);
+
+lsnrs.add(lsnr);
+
+cfg.setGridLogger(testLog);
+
+return cfg;
+}
+
+/**
+ * Tests Cursor initialisation failure by adding artificial index that 
will fail in required way.
+ *
+ * @see H2TreeIndexBase#find(Session, SearchRow, SearchRow)
+ */
+@Test
+public void testIndexFindFail() throws Exception {
+

[ignite] branch master updated: IGNITE-12628 Add tests for jmx metrics return types - Fixes #7369.

2020-02-18 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new d45458b  IGNITE-12628 Add tests for jmx metrics return types - Fixes 
#7369.
d45458b is described below

commit d45458b51a7ef7fa6fc211d4127877ab17e9a8a1
Author: vmalin 
AuthorDate: Tue Feb 18 18:33:37 2020 +0300

IGNITE-12628 Add tests for jmx metrics return types - Fixes #7369.

Signed-off-by: Ivan Rakov 
---
 .../ignite/internal/GridJobStealingSelfTest.java   |  14 +++
 .../org/apache/ignite/internal/GridMBeansTest.java |  34 -
 .../apache/ignite/internal/GridMbeansMiscTest.java | 117 ++
 .../checkpoint/GridCheckpointTaskSelfTest.java |   8 ++
 .../cache/eviction/EvictionAbstractTest.java   |  18 +++
 .../junits/common/GridCommonAbstractTest.java  | 137 +
 .../ignite/testsuites/IgniteBasicTestSuite.java|   2 +
 .../zk/internal/ZookeeperDiscoveryMiscTest.java|  15 +++
 8 files changed, 343 insertions(+), 2 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
index 1d01282..26dcfa6 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
@@ -51,6 +51,7 @@ import 
org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.testframework.junits.common.GridCommonTest;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -301,6 +302,19 @@ public class GridJobStealingSelfTest extends 
GridCommonAbstractTest {
 ret.get(ignite3.cluster().localNode().id());
 }
 
+/**
+ * @throws Exception If fatiled.
+ */
+@Ignore("https://issues.apache.org/jira/browse/IGNITE-12629;)
+@Test
+public void testJobStealingMbeanValidity() throws Exception {
+String[] beansToValidate = new String[] {
+
"org.apache.ignite.spi.collision.jobstealing.JobStealingCollisionSpi$JobStealingCollisionSpiMBeanImpl",
+
"org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi$JobStealingFailoverSpiMBeanImpl"};
+
+validateMbeans(ignite1, beansToValidate);
+}
+
 /** {@inheritDoc} */
 @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
 IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/GridMBeansTest.java 
b/modules/core/src/test/java/org/apache/ignite/internal/GridMBeansTest.java
index db82643..5e3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridMBeansTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridMBeansTest.java
@@ -17,12 +17,12 @@
 
 package org.apache.ignite.internal;
 
+import javax.management.ObjectName;
 import org.apache.ignite.configuration.ExecutorConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import javax.management.ObjectName;
 import org.junit.Test;
 
 /**
@@ -86,4 +86,34 @@ public class GridMBeansTest extends GridCommonAbstractTest {
 
 assertEquals(expAttributeVal, attributeVal);
 }
+
+/**
+ * @throws Exception If failed to validate methods.
+ */
+@Test
+public void testBeansClasses() throws Exception {
+String[] clsNames = new 
String[]{"org.apache.ignite.internal.ClusterLocalNodeMetricsMXBeanImpl",
+"org.apache.ignite.internal.ClusterMetricsMXBeanImpl",
+"org.apache.ignite.internal.IgniteKernal",
+"org.apache.ignite.internal.IgnitionMXBeanAdapter",
+"org.apache.ignite.internal.StripedExecutorMXBeanAdapter",
+"org.apache.ignite.internal.ThreadPoolMXBeanAdapter",
+"org.apache.ignite.internal.TransactionMetricsMxBeanImpl",
+"org.apache.ignite.internal.TransactionsMXBeanImpl",
+
"org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsMXBeanImpl",
+
"org.apache.ignite.internal.processors.cache.persistence.DataStorageMXBeanImpl",
+
"org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.PageLockTrackerMXBeanImpl",
+
"org.apache.ignite.internal.processors.cluste

[ignite] branch master updated: IGNITE-11939 IgnitePdsTxHistoricalRebalancingTest.testTopologyChangesWithConstantLoad test failure - Fixes #7400.

2020-02-12 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 183034e  IGNITE-11939 
IgnitePdsTxHistoricalRebalancingTest.testTopologyChangesWithConstantLoad test 
failure - Fixes #7400.
183034e is described below

commit 183034e2839d7de44ddafb38d36a2cd61b9cd68c
Author: Mirza Aliev 
AuthorDate: Wed Feb 12 20:50:02 2020 +0300

IGNITE-11939 
IgnitePdsTxHistoricalRebalancingTest.testTopologyChangesWithConstantLoad test 
failure - Fixes #7400.

Signed-off-by: Ivan Rakov 
---
 .../GridCacheDatabaseSharedManager.java|  29 +++--
 .../persistence/WalPreloadingConcurrentTest.java   | 140 +
 .../ignite/testsuites/IgnitePdsTestSuite2.java |   3 +
 3 files changed, 163 insertions(+), 9 deletions(-)

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 8000f5f..b11bb62 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
@@ -60,6 +60,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.atomic.LongAdder;
+import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.function.Consumer;
 import java.util.function.Predicate;
@@ -429,6 +430,9 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 /** Page list cache limits per data region. */
 private final Map pageListCacheLimits = new 
ConcurrentHashMap<>();
 
+/** Lock for releasing history for preloading. */
+private ReentrantLock releaseHistForPreloadingLock = new ReentrantLock();
+
 /**
  * @param ctx Kernal context.
  */
@@ -1868,18 +1872,25 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 
 /** {@inheritDoc} */
 @Override public void releaseHistoryForPreloading() {
-for (Map.Entry, T2> e : 
reservedForPreloading.entrySet()) {
-try {
-cctx.wal().release(e.getValue().get2());
-}
-catch (IgniteCheckedException ex) {
-U.error(log, "Could not release WAL reservation", ex);
+releaseHistForPreloadingLock.lock();
+
+try {
+for (Map.Entry, T2> e : 
reservedForPreloading.entrySet()) {
+try {
+cctx.wal().release(e.getValue().get2());
+}
+catch (IgniteCheckedException ex) {
+U.error(log, "Could not release WAL reservation", ex);
 
-throw new IgniteException(ex);
+throw new IgniteException(ex);
+}
 }
-}
 
-reservedForPreloading.clear();
+reservedForPreloading.clear();
+}
+finally {
+releaseHistForPreloadingLock.unlock();
+}
 }
 
 /**
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/WalPreloadingConcurrentTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/WalPreloadingConcurrentTest.java
new file mode 100644
index 000..1473325
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/WalPreloadingConcurrentTest.java
@@ -0,0 +1,140 @@
+/*
+ * 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.concurrent.Callable;
+import java.util.concurrent.ThreadLocalRandom;
+impor

[ignite] branch master updated: IGNITE-12649 HibernateL2CacheExample throws IllegalArgumentException for ignite-hibernate_5.3 - Fixes #7393.

2020-02-12 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 0ba6b36  IGNITE-12649 HibernateL2CacheExample throws 
IllegalArgumentException for ignite-hibernate_5.3 - Fixes #7393.
0ba6b36 is described below

commit 0ba6b3642fd63977485e87def89e035ca0a0525c
Author: Slava Koptilin 
AuthorDate: Wed Feb 12 20:45:29 2020 +0300

IGNITE-12649 HibernateL2CacheExample throws IllegalArgumentException for 
ignite-hibernate_5.3 - Fixes #7393.

Signed-off-by: Ivan Rakov 
---
 .../hibernate/HibernateL2CacheExample.java | 52 +++---
 1 file changed, 46 insertions(+), 6 deletions(-)

diff --git 
a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
 
b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
index 551e5d0..0426800 100644
--- 
a/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
+++ 
b/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
@@ -93,8 +93,6 @@ public class HibernateL2CacheExample {
 Arrays.asList(User.class.getName(), Post.class.getName(), 
User.class.getName() + ".posts");
 
 /** Caches' names. */
-private static final String UPDATE_TIMESTAMPS_CACHE_NAME = 
"org.hibernate.cache.spi.UpdateTimestampsCache";
-private static final String STANDART_QUERY_CACHE_NAME = 
"org.hibernate.cache.internal.StandardQueryCache";
 private static final String USER_CACHE_NAME = 
"org.apache.ignite.examples.datagrid.hibernate.User";
 private static final String USER_POSTS_CACHE_NAME = 
"org.apache.ignite.examples.datagrid.hibernate.User.posts";
 private static final String POST_CACHE_NAME = 
"org.apache.ignite.examples.datagrid.hibernate.Post";
@@ -117,8 +115,8 @@ public class HibernateL2CacheExample {
 // Auto-close cache at the end of the example.
 try (
 // Create all required caches.
-IgniteCache c1 = createCache(UPDATE_TIMESTAMPS_CACHE_NAME, 
ATOMIC);
-IgniteCache c2 = createCache(STANDART_QUERY_CACHE_NAME, 
ATOMIC);
+IgniteCache c1 = createCache(timestampsCacheName(), ATOMIC);
+IgniteCache c2 = createCache(queryResultsCacheName(), ATOMIC);
 IgniteCache c3 = createCache(USER_CACHE_NAME, TRANSACTIONAL);
 IgniteCache c4 = createCache(USER_POSTS_CACHE_NAME, 
TRANSACTIONAL);
 IgniteCache c5 = createCache(POST_CACHE_NAME, TRANSACTIONAL)
@@ -193,8 +191,8 @@ public class HibernateL2CacheExample {
 }
 finally {
 // Distributed cache could be removed from cluster only by 
#destroyCache() call.
-ignite.destroyCache(UPDATE_TIMESTAMPS_CACHE_NAME);
-ignite.destroyCache(STANDART_QUERY_CACHE_NAME);
+ignite.destroyCache(timestampsCacheName());
+ignite.destroyCache(queryResultsCacheName());
 ignite.destroyCache(USER_CACHE_NAME);
 ignite.destroyCache(USER_POSTS_CACHE_NAME);
 ignite.destroyCache(POST_CACHE_NAME);
@@ -258,4 +256,46 @@ public class HibernateL2CacheExample {
 
 System.out.println("=");
 }
+
+/**
+ * Returns the name of the timestamps cache to a specific version of 
apache-hibernate.
+ *
+ * @return Name of the update timestamps cache.
+ */
+private static String timestampsCacheName() {
+return isIgniteHibernate51orBelowEnabled() ?
+// Represents the name of timestamps region specific to hibernate 
5.1 {@see HibernateTimestampsRegion}.
+"org.hibernate.cache.spi.UpdateTimestampsCache":
+// Represents the name of timestamps region specific to hibernate 
5.3 {@see IgniteTimestampsRegion}.
+"default-update-timestamps-region";
+}
+
+/**
+ * Returns the name of the query results cache to a specific version of 
apache-hibernate.
+ *
+ * @return Name of the update timestamps cache.
+ */
+private static String queryResultsCacheName() {
+return isIgniteHibernate51orBelowEnabled() ?
+// Represents the name of query results region specific to 
hibernate 5.1 {@see HibernateQueryResultsRegion}.
+"org.hibernate.cache.internal.StandardQueryCache":
+// Represents the name of query results region specific to 
hibernate 5.3 {@see IgniteQueryResultsRegion}.
+"default-query-results-region";
+}
+
+/**
+ * Returns {@code true} if ignite-hibernate 5.1 is enabled.

[ignite] branch master updated: IGNITE-12654 Some of rentingFutures in GridDhtPartitionTopologyImpl may accumulate a huge number of eviction callbacks - Fixes #7399.

2020-02-12 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new e17887b  IGNITE-12654 Some of rentingFutures in 
GridDhtPartitionTopologyImpl may accumulate a huge number of eviction callbacks 
- Fixes #7399.
e17887b is described below

commit e17887bfbff7ddf8d58b9c376acca0382a184c15
Author: Slava Koptilin 
AuthorDate: Wed Feb 12 20:43:26 2020 +0300

IGNITE-12654 Some of rentingFutures in GridDhtPartitionTopologyImpl may 
accumulate a huge number of eviction callbacks - Fixes #7399.

Signed-off-by: Ivan Rakov 
---
 .../dht/topology/GridDhtLocalPartition.java|  16 ++-
 .../dht/topology/GridDhtPartitionTopologyImpl.java |  28 +++--
 ...eScheduleResendPartitionsAfterEvictionTest.java | 135 +
 .../ignite/testsuites/IgniteCacheTestSuite7.java   |   2 +
 4 files changed, 171 insertions(+), 10 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtLocalPartition.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtLocalPartition.java
index ff0b0f2..13b7811 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtLocalPartition.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtLocalPartition.java
@@ -653,12 +653,26 @@ public class GridDhtLocalPartition extends 
GridCacheConcurrentMapImpl implements
  * @return Future to signal that this node is no longer an owner or backup.
  */
 public IgniteInternalFuture rent(boolean updateSeq) {
+return rent(updateSeq, true);
+}
+
+/**
+ * Initiates partition eviction process.
+ *
+ * If partition has reservations, eviction will be delayed and continued 
after all reservations will be released.
+ *
+ * @param updateSeq If {@code true} topology update sequence will be 
updated after eviction is finished.
+ * @param alwaysReturnRentingFut If {@code true} renting future is 
returned in any way.
+ * @return Future to signal that this node is no longer an owner or backup 
or null if corresponding partition
+ * state is {@code RENTING} or {@code EVICTED}.
+ */
+public IgniteInternalFuture rent(boolean updateSeq, boolean 
alwaysReturnRentingFut) {
 long state0 = this.state.get();
 
 GridDhtPartitionState partState = getPartState(state0);
 
 if (partState == RENTING || partState == EVICTED)
-return rent;
+return alwaysReturnRentingFut ? rent : null;
 
 delayedRentingTopVer = 
ctx.exchange().readyAffinityVersion().topologyVersion();
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
index 4156878..d1eae4f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
@@ -70,6 +70,7 @@ import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteInClosure;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -2436,6 +2437,7 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
  * @param aff Affinity assignments.
  * @return {@code True} if there are local partitions need to be evicted.
  */
+@SuppressWarnings("unchecked")
 private boolean checkEvictions(long updateSeq, AffinityAssignment aff) {
 if (!ctx.kernalContext().state().evictionsAllowed())
 return false;
@@ -2465,9 +2467,11 @@ public class GridDhtPartitionTopologyImpl implements 
GridDhtPartitionTopology {
 if (nodeIds.containsAll(F.nodeIds(affNodes))) {
 GridDhtPartitionState state0 = part.state();
 
-IgniteInternalFuture rentFut = part.rent(false);
+// There is no need to track a renting future of a partition 
which is already renting/evicted.
+IgniteInternalFuture rentFut = part.rent(false, false);
 
-rentingFutures.add(rentFut);
+if (rentFut != null)
+rentingFutures.add(rentFut);
 
 updateSeq = updateLoc

[ignite] branch master updated: IGNITE-12651 Non-comparable keys for eviction policy cause failure handle and node shutdown - Fixes #7397.

2020-02-12 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new bdbe6a7  IGNITE-12651 Non-comparable keys for eviction policy cause 
failure handle and node shutdown - Fixes #7397.
bdbe6a7 is described below

commit bdbe6a79d097bc6a81f2815989756f9ac925e217
Author: Slava Koptilin 
AuthorDate: Wed Feb 12 20:41:05 2020 +0300

IGNITE-12651 Non-comparable keys for eviction policy cause failure handle 
and node shutdown - Fixes #7397.

Signed-off-by: Ivan Rakov 
---
 .../processors/cache/GridCacheEvictionManager.java |  23 ++-
 .../eviction/EvictionPolicyFailureHandlerTest.java | 227 +
 .../IgniteCacheEvictionSelfTestSuite.java  |   2 +
 .../testsuites/IgniteCacheMvccTestSuite8.java  |   2 +
 4 files changed, 252 insertions(+), 2 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
index 24c0429..e87b9d2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionManager.java
@@ -28,6 +28,7 @@ import 
org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
 import 
org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager;
 import org.apache.ignite.internal.util.GridBusyLock;
 import org.apache.ignite.internal.util.typedef.X;
+import org.apache.ignite.internal.util.typedef.internal.LT;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.mxbean.IgniteMBeanAware;
 import org.jetbrains.annotations.Nullable;
@@ -316,8 +317,26 @@ public class GridCacheEvictionManager extends 
GridCacheManagerAdapter implements
 if (log.isDebugEnabled())
 log.debug("Notifying eviction policy with entry: " + e);
 
-if (filter == null || 
filter.evictAllowed(e.wrapLazyValue(cctx.keepBinary(
-plc.onEntryAccessed(e.obsoleteOrDeleted(), e.wrapEviction());
+if (filter == null || 
filter.evictAllowed(e.wrapLazyValue(cctx.keepBinary( {
+try {
+plc.onEntryAccessed(e.obsoleteOrDeleted(), e.wrapEviction());
+}
+catch (RuntimeException ex) {
+if (!e.obsoleteOrDeleted()) {
+try {
+plc.onEntryAccessed(true, e.wrapEviction());
+}
+catch (RuntimeException re) {
+// It seems that this exception can be ignored due to 
the fact that
+// the original exception already exists and will be 
reported to the logger.
+}
+
+e.wrapEviction().evict();
+}
+
+LT.warn(log, "The cache entry cannot be touched [entry=" + e + 
", err=" + ex + ']');
+}
+}
 }
 
 /** {@inheritDoc} */
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionPolicyFailureHandlerTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionPolicyFailureHandlerTest.java
new file mode 100644
index 000..c6ed0ef
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/EvictionPolicyFailureHandlerTest.java
@@ -0,0 +1,227 @@
+/*
+ * 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.eviction;
+
+import java.io.Serializable;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
+import javax.cache.configuration.Factory;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteTransactions;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CachePeekMode;
+import 

[ignite] branch master updated: IGNITE-12631 Incorrect rewriting wal record type in marshalled mode during iteration - Fixes #7371.

2020-02-07 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 56a515d  IGNITE-12631 Incorrect rewriting wal record type in 
marshalled mode during iteration - Fixes #7371.
56a515d is described below

commit 56a515db6d73ceec749d3e4c4d1737a972bcb886
Author: Anton Kalashnikov 
AuthorDate: Fri Feb 7 19:23:46 2020 +0300

IGNITE-12631 Incorrect rewriting wal record type in marshalled mode during 
iteration - Fixes #7371.

Signed-off-by: Ivan Rakov 
---
 .../wal/serializer/RecordV1Serializer.java |   7 +-
 .../wal/serializer/RecordV2Serializer.java |   2 +-
 .../wal/record/WALRecordSerializationTest.java | 233 +
 .../internal/pagemem/wal/record/WALRecordTest.java |  16 +-
 .../testframework/wal/record/RecordUtils.java  | 566 +
 .../wal/record/UnsupportedWalRecord.java   |  46 ++
 .../ignite/testsuites/IgniteBasicTestSuite.java|   2 +
 7 files changed, 868 insertions(+), 4 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordV1Serializer.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordV1Serializer.java
index 79e15a9..2d1386a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordV1Serializer.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordV1Serializer.java
@@ -386,10 +386,13 @@ public class RecordV1Serializer implements 
RecordSerializer {
 size = in0.io().size();
 }
 catch (IOException ignore) {
-// No-op. It just for information. Fail calculate file size.
+// It just for information. Fail calculate file size.
+e.addSuppressed(ignore);
 }
 
-throw new IgniteCheckedException("Failed to read WAL record at 
position: " + startPos + " size: " + size, e);
+throw new IgniteCheckedException(
+"Failed to read WAL record at position: " + startPos + ", 
size: " + size + ", expectedPtr: " + expPtr, e
+);
 }
 }
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordV2Serializer.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordV2Serializer.java
index 26913f4..a1f7bfd 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordV2Serializer.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/serializer/RecordV2Serializer.java
@@ -141,7 +141,7 @@ public class RecordV2Serializer implements RecordSerializer 
{
 else
 buf.clear();
 
-buf.put((byte)(recType.ordinal() + 1));
+buf.put((byte)(recType.index() + 1));
 
 buf.putLong(ptr.index());
 buf.putInt(ptr.fileOffset());
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/pagemem/wal/record/WALRecordSerializationTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/pagemem/wal/record/WALRecordSerializationTest.java
new file mode 100644
index 000..edd348d
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/pagemem/wal/record/WALRecordSerializationTest.java
@@ -0,0 +1,233 @@
+/*
+ * 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.pagemem.wal.record;
+
+import java.io.File;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.Ign

[ignite] branch master updated: IGNITE-12621 Node leave may cause NullPointerException during IO message processing if security is enabled - Fixes #7366.

2020-02-07 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 14dd160  IGNITE-12621 Node leave may cause NullPointerException during 
IO message processing if security is enabled - Fixes #7366.
14dd160 is described below

commit 14dd160f906d46ddd51563b817cc573dfc16b945
Author: Slava Koptilin 
AuthorDate: Fri Feb 7 19:00:55 2020 +0300

IGNITE-12621 Node leave may cause NullPointerException during IO message 
processing if security is enabled - Fixes #7366.

Signed-off-by: Ivan Rakov 
---
 .../managers/communication/GridIoManager.java  |  9 ++--
 .../managers/discovery/GridDiscoveryManager.java   | 17 
 .../security/IgniteSecurityProcessor.java  | 19 -
 .../processors/security/SecurityUtils.java |  5 ++-
 .../security/IgniteSecurityProcessorTest.java  | 48 ++
 .../ignite/testsuites/SecurityTestSuite.java   |  2 +
 6 files changed, 95 insertions(+), 5 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index e8aeb53..898245e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -2378,15 +2378,18 @@ public class GridIoManager extends 
GridManagerAdapter p) {
-addUserMessageListener(topic, p, null);
+addUserMessageListener(topic, p, ctx.localNodeId());
 }
 
 /**
  * @param topic Topic to subscribe to.
  * @param p Message predicate.
  */
-public void addUserMessageListener(final @Nullable Object topic,
-final @Nullable IgniteBiPredicate p, final @Nullable UUID 
nodeId) {
+public void addUserMessageListener(
+final @Nullable Object topic,
+final @Nullable IgniteBiPredicate p,
+final UUID nodeId
+) {
 if (p != null) {
 try {
 if (p instanceof PlatformMessageFilter)
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 8cc317a..1ed95de 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2483,6 +2483,23 @@ public class GridDiscoveryManager extends 
GridManagerAdapter {
 ((IgniteDiscoverySpi)spi).resolveCommunicationFailure(node, err);
 }
 
+/**
+ * Resolves by ID cluster node which is alive or has recently left the 
cluster.
+ *
+ * @param nodeId Node id.
+ * @return resolved node, or null if node not found.
+ */
+public ClusterNode historicalNode(UUID nodeId) {
+for (DiscoCache discoCache : discoCacheHist.descendingValues()) {
+ClusterNode node = discoCache.node(nodeId);
+
+if (node != null)
+return node;
+}
+
+return null;
+}
+
 /** Worker for network segment checks. */
 private class SegmentCheckWorker extends GridWorker {
 /** */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
index c8f8868..c6cd587 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityProcessor.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.security;
 import java.security.Security;
 import java.util.Collection;
 import java.util.Map;
+import java.util.Optional;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -110,12 +111,28 @@ public class IgniteSecurityProcessor implements 
IgniteSecurity, GridProcessor {
 return withContext(
 secCtxs.computeIfAbsent(nodeId,
 uuid -> nodeSecurityContext(
-marsh, U.resolveClassLoader(ctx.config()), 
ctx.discovery().node(uuid)
+marsh, U.resolveClassLoader(ctx.config()), findNode(uuid)
 )
 )
 );
 }
 
+/**
+ * Resolves cluster node by its ID.
+ *
+ * @param nodeId Node id.
+ * @throws IllegalStateException If node with provided ID doesn't exist.
+ */
+private ClusterNode findNode(U

[ignite] branch master updated: IGNITE-12636 Full rebalance instead of a historical one - Fixes #7379.

2020-02-07 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 67ac1d5  IGNITE-12636 Full rebalance instead of a historical one - 
Fixes #7379.
67ac1d5 is described below

commit 67ac1d5d68a2e2d13d5b3c361a8ab10b1d7873dc
Author: Mirza Aliev 
AuthorDate: Fri Feb 7 18:48:14 2020 +0300

IGNITE-12636 Full rebalance instead of a historical one - Fixes #7379.

Signed-off-by: Ivan Rakov 
---
 .../cache/GridCachePartitionExchangeManager.java   |   9 +-
 .../dht/preloader/GridDhtPreloader.java|   2 +-
 .../db/FullHistRebalanceOnClientStopTest.java  | 257 +
 .../ignite/testsuites/IgnitePdsTestSuite2.java |   3 +
 4 files changed, 269 insertions(+), 2 deletions(-)

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 308e6a4..e78ada3 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
@@ -1117,6 +1117,13 @@ public class GridCachePartitionExchangeManager 
extends GridCacheSharedMana
 }
 
 /**
+ * @return {@code True} if pending future queue contains server exchange 
task.
+ */
+public boolean hasPendingServerExchange() {
+return exchWorker.hasPendingServerExchange();
+}
+
+/**
  *
  * @param topVer Topology version.
  * @return Last topology version before the provided one when affinity was 
modified.
@@ -3437,7 +3444,7 @@ public class GridCachePartitionExchangeManager 
extends GridCacheSharedMana
 if (forcedRebFut != null)
 forcedRebFut.markInitialized();
 
-if (assignsCancelled || hasPendingExchange()) {
+if (assignsCancelled || hasPendingServerExchange()) {
 U.log(log, "Skipping rebalancing (obsolete 
exchange ID) " +
 "[top=" + resVer + ", evt=" + 
exchId.discoveryEventName() +
 ", node=" + exchId.nodeId() + ']');
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 2ab4d90..b8d3ff3 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -202,7 +202,7 @@ public class GridDhtPreloader extends 
GridCachePreloaderAdapter {
 CachePartitionFullCountersMap countersMap = 
grp.topology().fullUpdateCounters();
 
 for (int p = 0; p < partitions; p++) {
-if (ctx.exchange().hasPendingExchange()) {
+if (ctx.exchange().hasPendingServerExchange()) {
 if (log.isDebugEnabled())
 log.debug("Skipping assignments creation, exchange worker 
has pending assignments: " +
 exchId);
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/FullHistRebalanceOnClientStopTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/FullHistRebalanceOnClientStopTest.java
new file mode 100644
index 000..9eaafd6
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/FullHistRebalanceOnClientStopTest.java
@@ -0,0 +1,257 @@
+/*
+ * 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.cac

[ignite] branch master updated: IGNITE-12618 Affinity cache for version of last server event can be wiped from history - Fixes #7359.

2020-02-05 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 0dfd983  IGNITE-12618 Affinity cache for version of last server event 
can be wiped from history - Fixes #7359.
0dfd983 is described below

commit 0dfd98388e250d099912cee8793f4cd45597eb9a
Author: Slava Koptilin 
AuthorDate: Wed Feb 5 18:34:39 2020 +0300

IGNITE-12618 Affinity cache for version of last server event can be wiped 
from history - Fixes #7359.

Signed-off-by: Ivan Rakov 
---
 .../affinity/GridAffinityAssignmentCache.java  |  96 ++
 .../cache/affinity/AffinityHistoryCleanupTest.java |  45 ++---
 .../GridAffinityProcessorMemoryLeakTest.java   | 194 -
 .../cache/CacheNoAffinityExchangeTest.java |  22 ++-
 .../ignite/testsuites/IgniteBasicTestSuite.java|   8 +-
 5 files changed, 111 insertions(+), 254 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 9297ae8..52a9342 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -44,6 +44,7 @@ import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.cluster.NodeOrderComparator;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.processors.cache.ExchangeDiscoveryEvents;
+import 
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager;
 import org.apache.ignite.internal.processors.cluster.BaselineTopology;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.typedef.F;
@@ -65,11 +66,27 @@ import static 
org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVE
  * Affinity cached function.
  */
 public class GridAffinityAssignmentCache {
-/** Cleanup history size. */
-private final int MAX_HIST_SIZE = getInteger(IGNITE_AFFINITY_HISTORY_SIZE, 
50);
+/**
+ * Affinity cache will shrink when total number of non-shallow (see {@link 
HistoryAffinityAssignmentImpl})
+ * historical instances will be greater than value of this constant.
+ */
+private final int MAX_NON_SHALLOW_HIST_SIZE = 
getInteger(IGNITE_AFFINITY_HISTORY_SIZE, 25);
 
-/** Cleanup history links size (calculated by both real entries and 
shallow copies). */
-private final int MAX_HIST_LINKS_SIZE = MAX_HIST_SIZE * 10;
+/**
+ * Affinity cache will also shrink when total number of both shallow 
({@link HistoryAffinityAssignmentShallowCopy})
+ * and non-shallow (see {@link HistoryAffinityAssignmentImpl}) historical 
instances will be greater than
+ * value of this constant.
+ */
+private final int MAX_TOTAL_HIST_SIZE = MAX_NON_SHALLOW_HIST_SIZE * 10;
+
+/**
+ * Independent of {@link #MAX_NON_SHALLOW_HIST_SIZE} and {@link 
#MAX_TOTAL_HIST_SIZE}, affinity cache will always
+ * keep this number of non-shallow (see {@link 
HistoryAffinityAssignmentImpl}) instances.
+ * We need at least one real instance, otherwise we won't be able to get 
affinity cache for
+ * {@link 
GridCachePartitionExchangeManager#lastAffinityChangedTopologyVersion} in case 
cluster has experienced
+ * too many client joins / client leaves / local cache starts.
+ */
+private final int MIN_NON_SHALLOW_HIST_SIZE = 2;
 
 /** Partition distribution. */
 private final float partDistribution = 
getFloat(IGNITE_PART_DISTRIBUTION_WARN_THRESHOLD, 50f);
@@ -122,8 +139,8 @@ public class GridAffinityAssignmentCache {
 /** Node stop flag. */
 private volatile IgniteCheckedException stopErr;
 
-/** Full history size. */
-private final AtomicInteger fullHistSize = new AtomicInteger();
+/** Number of non-shallow (see {@link HistoryAffinityAssignmentImpl}) 
affinity cache instances. */
+private final AtomicInteger nonShallowHistSize = new AtomicInteger();
 
 /** */
 private final Object similarAffKey;
@@ -278,7 +295,7 @@ public class GridAffinityAssignmentCache {
 
 affCache.clear();
 
-fullHistSize.set(0);
+nonShallowHistSize.set(0);
 
 head.set(new GridAffinityAssignmentV2(AffinityTopologyVersion.NONE));
 
@@ -780,8 +797,8 @@ public class GridAffinityAssignmentCache {
 cache = e.getValue();
 
 if (cache == null) {
-throw new IllegalStateException("Getting affinity for too old 
topology version that is already " +
-"out of history [locNode=" + ctx.d

[ignite] branch master updated: IGNITE-12607 PartitionsExchangeAwareTest is flaky - Fixes #7339.

2020-02-03 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 7beefee  IGNITE-12607 PartitionsExchangeAwareTest is flaky - Fixes 
#7339.
7beefee is described below

commit 7beefeebc775ec63e56f2dd7ec8f6640cdc099d3
Author: Ivan Rakov 
AuthorDate: Mon Feb 3 14:49:34 2020 +0300

IGNITE-12607 PartitionsExchangeAwareTest is flaky - Fixes #7339.
---
 .../cache/distributed/PartitionsExchangeAwareTest.java | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/PartitionsExchangeAwareTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/PartitionsExchangeAwareTest.java
index 2070dcd..48512f0 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/PartitionsExchangeAwareTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/PartitionsExchangeAwareTest.java
@@ -263,10 +263,14 @@ public class PartitionsExchangeAwareTest extends 
GridCommonAbstractTest {
 
 assertEquals(updatePossible, GridTestUtils.waitForCondition(new 
GridAbsPredicate() {
 @Override public boolean apply() {
-assertTrue(txUpdateFut.isDone() == atomicUpdateFut.isDone());
-
-return atomicUpdateFut.isDone();
+return atomicUpdateFut.isDone() && txUpdateFut.isDone();
 }
 }, TIMEOUT_SECONDS * 1000));
+
+if (!updatePossible) {
+assertFalse(atomicUpdateFut.isDone());
+
+assertFalse(txUpdateFut.isDone());
+}
 }
 }



[ignite] branch master updated: IGNITE-12447 Modification of S#compact method - Fixes #7139.

2020-01-31 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 5cafd44  IGNITE-12447 Modification of S#compact method - Fixes #7139.
5cafd44 is described below

commit 5cafd4408dadf172b23b52cb2e278bd3d66b6f52
Author: Kirill Tkalenko 
AuthorDate: Fri Jan 31 12:18:08 2020 +0300

IGNITE-12447 Modification of S#compact method - Fixes #7139.

Signed-off-by: Ivan Rakov 
---
 .../util/tostring/GridToStringBuilder.java | 35 --
 .../util/tostring/GridToStringBuilderSelfTest.java | 79 ++
 2 files changed, 107 insertions(+), 7 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
index 58abd55..4dd3741 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
@@ -38,6 +38,7 @@ import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.function.Supplier;
+import java.util.function.Function;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.internal.util.GridUnsafe;
@@ -1832,26 +1833,46 @@ public class GridToStringBuilder {
  * @param col Collection of integers.
  * @return Compacted string representation of given collections.
  */
-public static String compact(@NotNull Collection col) {
+public static String compact(Collection col) {
+return compact(col, i -> i + 1);
+}
+
+/**
+ * Returns sorted and compacted string representation of given {@code col}.
+ * Two nearby numbers are compacted to one continuous segment.
+ * E.g. collection of [1, 2, 3, 5, 6, 7, 10] with
+ * {@code nextValFun = i -> i + 1} will be compacted to [1-3, 5-7, 10].
+ *
+ * @param col Collection of numbers.
+ * @param nextValFun Function to get nearby number.
+ * @return Compacted string representation of given collections.
+ */
+public static > String compact(
+Collection col,
+Function nextValFun
+) {
+assert nonNull(col);
+assert nonNull(nextValFun);
+
 if (col.isEmpty())
 return "[]";
 
 SB sb = new SB();
 sb.a('[');
 
-List l = new ArrayList<>(col);
+List l = new ArrayList<>(col);
 Collections.sort(l);
 
-int left = l.get(0), right = left;
+T left = l.get(0), right = left;
 for (int i = 1; i < l.size(); i++) {
-int val = l.get(i);
+T val = l.get(i);
 
-if (right == val || right + 1 == val) {
+if (right.compareTo(val) == 0 || 
nextValFun.apply(right).compareTo(val) == 0) {
 right = val;
 continue;
 }
 
-if (left == right)
+if (left.compareTo(right) == 0)
 sb.a(left);
 else
 sb.a(left).a('-').a(right);
@@ -1861,7 +1882,7 @@ public class GridToStringBuilder {
 left = right = val;
 }
 
-if (left == right)
+if (left.compareTo(right) == 0)
 sb.a(left);
 else
 sb.a(left).a('-').a(right);
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java
index bd57a6d..108ef42 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/util/tostring/GridToStringBuilderSelfTest.java
@@ -22,6 +22,7 @@ import java.lang.management.ManagementFactory;
 import java.lang.reflect.Array;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -30,6 +31,7 @@ import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.locks.ReadWriteLock;
+import java.util.function.Function;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.internal.IgniteInternalFuture;
@@ -41,8 +43,11 @@ import 
org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.testframework.junits.common.GridCommonTest;
 import org.junit.Test;
 
+import static java.util.Arrays.asList;
+import static java.u

[ignite] branch ignite-2.8 updated: IGNITE-12601 DistributedMetaStoragePersistentTest.testUnstableTopology is flaky - Fixes #7334.

2020-01-30 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch ignite-2.8
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-2.8 by this push:
 new f478aa5  IGNITE-12601 
DistributedMetaStoragePersistentTest.testUnstableTopology is flaky - Fixes 
#7334.
f478aa5 is described below

commit f478aa564405d6ed690a2853594b965bdcc526da
Author: Slava Koptilin 
AuthorDate: Fri Jan 31 01:23:19 2020 +0300

IGNITE-12601 DistributedMetaStoragePersistentTest.testUnstableTopology is 
flaky - Fixes #7334.

Signed-off-by: Ivan Rakov 
(cherry picked from commit 188e4d52c2d8085874fed9349b03fedeca6edb59)
---
 .../cache/persistence/metastorage/MetaStorage.java| 19 ---
 .../metastorage/persistence/DmsDataWriterWorker.java  |  2 ++
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/MetaStorage.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/MetaStorage.java
index 670992c..d56500a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/MetaStorage.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/MetaStorage.java
@@ -418,17 +418,8 @@ public class MetaStorage implements DbCheckpointListener, 
ReadWriteMetastorage {
 @Override public void write(@NotNull String key, @NotNull Serializable 
val) throws IgniteCheckedException {
 assert val != null;
 
-byte[] data = marshaller.marshal(val);
-
-final WALPointer ptr;
-
-synchronized (this) {
-ptr = wal.log(new MetastoreDataRecord(key, data));
-
-writeRaw(key, data);
-}
-
-wal.flush(ptr, false);
+if (!readOnly)
+writeRaw(key, marshaller.marshal(val));
 }
 
 /** {@inheritDoc} */
@@ -439,7 +430,11 @@ public class MetaStorage implements DbCheckpointListener, 
ReadWriteMetastorage {
 /** {@inheritDoc} */
 @Override public void writeRaw(String key, byte[] data) throws 
IgniteCheckedException {
 if (!readOnly) {
+WALPointer ptr;
+
 synchronized (this) {
+ptr = wal.log(new MetastoreDataRecord(key, data));
+
 MetastorageDataRow oldRow = tree.findOne(new 
MetastorageDataRow(key, null));
 
 if (oldRow != null) {
@@ -451,6 +446,8 @@ public class MetaStorage implements DbCheckpointListener, 
ReadWriteMetastorage {
 tree.rowStore().addRow(row);
 tree.put(row);
 }
+
+wal.flush(ptr, false);
 }
 }
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DmsDataWriterWorker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DmsDataWriterWorker.java
index 1c333b6..816ff9c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DmsDataWriterWorker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DmsDataWriterWorker.java
@@ -268,6 +268,8 @@ class DmsDataWriterWorker extends GridWorker {
 
 metastorage.iterate(COMMON_KEY_PREFIX, (key, val) -> allKeys.add(key), 
false);
 
+allKeys.remove(cleanupGuardKey());
+
 for (String key : allKeys)
 metastorage.remove(key);
 



[ignite] branch master updated: IGNITE-12601 DistributedMetaStoragePersistentTest.testUnstableTopology is flaky - Fixes #7334.

2020-01-30 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 188e4d5  IGNITE-12601 
DistributedMetaStoragePersistentTest.testUnstableTopology is flaky - Fixes 
#7334.
188e4d5 is described below

commit 188e4d52c2d8085874fed9349b03fedeca6edb59
Author: Slava Koptilin 
AuthorDate: Fri Jan 31 01:23:19 2020 +0300

IGNITE-12601 DistributedMetaStoragePersistentTest.testUnstableTopology is 
flaky - Fixes #7334.

Signed-off-by: Ivan Rakov 
---
 .../cache/persistence/metastorage/MetaStorage.java| 19 ---
 .../metastorage/persistence/DmsDataWriterWorker.java  |  2 ++
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/MetaStorage.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/MetaStorage.java
index 670992c..d56500a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/MetaStorage.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/metastorage/MetaStorage.java
@@ -418,17 +418,8 @@ public class MetaStorage implements DbCheckpointListener, 
ReadWriteMetastorage {
 @Override public void write(@NotNull String key, @NotNull Serializable 
val) throws IgniteCheckedException {
 assert val != null;
 
-byte[] data = marshaller.marshal(val);
-
-final WALPointer ptr;
-
-synchronized (this) {
-ptr = wal.log(new MetastoreDataRecord(key, data));
-
-writeRaw(key, data);
-}
-
-wal.flush(ptr, false);
+if (!readOnly)
+writeRaw(key, marshaller.marshal(val));
 }
 
 /** {@inheritDoc} */
@@ -439,7 +430,11 @@ public class MetaStorage implements DbCheckpointListener, 
ReadWriteMetastorage {
 /** {@inheritDoc} */
 @Override public void writeRaw(String key, byte[] data) throws 
IgniteCheckedException {
 if (!readOnly) {
+WALPointer ptr;
+
 synchronized (this) {
+ptr = wal.log(new MetastoreDataRecord(key, data));
+
 MetastorageDataRow oldRow = tree.findOne(new 
MetastorageDataRow(key, null));
 
 if (oldRow != null) {
@@ -451,6 +446,8 @@ public class MetaStorage implements DbCheckpointListener, 
ReadWriteMetastorage {
 tree.rowStore().addRow(row);
 tree.put(row);
 }
+
+wal.flush(ptr, false);
 }
 }
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DmsDataWriterWorker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DmsDataWriterWorker.java
index 1c333b6..816ff9c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DmsDataWriterWorker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/metastorage/persistence/DmsDataWriterWorker.java
@@ -268,6 +268,8 @@ class DmsDataWriterWorker extends GridWorker {
 
 metastorage.iterate(COMMON_KEY_PREFIX, (key, val) -> allKeys.add(key), 
false);
 
+allKeys.remove(cleanupGuardKey());
+
 for (String key : allKeys)
 metastorage.remove(key);
 



[ignite] branch master updated: IGNITE-12478 Add long running operation timeout to MXBean for manipulate in run-time - Fixes #7191.

2020-01-29 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new ef6764e  IGNITE-12478 Add long running operation timeout to MXBean for 
manipulate in run-time - Fixes #7191.
ef6764e is described below

commit ef6764e99c318a857ec92d6a270d8ef621cfde66
Author: Kirill Tkalenko 
AuthorDate: Wed Jan 29 19:47:54 2020 +0300

IGNITE-12478 Add long running operation timeout to MXBean for manipulate in 
run-time - Fixes #7191.

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/internal/IgniteFeatures.java |   5 +-
 .../org/apache/ignite/internal/IgniteKernal.java   |  47 +++--
 .../ignite/internal/TransactionsMXBeanImpl.java|  10 +
 .../cache/LongOperationsDumpSettingsClosure.java   |  57 +
 .../cache/transactions/IgniteTxManager.java|  49 -
 .../apache/ignite/mxbean/TransactionsMXBean.java   |  28 +++
 .../internal/TransactionsMXBeanImplTest.java   | 235 +++--
 7 files changed, 391 insertions(+), 40 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
index fa6bd0a..88526f5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
@@ -85,7 +85,10 @@ public enum IgniteFeatures {
 MASTER_KEY_CHANGE(20),
 
 /** ContinuousQuery with security subject id support. */
-CONT_QRY_SECURITY_AWARE(21);
+CONT_QRY_SECURITY_AWARE(21),
+
+/** Long operations dump timeout. */
+LONG_OPERATIONS_DUMP_TIMEOUT(30);
 
 /**
  * Unique feature identifier.
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 1840451..9892574 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
@@ -233,6 +233,7 @@ import 
org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
 import org.apache.ignite.thread.IgniteStripedThreadPoolExecutor;
 import org.jetbrains.annotations.Nullable;
 
+import static java.util.Objects.nonNull;
 import static 
org.apache.ignite.IgniteSystemProperties.IGNITE_BINARY_MARSHALLER_USE_STRING_SERIALIZATION_VER_2;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_CONFIG_URL;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_DAEMON;
@@ -1521,21 +1522,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 }, metricsLogFreq, metricsLogFreq);
 }
 
-final long longOpDumpTimeout = IgniteSystemProperties.getLong(
-IgniteSystemProperties.IGNITE_LONG_OPERATIONS_DUMP_TIMEOUT,
-DFLT_LONG_OPERATIONS_DUMP_TIMEOUT
-);
-
-if (longOpDumpTimeout > 0) {
-longOpDumpTask = ctx.timeout().schedule(new Runnable() {
-@Override public void run() {
-GridKernalContext ctx = IgniteKernal.this.ctx;
-
-if (ctx != null)
-
ctx.cache().context().exchange().dumpLongRunningOperations(longOpDumpTimeout);
-}
-}, longOpDumpTimeout, longOpDumpTimeout);
-}
+
scheduleLongOperationsDumpTask(ctx.cache().context().tm().longOperationsDumpTimeout());
 
 ctx.performance().add("Disable assertions (remove '-ea' from JVM 
options)", !U.assertionsEnabled());
 
@@ -1561,6 +1548,36 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 }
 
 /**
+ * Scheduling tasks for dumping long operations. Closes current task
+ * (if any) and if the {@code longOpDumpTimeout > 0} schedules a new task
+ * with a new timeout, delay and start period equal to
+ * {@code longOpDumpTimeout}, otherwise task is deleted.
+ *
+ * @param longOpDumpTimeout Long operations dump timeout.
+ */
+public void scheduleLongOperationsDumpTask(long longOpDumpTimeout) {
+if (isStopping())
+return;
+
+synchronized (this) {
+GridTimeoutProcessor.CancelableTask task = longOpDumpTask;
+
+if (nonNull(task))
+task.close();
+
+if (longOpDumpTimeout > 0) {
+longOpDumpTask = ctx.timeout().schedule(
+() -> 
ctx.cache().context().exchange().dumpLongRunningOperations(longOpDumpTimeout),
+longOpDumpTimeout,
+longOpDumpTimeout
+);
+}
+else
+longOpDumpTask = null;
+}
+}
+
+/**
  * @return Ignite security processor. See

[ignite] branch master updated: IGNITE-12516 Dump active transaction from near node does not work if transaction not follow first - Fixes #7221.

2020-01-29 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 71b1f54  IGNITE-12516 Dump active transaction from near node does not 
work if transaction not follow first - Fixes #7221.
71b1f54 is described below

commit 71b1f54557293faaea703cb38f2e6c8eeb57402d
Author: denis-chudov 
AuthorDate: Wed Jan 29 19:43:38 2020 +0300

IGNITE-12516 Dump active transaction from near node does not work if 
transaction not follow first - Fixes #7221.

Signed-off-by: Ivan Rakov 
---
 .../cache/FetchActiveTxOwnerTraceClosure.java  |  37 ++-
 .../cache/GridCachePartitionExchangeManager.java   | 121 +++--
 ...CacheLongRunningTransactionDiagnosticsTest.java |  35 +++---
 3 files changed, 90 insertions(+), 103 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/FetchActiveTxOwnerTraceClosure.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/FetchActiveTxOwnerTraceClosure.java
index 0c51c83..4020f84 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/FetchActiveTxOwnerTraceClosure.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/FetchActiveTxOwnerTraceClosure.java
@@ -16,12 +16,10 @@
  */
 package org.apache.ignite.internal.processors.cache;
 
+import org.apache.ignite.internal.util.GridStringBuilder;
+import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteCallable;
 
-import java.lang.management.ManagementFactory;
-import java.lang.management.ThreadInfo;
-import java.lang.management.ThreadMXBean;
-
 /**
  * Closure that is computed on near node to get the stack trace of active 
transaction owner thread.
  */
@@ -30,9 +28,6 @@ public class FetchActiveTxOwnerTraceClosure implements 
IgniteCallable {
 private static final long serialVersionUID = 0L;
 
 /** */
-private static final StackTraceElement[] STACK_TRACE_ELEMENT_EMPTY = new 
StackTraceElement[0];
-
-/** */
 private final long txOwnerThreadId;
 
 /** */
@@ -47,33 +42,15 @@ public class FetchActiveTxOwnerTraceClosure implements 
IgniteCallable {
  * @throws Exception If failed
  */
 @Override public String call() throws Exception {
-StringBuilder traceDump = new StringBuilder("Stack trace of the 
transaction owner thread:\n");
-
-for (StackTraceElement stackTraceElement : getStackTrace()) {
-traceDump.append(stackTraceElement.toString());
-traceDump.append("\n");
-}
-
-return traceDump.toString();
-}
-
-/**
- * Gets the stack trace of the transaction owner thread
- *
- * @return stack trace elements
- */
-private StackTraceElement[] getStackTrace() {
-ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
-
-ThreadInfo threadInfo;
+GridStringBuilder traceDump = new GridStringBuilder("Stack trace of 
the transaction owner thread:\n");
 
 try {
-threadInfo = threadMXBean.getThreadInfo(txOwnerThreadId, 
Integer.MAX_VALUE);
+U.printStackTrace(txOwnerThreadId, traceDump);
 }
-catch (SecurityException | IllegalArgumentException ignored) {
-threadInfo = null;
+catch (SecurityException | IllegalArgumentException e) {
+traceDump = new GridStringBuilder("Could not get stack trace of 
the transaction owner thread: " + e.getMessage());
 }
 
-return threadInfo == null ? STACK_TRACE_ELEMENT_EMPTY : 
threadInfo.getStackTrace();
+return traceDump.toString();
 }
 }
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 9d9917a..308e6a4 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
@@ -30,6 +30,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.NavigableMap;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.UUID;
@@ -2151,7 +2152,11 @@ public class GridCachePartitionExchangeManager 
extends GridCacheSharedMana
 if (warnings.canAddMessage()) {
 warnings.add(longRunningTransactionWarning(tx, 
curTime));
 
-if (ltrDumpLimiter.allowAction(tx))
+if (cctx.tm().txOwnerDumpRequestsAllowed()
+&am

[ignite] branch master updated: IGNITE-12497 PartitionsEvictManager should log all partitions which will be evicted - Fixes #7202.

2020-01-22 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new f7c954c  IGNITE-12497 PartitionsEvictManager should log all partitions 
which will be evicted - Fixes #7202.
f7c954c is described below

commit f7c954c2739351dd31a96721545237068eb9e696
Author: Kirill Tkalenko 
AuthorDate: Wed Jan 22 12:24:25 2020 +0300

IGNITE-12497 PartitionsEvictManager should log all partitions which will be 
evicted - Fixes #7202.

Signed-off-by: Ivan Rakov 
---
 .../dht/topology/GridDhtLocalPartition.java|   6 +-
 .../dht/topology/PartitionsEvictManager.java   | 125 --
 .../dht/topology/EvictPartitionInLogTest.java  | 274 +
 .../testframework/junits/GridAbstractTest.java |  40 ++-
 .../ignite/testsuites/IgniteBasicTestSuite.java|   2 +
 5 files changed, 429 insertions(+), 18 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtLocalPartition.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtLocalPartition.java
index f6eb74a..ff0b0f2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtLocalPartition.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtLocalPartition.java
@@ -80,6 +80,8 @@ import static 
org.apache.ignite.internal.processors.cache.distributed.dht.topolo
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.MOVING;
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.OWNING;
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.RENTING;
+import static 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.PartitionsEvictManager.EvictReason.CLEARING;
+import static 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.PartitionsEvictManager.EvictReason.EVICTION;
 import static 
org.apache.ignite.internal.processors.cache.persistence.CheckpointState.FINISHED;
 
 /**
@@ -712,7 +714,7 @@ public class GridDhtLocalPartition extends 
GridCacheConcurrentMapImpl implements
 return;
 }
 
-ctx.evict().evictPartitionAsync(grp, 
GridDhtLocalPartition.this);
+ctx.evict().evictPartitionAsync(grp, this, CLEARING);
 }
 });
 
@@ -739,7 +741,7 @@ public class GridDhtLocalPartition extends 
GridCacheConcurrentMapImpl implements
 }
 }
 
-ctx.evict().evictPartitionAsync(grp, this);
+ctx.evict().evictPartitionAsync(grp, this, EVICTION);
 }
 
 /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
index 3c4b1e9..444b630 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
@@ -17,12 +17,17 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.dht.topology;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Comparator;
+import java.util.EnumMap;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Queue;
 import java.util.Set;
+import java.util.StringJoiner;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.PriorityBlockingQueue;
@@ -35,8 +40,10 @@ import 
org.apache.ignite.internal.processors.cache.CacheGroupContext;
 import 
org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
 import org.apache.ignite.internal.util.typedef.internal.LT;
+import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 
+import static java.util.Objects.nonNull;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_EVICTION_PERMITS;
 import static org.apache.ignite.IgniteSystemProperties.getInteger;
 import static org.apache.ignite.IgniteSystemProperties.getLong;
@@ -57,7 +64,8 @@ public class PartitionsEvictManager extends 
GridCacheSharedManagerAdapter {
 private static final byte EVICT_POOL_PLC

[ignite] branch master updated: IGNITE-12460 Cluster fails to find the node by consistent ID - Fixes #7151.

2020-01-20 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 6668d86  IGNITE-12460 Cluster fails to find the node by consistent ID 
- Fixes #7151.
6668d86 is described below

commit 6668d86ad48b4fee3bda8c9e813df33bcaec2947
Author: Anton Kalashnikov 
AuthorDate: Mon Jan 20 20:24:24 2020 +0300

IGNITE-12460 Cluster fails to find the node by consistent ID - Fixes #7151.

Signed-off-by: Ivan Rakov 
---
 .../internal/visor/baseline/VisorBaselineTask.java | 14 ++---
 .../apache/ignite/util/GridCommandHandlerTest.java | 36 +++---
 2 files changed, 40 insertions(+), 10 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
index 4173775..d06ebff 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
@@ -26,7 +26,6 @@ import java.util.Map;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.cluster.BaselineNode;
 import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.cluster.DetachedClusterNode;
 import org.apache.ignite.internal.cluster.IgniteClusterEx;
 import 
org.apache.ignite.internal.processors.cluster.baseline.autoadjust.BaselineAutoAdjustStatus;
 import org.apache.ignite.internal.processors.task.GridInternal;
@@ -143,17 +142,22 @@ public class VisorBaselineTask extends 
VisorOneNodeTask consistentIds) {
+Map baseline = currentBaseLine();
 Map srvrs = currentServers();
 
 Collection baselineTop = new ArrayList<>();
 
 for (String consistentId : consistentIds) {
-BaselineNode node = srvrs.get(consistentId);
+if (srvrs.containsKey(consistentId))
+baselineTop.add(srvrs.get(consistentId));
+
+else if (baseline.containsKey(consistentId))
+baselineTop.add(baseline.get(consistentId));
 
-if (node != null)
-baselineTop.add(node);
 else
-baselineTop.add(new DetachedClusterNode(consistentId, 
null));
+throw new IllegalArgumentException(
+"Check arguments. Node not found for consistent ID: " 
+ consistentId
+);
 }
 
 return set0(baselineTop);
diff --git 
a/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java 
b/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
index ee770e5..a9c8620 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
@@ -17,9 +17,6 @@
 
 package org.apache.ignite.util;
 
-import javax.cache.processor.EntryProcessor;
-import javax.cache.processor.EntryProcessorException;
-import javax.cache.processor.MutableEntry;
 import java.io.File;
 import java.io.IOException;
 import java.io.RandomAccessFile;
@@ -44,6 +41,9 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
+import javax.cache.processor.EntryProcessor;
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteAtomicSequence;
 import org.apache.ignite.IgniteCache;
@@ -642,7 +642,33 @@ public class GridCommandHandlerTest extends 
GridCommandHandlerClusterPerMethodAb
 
 assertEquals(2, ignite.cluster().currentBaselineTopology().size());
 
-assertEquals(EXIT_CODE_UNEXPECTED_ERROR, execute("--baseline", "set", 
"invalidConsistentId"));
+assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "set", 
"invalidConsistentId"));
+}
+
+/**
+ * Test baseline set nodes with baseline offline node works via control.sh
+ *
+ * @throws Exception If failed.
+ */
+@Test
+public void testBaselineSetWithOfflineNode() throws Exception {
+Ignite ignite0 = startGrid(0);
+//It is important to set consistent id to null for force 
autogeneration.
+Ignite ignite1 = 
startGrid(optimize(getConfiguration(getTestIgniteInstanceName(1)).setConsistentId(null)));
+
+assertFalse(ignite0.cluster().active());
+
+ignite0.cluster().active(true);
+
+Ignite other = startGrid(2);
+
+String consistentIds = consistentIds(ignite0, ignite1, other);
+
+ignit

[ignite] branch master updated: IGNITE-12459 Searching checkpoint record in WAL doesn't work with segment compaction - Fixes #7148.

2020-01-20 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 214044a  IGNITE-12459 Searching checkpoint record in WAL doesn't work 
with segment compaction - Fixes #7148.
214044a is described below

commit 214044ae2e6dedb1ee5fc219f54a4de51f889a08
Author: Anton Kalashnikov 
AuthorDate: Mon Jan 20 20:20:13 2020 +0300

IGNITE-12459 Searching checkpoint record in WAL doesn't work with segment 
compaction - Fixes #7148.

Signed-off-by: Ivan Rakov 
---
 .../persistence/wal/FileWriteAheadLogManager.java  |  2 +-
 .../persistence/db/wal/WalCompactionTest.java  | 77 +++---
 2 files changed, 38 insertions(+), 41 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
index 851526e..f534662 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java
@@ -908,7 +908,7 @@ public class FileWriteAheadLogManager extends 
GridCacheSharedManagerAdapter impl
 try (WALIterator it = replay(ptr)) {
 IgniteBiTuple rec = it.next();
 
-if (rec.get1().equals(ptr))
+if (rec != null && rec.get2().position().equals(ptr))
 return rec.get2();
 else
 throw new StorageException("Failed to read record by pointer 
[ptr=" + ptr + ", rec=" + rec + "]");
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionTest.java
index 9ef9363..5b9fd1d 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalCompactionTest.java
@@ -20,8 +20,9 @@ import java.io.File;
 import java.io.FilenameFilter;
 import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
+import java.nio.file.Paths;
 import java.util.Arrays;
-import java.util.Comparator;
+import java.util.Set;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCheckedException;
@@ -41,13 +42,16 @@ import 
org.apache.ignite.internal.pagemem.wal.record.PageSnapshot;
 import org.apache.ignite.internal.pagemem.wal.record.RolloverType;
 import org.apache.ignite.internal.processors.cache.persistence.DummyPageIO;
 import 
org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager;
-import 
org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager;
 import 
org.apache.ignite.internal.processors.cache.persistence.wal.FileDescriptor;
 import org.apache.ignite.internal.util.GridUnsafe;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.junit.Test;
 
+import static java.util.stream.Collectors.toSet;
+import static 
org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.ZIP_SUFFIX;
+
 /**
  *
  */
@@ -184,17 +188,17 @@ public class WalCompactionTest extends 
GridCommonAbstractTest {
 ig.context().cache().context().database().wakeupForCheckpoint("Forced 
checkpoint").get();
 ig.context().cache().context().database().wakeupForCheckpoint("Forced 
checkpoint").get();
 
-Thread.sleep(15_000); // Allow compressor to compress WAL segments.
-
 String nodeFolderName = 
ig.context().pdsFolderResolver().resolveFolders().folderName();
 
 File dbDir = U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", 
false);
 File walDir = new File(dbDir, "wal");
 File archiveDir = new File(walDir, "archive");
 File nodeArchiveDir = new File(archiveDir, nodeFolderName);
-File walSegment = new File(nodeArchiveDir, FileDescriptor.fileName(0) 
+ FilePageStoreManager.ZIP_SUFFIX);
+File walSegment = new File(nodeArchiveDir, FileDescriptor.fileName(0) 
+ ZIP_SUFFIX);
+
+// Allow compressor to compress WAL segments.
+assertTrue(GridTestUtils.waitForCondition(walSegment::exists, 15_000));
 
-assertTrue(walSegment.exists());
 assertTrue(walSegment.length() < WAL_SEGMENT_SIZE / 2); // Should be 
compressed at least in 

[ignite] branch master updated: IGNITE-12545 Introduce listener interface for components to react to partition map exchange events - Fixes #7263.

2020-01-20 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new cebc76f  IGNITE-12545 Introduce listener interface for components to 
react to partition map exchange events - Fixes #7263.
cebc76f is described below

commit cebc76f1f5d7d077093ddaecbabcd8db2106c60a
Author: Ivan Rakov 
AuthorDate: Mon Jan 20 20:08:44 2020 +0300

IGNITE-12545 Introduce listener interface for components to react to 
partition map exchange events - Fixes #7263.
---
 .../cache/GridCachePartitionExchangeManager.java   |  29 +++
 .../preloader/GridDhtPartitionsExchangeFuture.java |  12 +
 .../dht/preloader/PartitionsExchangeAware.java |  69 ++
 .../distributed/PartitionsExchangeAwareTest.java   | 272 +
 .../testsuites/IgniteCacheMvccTestSuite6.java  |   4 +
 .../ignite/testsuites/IgniteCacheTestSuite6.java   |   3 +
 6 files changed, 389 insertions(+)

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 eba10ff..0e4a5ff 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
@@ -96,6 +96,7 @@ import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.Gri
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloaderAssignments;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.IgniteDhtPartitionHistorySuppliersMap;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.IgniteDhtPartitionsToReloadMap;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionsExchangeAware;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.RebalanceReassignExchangeTask;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.StopCachesOnClientReconnectExchangeTask;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch.ExchangeLatchManager;
@@ -273,6 +274,9 @@ public class GridCachePartitionExchangeManager 
extends GridCacheSharedMana
 /** Distributed latch manager. */
 private ExchangeLatchManager latchMgr;
 
+/** List of exchange aware components. */
+private final List exchangeAwareComps = new 
ArrayList<>();
+
 /** Histogram of PME durations. */
 private volatile HistogramMetric durationHistogram;
 
@@ -1204,6 +1208,31 @@ public class GridCachePartitionExchangeManager 
extends GridCacheSharedMana
 }
 
 /**
+ * Registers component that will be notified on every partition map 
exchange.
+ *
+ * @param comp Component to be registered.
+ */
+public void registerExchangeAwareComponent(PartitionsExchangeAware comp) {
+exchangeAwareComps.add(comp);
+}
+
+/**
+ * Removes exchange aware component from list of listeners.
+ *
+ * @param comp Component to be registered.
+ */
+public void unregisterExchangeAwareComponent(PartitionsExchangeAware comp) 
{
+exchangeAwareComps.remove(comp);
+}
+
+/**
+ * @return List of registered exchange listeners.
+ */
+public List exchangeAwareComponents() {
+return U.sealList(exchangeAwareComps);
+}
+
+/**
  * Partition refresh callback for selected cache groups.
  * For coordinator causes {@link GridDhtPartitionsFullMessage 
FullMessages} send,
  * for non coordinator -  {@link GridDhtPartitionsSingleMessage 
SingleMessages} send
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 46636b1..890e28b 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
@@ -884,6 +884,9 @@ public class GridDhtPartitionsExchangeFuture extends 
GridDhtTopologyFutureAdapte
 
 exchangeType = exchange;
 
+for (PartitionsExchangeAware comp : 
cctx.exchange().exchangeAwareComponents())
+comp.onInitBeforeTopologyLock(this);
+
 updateTopologies(crdNode);
 
 timeBag.finishGlobalStage("Determine exchange type");
@@ -931,6 +934,9 @@ public class GridDhtPartitio

[ignite] branch ignite-2.8 updated: IGNITE-12531 Cluster is unable to change BLT on 2.8 if storage was initially created on 2.7 or less - Fixes #7265.

2020-01-17 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch ignite-2.8
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-2.8 by this push:
 new 6892c66  IGNITE-12531 Cluster is unable to change BLT on 2.8 if 
storage was initially created on 2.7 or less - Fixes #7265.
6892c66 is described below

commit 6892c6639487211aadb1ea47893a017b636d6f9d
Author: Slava Koptilin 
AuthorDate: Fri Jan 17 18:31:41 2020 +0300

IGNITE-12531 Cluster is unable to change BLT on 2.8 if storage was 
initially created on 2.7 or less - Fixes #7265.

Signed-off-by: Ivan Rakov 
(cherry picked from commit e31b5300363e2c6a5f51374b8ba4bf6552fd2406)
Signed-off-by: Ivan Rakov 
---
 .../IgnitePKIndexesMigrationToUnwrapPkTest.java|   1 -
 .../persistence/MetaStorageCompatibilityTest.java  | 348 +
 .../IgniteCompatibilityBasicTestSuite.java |   6 +-
 .../cache/persistence/metastorage/MetaStorage.java |  46 ++-
 .../metastorage/IgniteMetaStorageBasicTest.java|   4 +-
 5 files changed, 386 insertions(+), 19 deletions(-)

diff --git 
a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePKIndexesMigrationToUnwrapPkTest.java
 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePKIndexesMigrationToUnwrapPkTest.java
index ed83ecd..3345d7b 100644
--- 
a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePKIndexesMigrationToUnwrapPkTest.java
+++ 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePKIndexesMigrationToUnwrapPkTest.java
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git 
a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MetaStorageCompatibilityTest.java
 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MetaStorageCompatibilityTest.java
new file mode 100644
index 000..0933808
--- /dev/null
+++ 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MetaStorageCompatibilityTest.java
@@ -0,0 +1,348 @@
+/*
+ * 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.compatibility.persistence;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.OpenOption;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+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.IgnitionEx;
+import 
org.apache.ignite.internal.processors.cache.GridCacheAbstractFullApiSelfTest;
+import 
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
+import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.FileIODecorator;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIOFactory;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+/**
+ * Tests migration of metastorage.
+ */
+public class MetaStorageCompatibilityTest extends 
IgnitePersistenceCompatibilityAbstractTest {
+/** Consistent id. */
+private static final String CONSISTENT_ID_1 = "node1";
+
+/** Consistent id. */
+private static final String CONSISTENT_ID_2 = "node2";
+
+/** Ignite version. */
+private static final String IGNITE_VERSION = "2.4.0";
+

[ignite] 02/02: IGNITE-12531 Cluster is unable to change BLT on 2.8 if storage was initially created on 2.7 or less - Fixes #7265.

2020-01-17 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit e31b5300363e2c6a5f51374b8ba4bf6552fd2406
Author: Slava Koptilin 
AuthorDate: Fri Jan 17 18:14:07 2020 +0300

IGNITE-12531 Cluster is unable to change BLT on 2.8 if storage was 
initially created on 2.7 or less - Fixes #7265.

Signed-off-by: Ivan Rakov 
---
 .../IgnitePKIndexesMigrationToUnwrapPkTest.java|   1 -
 .../persistence/MetaStorageCompatibilityTest.java  | 348 +
 .../IgniteCompatibilityBasicTestSuite.java |   6 +-
 .../cache/persistence/metastorage/MetaStorage.java |  46 ++-
 .../metastorage/IgniteMetaStorageBasicTest.java|   4 +-
 5 files changed, 386 insertions(+), 19 deletions(-)

diff --git 
a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePKIndexesMigrationToUnwrapPkTest.java
 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePKIndexesMigrationToUnwrapPkTest.java
index ed83ecd..3345d7b 100644
--- 
a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePKIndexesMigrationToUnwrapPkTest.java
+++ 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/IgnitePKIndexesMigrationToUnwrapPkTest.java
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
diff --git 
a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MetaStorageCompatibilityTest.java
 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MetaStorageCompatibilityTest.java
new file mode 100644
index 000..0933808
--- /dev/null
+++ 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MetaStorageCompatibilityTest.java
@@ -0,0 +1,348 @@
+/*
+ * 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.compatibility.persistence;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.OpenOption;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+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.IgnitionEx;
+import 
org.apache.ignite.internal.processors.cache.GridCacheAbstractFullApiSelfTest;
+import 
org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
+import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.FileIODecorator;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory;
+import 
org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIOFactory;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.jetbrains.annotations.Nullable;
+import org.junit.Test;
+
+/**
+ * Tests migration of metastorage.
+ */
+public class MetaStorageCompatibilityTest extends 
IgnitePersistenceCompatibilityAbstractTest {
+/** Consistent id. */
+private static final String CONSISTENT_ID_1 = "node1";
+
+/** Consistent id. */
+private static final String CONSISTENT_ID_2 = "node2";
+
+/** Ignite version. */
+private static final String IGNITE_VERSION = "2.4.0";
+
+/** Filename of index. */
+private static final String INDEX_BIN_FILE = "index.bin";
+
+/** Filename of partition. */
+private static final String PART_FILE = "part-0.bin";
+
+/**
+ * The zero partition hasn't full baseline information. The last changes 
are read from WAL.
+ *
+  

[ignite] branch master updated (f0b88f6 -> e31b530)

2020-01-17 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git.


from f0b88f6  IGNITE-12535: Pass custom CipherSuites to JDBC thin client. 
(#7252)
 new 1fbc284  IGNITE-12101 Fixed NullPointerException when 
IgniteQueue.removeAll is called. - Fixes #7266.
 new e31b530  IGNITE-12531 Cluster is unable to change BLT on 2.8 if 
storage was initially created on 2.7 or less - Fixes #7265.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../IgnitePKIndexesMigrationToUnwrapPkTest.java|   1 -
 .../persistence/MetaStorageCompatibilityTest.java  | 348 +
 .../IgniteCompatibilityBasicTestSuite.java |   6 +-
 .../cache/persistence/metastorage/MetaStorage.java |  46 ++-
 .../datastructures/GridCacheQueueAdapter.java  |   4 +-
 .../metastorage/IgniteMetaStorageBasicTest.java|   4 +-
 .../GridCacheReplicatedQueueRemoveSelfTest.java| 144 +
 .../IgniteCacheDataStructuresSelfTestSuite.java|   2 +
 8 files changed, 534 insertions(+), 21 deletions(-)
 create mode 100644 
modules/compatibility/src/test/java/org/apache/ignite/compatibility/persistence/MetaStorageCompatibilityTest.java
 create mode 100644 
modules/core/src/test/java/org/apache/ignite/internal/processors/datastructures/GridCacheReplicatedQueueRemoveSelfTest.java



[ignite] 01/02: IGNITE-12101 Fixed NullPointerException when IgniteQueue.removeAll is called. - Fixes #7266.

2020-01-17 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 1fbc284fd0c89e6aaedf76bd2df3581cf85a1811
Author: Slava Koptilin 
AuthorDate: Fri Jan 17 16:46:56 2020 +0300

IGNITE-12101 Fixed NullPointerException when IgniteQueue.removeAll is 
called. - Fixes #7266.

Signed-off-by: Ivan Rakov 
---
 .../datastructures/GridCacheQueueAdapter.java  |   4 +-
 .../GridCacheReplicatedQueueRemoveSelfTest.java| 144 +
 .../IgniteCacheDataStructuresSelfTestSuite.java|   2 +
 3 files changed, 148 insertions(+), 2 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
index daf7b04..e7bde03 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
@@ -1045,13 +1045,13 @@ public abstract class GridCacheQueueAdapter extends 
AbstractCollection imp
 /** {@inheritDoc} */
 @Override public void writeExternal(ObjectOutput out) throws 
IOException {
 U.writeGridUuid(out, id);
-out.writeLong(idx);
+out.writeObject(idx);
 }
 
 /** {@inheritDoc} */
 @Override public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
 id = U.readGridUuid(in);
-idx = in.readLong();
+idx = (Long)in.readObject();
 }
 }
 
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastructures/GridCacheReplicatedQueueRemoveSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastructures/GridCacheReplicatedQueueRemoveSelfTest.java
new file mode 100644
index 000..1541510
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastructures/GridCacheReplicatedQueueRemoveSelfTest.java
@@ -0,0 +1,144 @@
+/*
+ * 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.datastructures;
+
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ThreadLocalRandom;
+import org.apache.ignite.IgniteQueue;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.CollectionConfiguration;
+import org.apache.ignite.internal.processors.cache.CacheInvokeEntry;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl;
+import 
org.apache.ignite.internal.processors.cache.datastructures.IgniteCollectionAbstractTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry;
+import org.apache.ignite.internal.util.io.GridByteArrayInputStream;
+import org.apache.ignite.internal.util.io.GridByteArrayOutputStream;
+import org.apache.ignite.lang.IgniteUuid;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.junit.Test;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+
+/**
+ * Tests for Ignite Queue remove method.
+ */
+public class GridCacheReplicatedQueueRemoveSelfTest extends 
IgniteCollectionAbstractTest {
+/** */
+public static final int CACHE_SIZE = 1_000;
+
+/** */
+public static final int THREADS_CNT = 8;
+
+/** {@inheritDoc} */
+@Override protected int gridCount() {
+return 2;
+}
+
+/** {@inheritDoc} */
+@Override protected CacheMode collectionCacheMode() {
+return REPLICATED;
+}
+
+/** {@inheritDoc} */
+@Override protected CacheAtomicityMode collectionCacheAtomicityMode

[ignite] branch master updated: IGNITE-12101 Fixed NullPointerException when IgniteQueue.removeAll is called. - Fixes #7266.

2020-01-17 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 305e8a0  IGNITE-12101 Fixed NullPointerException when 
IgniteQueue.removeAll is called. - Fixes #7266.
305e8a0 is described below

commit 305e8a0c7797c2ce51ff55bc7396870aae182da3
Author: Slava Koptilin 
AuthorDate: Fri Jan 17 16:46:56 2020 +0300

IGNITE-12101 Fixed NullPointerException when IgniteQueue.removeAll is 
called. - Fixes #7266.

Signed-off-by: Ivan Rakov 
---
 .../datastructures/GridCacheQueueAdapter.java  |   4 +-
 .../GridCacheReplicatedQueueRemoveSelfTest.java| 144 +
 .../IgniteCacheDataStructuresSelfTestSuite.java|   2 +
 3 files changed, 148 insertions(+), 2 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
index daf7b04..e7bde03 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueAdapter.java
@@ -1045,13 +1045,13 @@ public abstract class GridCacheQueueAdapter extends 
AbstractCollection imp
 /** {@inheritDoc} */
 @Override public void writeExternal(ObjectOutput out) throws 
IOException {
 U.writeGridUuid(out, id);
-out.writeLong(idx);
+out.writeObject(idx);
 }
 
 /** {@inheritDoc} */
 @Override public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException {
 id = U.readGridUuid(in);
-idx = in.readLong();
+idx = (Long)in.readObject();
 }
 }
 
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastructures/GridCacheReplicatedQueueRemoveSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastructures/GridCacheReplicatedQueueRemoveSelfTest.java
new file mode 100644
index 000..1541510
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastructures/GridCacheReplicatedQueueRemoveSelfTest.java
@@ -0,0 +1,144 @@
+/*
+ * 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.datastructures;
+
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ThreadLocalRandom;
+import org.apache.ignite.IgniteQueue;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.CollectionConfiguration;
+import org.apache.ignite.internal.processors.cache.CacheInvokeEntry;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl;
+import 
org.apache.ignite.internal.processors.cache.datastructures.IgniteCollectionAbstractTest;
+import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry;
+import org.apache.ignite.internal.util.io.GridByteArrayInputStream;
+import org.apache.ignite.internal.util.io.GridByteArrayOutputStream;
+import org.apache.ignite.lang.IgniteUuid;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.junit.Test;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
+
+/**
+ * Tests for Ignite Queue remove method.
+ */
+public class GridCacheReplicatedQueueRemoveSelfTest extends 
IgniteCollectionAbstractTest {
+/** */
+public static final int CACHE_SIZE = 1_000;
+
+/** */
+public static final int THREADS_CNT = 8;
+
+/** {@inheritDoc} */
+@Override protected int gridCount() {
+return 2;
+}
+
+

[ignite] branch master updated: IGNITE-12440 Sensitive data leak in partition release future messages - Fixes #7195.

2019-12-26 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 7af9887  IGNITE-12440 Sensitive data leak in partition release future 
messages - Fixes #7195.
7af9887 is described below

commit 7af988791dfd77de5679b87aac31ce99d45fcd05
Author: Kirill Tkalenko 
AuthorDate: Thu Dec 26 12:05:59 2019 +0300

IGNITE-12440 Sensitive data leak in partition release future messages - 
Fixes #7195.

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/internal/IgniteKernal.java   |   4 +-
 .../internal/binary/BinaryClassDescriptor.java |   4 +-
 .../internal/binary/BinaryEnumObjectImpl.java  |   2 +-
 .../internal/binary/BinaryFieldAccessor.java   |   4 +-
 .../ignite/internal/binary/BinaryObjectExImpl.java |   4 +-
 .../ignite/internal/binary/BinaryReaderExImpl.java |   2 +-
 .../managers/checkpoint/GridCheckpointManager.java |   4 +-
 .../processors/cache/CacheObjectAdapter.java   |   2 +-
 .../processors/cache/GridCacheMapEntry.java|   4 +-
 .../processors/cache/KeyCacheObjectImpl.java   |   2 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java|   4 +-
 .../cache/store/GridCacheStoreManagerAdapter.java  |   2 +-
 .../cache/store/GridCacheWriteBehindStore.java |   4 +-
 .../processors/cache/transactions/IgniteTxKey.java |   2 +-
 .../processors/cache/transactions/TxDeadlock.java  |   2 +-
 .../cache/transactions/TxEntryValueHolder.java |   8 +-
 .../platform/PlatformNativeException.java  |   2 +-
 .../util/tostring/GridToStringBuilder.java |  64 +++-
 .../GridCacheBinaryObjectsAbstractSelfTest.java|   2 +-
 .../util/tostring/GridToStringBuilderSelfTest.java |   4 +-
 .../tostring/TransactionSensitiveDataTest.java | 343 +
 .../testframework/junits/GridAbstractTest.java |  24 +-
 .../ignite/testsuites/IgniteUtilSelfTestSuite.java |   2 +
 .../processors/query/h2/dml/UpdatePlanBuilder.java |   4 +-
 .../processors/query/h2/opt/H2CacheRow.java|   4 +-
 .../index/H2TreeCorruptedTreeExceptionTest.java|  74 ++---
 26 files changed, 493 insertions(+), 84 deletions(-)

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 067ff4e..65f2c90 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
@@ -2780,7 +2780,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 private void ackSystemProperties() {
 assert log != null;
 
-if (log.isDebugEnabled() && S.INCLUDE_SENSITIVE)
+if (log.isDebugEnabled() && S.includeSensitive())
 for (Map.Entry entry : snapshot().entrySet())
 log.debug("System property [" + entry.getKey() + '=' + 
entry.getValue() + ']');
 }
@@ -3003,7 +3003,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 assert log != null;
 
 // Ack IGNITE_HOME and VM arguments.
-if (log.isInfoEnabled() && S.INCLUDE_SENSITIVE) {
+if (log.isInfoEnabled() && S.includeSensitive()) {
 log.info("IGNITE_HOME=" + cfg.getIgniteHome());
 log.info("VM arguments: " + rtBean.getInputArguments());
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
index b4fd932..4ae17cf 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
@@ -829,7 +829,7 @@ public class BinaryClassDescriptor {
 catch (Exception e) {
 String msg;
 
-if (S.INCLUDE_SENSITIVE && !F.isEmpty(typeName))
+if (S.includeSensitive() && !F.isEmpty(typeName))
 msg = "Failed to serialize object [typeName=" + typeName + ']';
 else
 msg = "Failed to serialize object [typeId=" + typeId + ']';
@@ -903,7 +903,7 @@ public class BinaryClassDescriptor {
 catch (Exception e) {
 String msg;
 
-if (S.INCLUDE_SENSITIVE && !F.isEmpty(typeName))
+if (S.includeSensitive() && !F.isEmpty(typeName))
 msg = "Failed to deserialize object [typeName=" + typeName + 
']';
 else
 msg = "Failed to deserialize object [typeId=" + typeId + ']';
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumOb

[ignite] branch master updated: IGNITE-12465 Extend test coverage [IGNITE-11995] - Fixes #7158.

2019-12-25 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 44240bc  IGNITE-12465 Extend test coverage [IGNITE-11995] - Fixes 
#7158.
44240bc is described below

commit 44240bc39f5cfa5ca74ca5c65ac64208d35468e5
Author: Kirill Tkalenko 
AuthorDate: Wed Dec 25 10:08:08 2019 +0300

IGNITE-12465 Extend test coverage [IGNITE-11995] - Fixes #7158.

Signed-off-by: Ivan Rakov 
---
 .../ignite/internal/commandline/Command.java   |  20 
 .../ignite/internal/commandline/WalCommands.java   |  15 +--
 .../util/GridCommandHandlerClusterByClassTest.java | 122 ++---
 3 files changed, 133 insertions(+), 24 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/Command.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/Command.java
index 6f033a2..eae71e6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/Command.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/Command.java
@@ -18,10 +18,12 @@
 package org.apache.ignite.internal.commandline;
 
 import java.util.logging.Logger;
+import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.internal.client.GridClient;
 import org.apache.ignite.internal.client.GridClientConfiguration;
 import org.apache.ignite.internal.client.GridClientFactory;
 
+import static 
org.apache.ignite.IgniteSystemProperties.IGNITE_ENABLE_EXPERIMENTAL_COMMAND;
 import static 
org.apache.ignite.internal.commandline.CommandHandler.UTILITY_NAME;
 import static 
org.apache.ignite.internal.commandline.CommandLogger.DOUBLE_INDENT;
 import static org.apache.ignite.internal.commandline.CommandLogger.INDENT;
@@ -115,4 +117,22 @@ public interface Command {
  * @return command name.
  */
 String name();
+
+/**
+ * @return Value of {@link 
IgniteSystemProperties#IGNITE_ENABLE_EXPERIMENTAL_COMMAND}
+ */
+default boolean experimentalEnabled() {
+return 
IgniteSystemProperties.getBoolean(IGNITE_ENABLE_EXPERIMENTAL_COMMAND, false);
+}
+
+/**
+ * Return {@code true} if the command is experimental or {@code false}
+ * otherwise.
+ *
+ * @return {@code true} if the command is experimental or {@code false}
+ *  otherwise.
+ */
+default boolean experimental() {
+return false;
+}
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/WalCommands.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/WalCommands.java
index 2960b36..99ef018 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/commandline/WalCommands.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/commandline/WalCommands.java
@@ -22,7 +22,6 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Logger;
-import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.internal.client.GridClient;
 import org.apache.ignite.internal.client.GridClientConfiguration;
 import org.apache.ignite.internal.util.typedef.F;
@@ -69,7 +68,7 @@ public class WalCommands implements Command> {
 
 /** {@inheritDoc} */
 @Override public void printUsage(Logger logger) {
-if (!enableExperimental())
+if (!experimentalEnabled())
 return;
 
 Command.usage(logger, "Print absolute paths of unused archived wal 
segments on each node:", WAL,
@@ -85,7 +84,7 @@ public class WalCommands implements Command> {
  * @throws Exception If failed to execute wal action.
  */
 @Override public Object execute(GridClientConfiguration clientCfg, Logger 
logger) throws Exception {
-if (enableExperimental()) {
+if (experimentalEnabled()) {
 this.logger = logger;
 
 try (GridClient client = Command.startClient(clientCfg)) {
@@ -129,7 +128,7 @@ public class WalCommands implements Command> {
 ? argIter.nextArg("Unexpected argument for " + WAL.text() + ": 
" + walAct)
 : "";
 
-if (enableExperimental()) {
+if (experimentalEnabled()) {
 this.walAct = walAct;
 this.walArgs = walArgs;
 }
@@ -276,10 +275,8 @@ public class WalCommands implements Command> {
 return WAL.toCommandName();
 }
 
-/**
- * @return Value of {@link 
IgniteSystemProperties#IGNITE_ENABLE_EXPERIMENTAL_COMMAND}
- */
-private boolean enableExperimental() {
-return 
IgniteSystemProperties.getBoolean(IGNITE_ENABLE_EXPERIMENTAL_COMMAND, false);
+/** {@inheritDoc} */
+@Override public boolean experimental() {
+return true;
 }
 }
diff --git 

[ignite] branch master updated: IGNITE-12440 Sensitive data leak in partition release future messages - Fixes #7132.

2019-12-24 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 4aa8851  IGNITE-12440 Sensitive data leak in partition release future 
messages - Fixes #7132.
4aa8851 is described below

commit 4aa88516018bebf23bfde82ffafe804e53e35b3c
Author: Kirill Tkalenko 
AuthorDate: Tue Dec 24 23:35:27 2019 +0300

IGNITE-12440 Sensitive data leak in partition release future messages - 
Fixes #7132.

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/internal/IgniteKernal.java   |   4 +-
 .../internal/binary/BinaryClassDescriptor.java |   4 +-
 .../internal/binary/BinaryEnumObjectImpl.java  |   2 +-
 .../internal/binary/BinaryFieldAccessor.java   |   4 +-
 .../ignite/internal/binary/BinaryObjectExImpl.java |   4 +-
 .../ignite/internal/binary/BinaryReaderExImpl.java |   2 +-
 .../managers/checkpoint/GridCheckpointManager.java |   4 +-
 .../processors/cache/CacheObjectAdapter.java   |   2 +-
 .../processors/cache/GridCacheMapEntry.java|   4 +-
 .../processors/cache/KeyCacheObjectImpl.java   |   2 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java|   4 +-
 .../cache/store/GridCacheStoreManagerAdapter.java  |   2 +-
 .../cache/store/GridCacheWriteBehindStore.java |   3 +-
 .../processors/cache/transactions/IgniteTxKey.java |   2 +-
 .../processors/cache/transactions/TxDeadlock.java  |   2 +-
 .../cache/transactions/TxEntryValueHolder.java |   8 +-
 .../platform/PlatformNativeException.java  |   2 +-
 .../util/tostring/GridToStringBuilder.java |  64 +++-
 .../GridCacheBinaryObjectsAbstractSelfTest.java|   2 +-
 .../util/tostring/GridToStringBuilderSelfTest.java |   4 +-
 .../tostring/TransactionSensitiveDataTest.java | 349 +
 .../testframework/junits/GridAbstractTest.java |  24 +-
 .../ignite/testsuites/IgniteUtilSelfTestSuite.java |   2 +
 .../processors/query/h2/dml/UpdatePlanBuilder.java |   4 +-
 24 files changed, 462 insertions(+), 42 deletions(-)

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 0096190..081a6f4 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
@@ -2768,7 +2768,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 private void ackSystemProperties() {
 assert log != null;
 
-if (log.isDebugEnabled() && S.INCLUDE_SENSITIVE)
+if (log.isDebugEnabled() && S.includeSensitive())
 for (Map.Entry entry : snapshot().entrySet())
 log.debug("System property [" + entry.getKey() + '=' + 
entry.getValue() + ']');
 }
@@ -2991,7 +2991,7 @@ public class IgniteKernal implements IgniteEx, 
IgniteMXBean, Externalizable {
 assert log != null;
 
 // Ack IGNITE_HOME and VM arguments.
-if (log.isInfoEnabled() && S.INCLUDE_SENSITIVE) {
+if (log.isInfoEnabled() && S.includeSensitive()) {
 log.info("IGNITE_HOME=" + cfg.getIgniteHome());
 log.info("VM arguments: " + rtBean.getInputArguments());
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
index b4fd932..4ae17cf 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
@@ -829,7 +829,7 @@ public class BinaryClassDescriptor {
 catch (Exception e) {
 String msg;
 
-if (S.INCLUDE_SENSITIVE && !F.isEmpty(typeName))
+if (S.includeSensitive() && !F.isEmpty(typeName))
 msg = "Failed to serialize object [typeName=" + typeName + ']';
 else
 msg = "Failed to serialize object [typeId=" + typeId + ']';
@@ -903,7 +903,7 @@ public class BinaryClassDescriptor {
 catch (Exception e) {
 String msg;
 
-if (S.INCLUDE_SENSITIVE && !F.isEmpty(typeName))
+if (S.includeSensitive() && !F.isEmpty(typeName))
 msg = "Failed to deserialize object [typeName=" + typeName + 
']';
 else
 msg = "Failed to deserialize object [typeId=" + typeId + ']';
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
index dd99787..02b

[ignite] branch master updated: IGNITE-12434 Dump checkpoint readLock holder threads if writeLock can`t take lock more than threshold timeout. - Fixes #7124.

2019-12-17 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new a09d128  IGNITE-12434 Dump checkpoint readLock holder threads if 
writeLock can`t take lock more than threshold timeout. - Fixes #7124.
a09d128 is described below

commit a09d1284a8f5cbaae7a8548af6c32ca422810035
Author: zstan 
AuthorDate: Tue Dec 17 16:09:21 2019 +0300

IGNITE-12434 Dump checkpoint readLock holder threads if writeLock can`t 
take lock more than threshold timeout. - Fixes #7124.

Signed-off-by: Ivan Rakov 
---
 .../GridCacheDatabaseSharedManager.java|  11 +-
 .../apache/ignite/internal/util/IgniteUtils.java   | 188 +++--
 .../persistence/CheckpointReadLockFailureTest.java | 144 +++-
 3 files changed, 250 insertions(+), 93 deletions(-)

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 2eeb330..a89919b 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
@@ -226,6 +226,9 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 /** */
 public static final String IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP = 
"IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP";
 
+/** Log read lock holders. */
+public static final String IGNITE_PDS_LOG_CP_READ_LOCK_HOLDERS = 
"IGNITE_PDS_LOG_CP_READ_LOCK_HOLDERS";
+
 /** MemoryPolicyConfiguration name reserved for meta store. */
 public static final String METASTORE_DATA_REGION_NAME = "metastoreMemPlc";
 
@@ -242,6 +245,9 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 /** */
 private final boolean skipCheckpointOnNodeStop = 
getBoolean(IGNITE_PDS_SKIP_CHECKPOINT_ON_NODE_STOP, false);
 
+/** */
+private final boolean logReadLockHolders = 
getBoolean(IGNITE_PDS_LOG_CP_READ_LOCK_HOLDERS);
+
 /**
  * Starting from this number of dirty pages in checkpoint, array will be 
sorted with
  * {@link Arrays#parallelSort(Comparable[])} in case of {@link 
CheckpointWriteOrder#SEQUENTIAL}.
@@ -297,7 +303,7 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 /** For testing only. */
 private volatile GridFutureAdapter enableChangeApplied;
 
-/** */
+/** Checkpont lock. */
 ReentrantReadWriteLock checkpointLock = new ReentrantReadWriteLock();
 
 /** */
@@ -544,6 +550,9 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 
 final GridKernalContext kernalCtx = cctx.kernalContext();
 
+if (logReadLockHolders)
+checkpointLock = new 
U.ReentrantReadWriteLockTracer(checkpointLock, kernalCtx, 5_000);
+
 if (!kernalCtx.clientNode()) {
 
kernalCtx.internalSubscriptionProcessor().registerDatabaseListener(new 
MetastorageRecoveryLifecycle());
 
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 34ef7be..1b51d45 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
@@ -136,9 +136,9 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.function.Consumer;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.jar.JarFile;
 import java.util.logging.ConsoleHandler;
 import java.util.logging.Handler;
@@ -234,6 +234,7 @@ import org.apache.ignite.internal.util.typedef.CI1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.internal.util.typedef.P1;
+import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.X;
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.SB;
@@ -339,6 +340,9 @@ public abstract class IgniteUtils {
 /** Default user version. */
 public static final String DFLT_USER_VERSION = "0";
 
+/** Lock hold message. */
+public static final String LOCK_HOLD_MESSAGE = "ReadLock held the l

[ignite] branch ignite-2.8 updated: IGNITE-12409 Destroying a cache during cache load may lead to a hang - Fixes #7092.

2019-12-10 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch ignite-2.8
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-2.8 by this push:
 new 0aaf490  IGNITE-12409 Destroying a cache during cache load may lead to 
a hang - Fixes #7092.
0aaf490 is described below

commit 0aaf490ba00db0870753431a276ca6551db81ed9
Author: sk0x50 
AuthorDate: Tue Dec 10 15:33:29 2019 +0300

IGNITE-12409 Destroying a cache during cache load may lead to a hang - 
Fixes #7092.

(cherry picked from commit 98883f151a36134ce6efc0bdf65c899505bf730a)
Signed-off-by: Ivan Rakov 
---
 .../cache/GridCachePartitionExchangeManager.java   |   4 +-
 .../processors/datastreamer/DataStreamerImpl.java  |  20 +-
 .../datastreamer/DataStreamerStopCacheTest.java| 213 +
 .../ignite/testsuites/IgniteCacheTestSuite.java|   2 +
 4 files changed, 234 insertions(+), 5 deletions(-)

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 dd28286..0f9fba1 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
@@ -160,11 +160,11 @@ import static 
org.apache.ignite.internal.processors.affinity.AffinityTopologyVer
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionPartialCountersMap.PARTIAL_COUNTERS_MAP_SINCE;
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.nextDumpTimeout;
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader.DFLT_PRELOAD_RESEND_TIMEOUT;
-import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_OPS_BLOCKED_DURATION;
 import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_DURATION;
-import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_OPS_BLOCKED_DURATION_HISTOGRAM;
 import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_DURATION_HISTOGRAM;
 import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_METRICS;
+import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_OPS_BLOCKED_DURATION;
+import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_OPS_BLOCKED_DURATION_HISTOGRAM;
 
 /**
  * Partition exchange manager.
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index ccb0f1f..cdf15f7 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -65,9 +65,9 @@ import 
org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.IgniteNodeAttributes;
+import org.apache.ignite.internal.cluster.ClusterReadOnlyModeCheckedException;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
 import 
org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
-import org.apache.ignite.internal.cluster.ClusterReadOnlyModeCheckedException;
 import org.apache.ignite.internal.managers.communication.GridIoMessage;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.deployment.GridDeployment;
@@ -76,7 +76,9 @@ import 
org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.affinity.GridAffinityProcessor;
 import org.apache.ignite.internal.processors.cache.CacheObject;
 import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.processors.cache.CacheStoppedException;
 import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
+import org.apache.ignite.internal.processors.cache.ExchangeActions;
 import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
@@ -87,6 +89,7 @@ import 
org.apache.ignite.internal.processors.cache.IgniteCacheFutureImpl;
 import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
 import

[ignite] branch master updated: IGNITE-12365 Concurrent removeAll() on the same cache leads to deadlock - Fixes #7111.

2019-12-10 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new b694fd1  IGNITE-12365 Concurrent removeAll() on the same cache leads 
to deadlock - Fixes #7111.
b694fd1 is described below

commit b694fd103354d827800b3e830ad5619bd27574b0
Author: Mirza Aliev 
AuthorDate: Tue Dec 10 15:22:09 2019 +0300

IGNITE-12365 Concurrent removeAll() on the same cache leads to deadlock - 
Fixes #7111.

Signed-off-by: Ivan Rakov 
---
 .../processors/cache/GridCacheContext.java |  13 +++
 .../distributed/GridDistributedCacheAdapter.java   | 106 -
 .../apache/ignite/cache/RemoveAllDeadlockTest.java |  95 ++
 .../ignite/testsuites/IgniteReproducingSuite.java  |   5 +-
 4 files changed, 193 insertions(+), 26 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 9ddafb2..e2227e0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -35,6 +35,7 @@ import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.atomic.AtomicReference;
 import javax.cache.Cache;
 import javax.cache.configuration.Factory;
 import javax.cache.expiry.EternalExpiryPolicy;
@@ -53,6 +54,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.events.EventType;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.IgnitionEx;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
@@ -63,6 +65,7 @@ import 
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
 import 
org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import 
org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager;
+import 
org.apache.ignite.internal.processors.cache.distributed.GridDistributedCacheAdapter;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheEntry;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopologyFuture;
@@ -282,6 +285,9 @@ public class GridCacheContext implements 
Externalizable {
 private final boolean disableTriggeringCacheInterceptorOnConflict =
 
Boolean.parseBoolean(System.getProperty(IGNITE_DISABLE_TRIGGERING_CACHE_INTERCEPTOR_ON_CONFLICT,
 "false"));
 
+/** Last remove all job future. */
+private AtomicReference> lastRmvAllJobFut = 
new AtomicReference<>();
+
 /**
  * Empty constructor required for {@link Externalizable}.
  */
@@ -2339,6 +2345,13 @@ public class GridCacheContext implements 
Externalizable {
 contQryMgr.notifyContinuousQueries(tx) && 
!F.isEmpty(contQryMgr.updateListeners(false, false));
 }
 
+/**
+ * Returns future that assigned to last performing {@link 
GridDistributedCacheAdapter.GlobalRemoveAllJob}
+ */
+public AtomicReference> 
lastRemoveAllJobFut() {
+return lastRmvAllJobFut;
+}
+
 /** {@inheritDoc} */
 @Override public void writeExternal(ObjectOutput out) throws IOException {
 U.writeString(out, igniteInstanceName());
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
index ce9e71e..a3afa85 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
@@ -22,6 +22,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.cache.CachePeekMode;
@@ -31,8 +32,8 @@ import org.apache.ignite.compute.ComputeJob;
 import org.apache.ignite.compute.ComputeJobResult;
 import org.apache.ignite.compute.C

[ignite] branch master updated: IGNITE-12409 Destroying a cache during cache load may lead to a hang - Fixes #7092.

2019-12-05 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 98883f1  IGNITE-12409 Destroying a cache during cache load may lead to 
a hang - Fixes #7092.
98883f1 is described below

commit 98883f151a36134ce6efc0bdf65c899505bf730a
Author: sk0x50 
AuthorDate: Thu Dec 5 16:12:53 2019 +0300

IGNITE-12409 Destroying a cache during cache load may lead to a hang - 
Fixes #7092.

Signed-off-by: Ivan Rakov 
---
 .../cache/GridCachePartitionExchangeManager.java   |   4 +-
 .../processors/datastreamer/DataStreamerImpl.java  |  20 +-
 .../datastreamer/DataStreamerStopCacheTest.java| 213 +
 .../ignite/testsuites/IgniteCacheTestSuite.java|   2 +
 4 files changed, 234 insertions(+), 5 deletions(-)

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 dd28286..0f9fba1 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
@@ -160,11 +160,11 @@ import static 
org.apache.ignite.internal.processors.affinity.AffinityTopologyVer
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionPartialCountersMap.PARTIAL_COUNTERS_MAP_SINCE;
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.nextDumpTimeout;
 import static 
org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader.DFLT_PRELOAD_RESEND_TIMEOUT;
-import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_OPS_BLOCKED_DURATION;
 import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_DURATION;
-import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_OPS_BLOCKED_DURATION_HISTOGRAM;
 import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_DURATION_HISTOGRAM;
 import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_METRICS;
+import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_OPS_BLOCKED_DURATION;
+import static 
org.apache.ignite.internal.processors.metric.GridMetricManager.PME_OPS_BLOCKED_DURATION_HISTOGRAM;
 
 /**
  * Partition exchange manager.
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index ccb0f1f..cdf15f7 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -65,9 +65,9 @@ import 
org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.IgniteNodeAttributes;
+import org.apache.ignite.internal.cluster.ClusterReadOnlyModeCheckedException;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
 import 
org.apache.ignite.internal.cluster.ClusterTopologyServerNotFoundException;
-import org.apache.ignite.internal.cluster.ClusterReadOnlyModeCheckedException;
 import org.apache.ignite.internal.managers.communication.GridIoMessage;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.deployment.GridDeployment;
@@ -76,7 +76,9 @@ import 
org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.affinity.GridAffinityProcessor;
 import org.apache.ignite.internal.processors.cache.CacheObject;
 import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.processors.cache.CacheStoppedException;
 import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
+import org.apache.ignite.internal.processors.cache.ExchangeActions;
 import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheEntryEx;
@@ -87,6 +89,7 @@ import 
org.apache.ignite.internal.processors.cache.IgniteCacheFutureImpl;
 import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import

[ignite] branch master updated: IGNITE-12340 Extend test coverage of ability to track system/user time held in transaction - Fixes #7027.

2019-11-28 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new c28cefb  IGNITE-12340 Extend test coverage of ability to track 
system/user time held in transaction - Fixes #7027.
c28cefb is described below

commit c28cefbdbf6e382ebf41bbdcd88eac6697db48a2
Author: Kirill Tkalenko 
AuthorDate: Thu Nov 28 21:20:51 2019 +0300

IGNITE-12340 Extend test coverage of ability to track system/user time held 
in transaction - Fixes #7027.

Signed-off-by: Ivan Rakov 
---
 .../GridTransactionsSystemUserTimeMetricsTest.java | 724 ++---
 1 file changed, 629 insertions(+), 95 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridTransactionsSystemUserTimeMetricsTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridTransactionsSystemUserTimeMetricsTest.java
index 2355f72..f6d03d5 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridTransactionsSystemUserTimeMetricsTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridTransactionsSystemUserTimeMetricsTest.java
@@ -16,9 +16,17 @@
  */
 package org.apache.ignite.internal.processors.cache;
 
+import java.util.LinkedList;
+import java.util.List;
 import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.LongStream;
+import javax.management.AttributeNotFoundException;
 import javax.management.DynamicMBean;
+import javax.management.MBeanException;
+import javax.management.ReflectionException;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteException;
@@ -28,9 +36,10 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.TransactionsMXBeanImpl;
 import org.apache.ignite.internal.managers.communication.GridIoMessage;
+import 
org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockRequest;
 import 
org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxPrepareRequest;
+import 
org.apache.ignite.internal.processors.cache.mvcc.msg.MvccTxSnapshotRequest;
 import 
org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter;
-import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.mxbean.TransactionsMXBean;
 import org.apache.ignite.plugin.extensions.communication.Message;
@@ -65,7 +74,7 @@ import static 
org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_REA
  *
  */
 @SystemPropertiesList(value = {
-@WithSystemProperty(key = IGNITE_LONG_TRANSACTION_TIME_DUMP_THRESHOLD, 
value = "1000"),
+@WithSystemProperty(key = IGNITE_LONG_TRANSACTION_TIME_DUMP_THRESHOLD, 
value = "999"),
 @WithSystemProperty(key = 
IGNITE_TRANSACTION_TIME_DUMP_SAMPLES_COEFFICIENT, value = "1.0"),
 @WithSystemProperty(key = 
IGNITE_TRANSACTION_TIME_DUMP_SAMPLES_PER_SECOND_LIMIT, value = "5"),
 @WithSystemProperty(key = IGNITE_LONG_OPERATIONS_DUMP_TIMEOUT, value = 
"500")
@@ -87,50 +96,62 @@ public class GridTransactionsSystemUserTimeMetricsTest 
extends GridCommonAbstrac
 private static final long SYSTEM_DELAY = 1000;
 
 /** */
-private static final int TX_COUNT_FOR_LOG_THROTTLING_CHECK = 4;
+private static final long EPSILON = 300;
 
 /** */
-private static final long LONG_TRAN_TIMEOUT = Math.min(SYSTEM_DELAY, 
USER_DELAY);
-
-/** */
-private static final String TRANSACTION_TIME_DUMP_REGEX = ".*?ransaction 
time dump .*";
+private static final String TRANSACTION_TIME_DUMP_REGEX = ".*?ransaction 
time dump .*?totalTime=[0-9]{1,4}, " +
+"systemTime=[0-9]{1,4}, userTime=[0-9]{1,4}, 
cacheOperationsTime=[0-9]{1,4}.*";
 
 /** */
 private static final String ROLLBACK_TIME_DUMP_REGEX =
 ".*?Long transaction time dump 
.*?cacheOperationsTime=[0-9]{1,4}.*?rollbackTime=[0-9]{1,4}.*";
 
 /** */
-private static final String TRANSACTION_TIME_DUMPS_SKIPPED_REGEX =
-"Transaction time dumps skipped because of log throttling: " + 
TX_COUNT_FOR_LOG_THROTTLING_CHECK / 2;
+private LogListener logTxDumpLsnr = new 
MessageOrderLogListener(TRANSACTION_TIME_DUMP_REGEX);
 
 /** */
-private LogListener logTxDumpLsnr = new 
MessageOrderLogListener(TRANSACTION_TIME_DUMP_REGEX);
+private TransactionDumpListener transactionDumpLsnr = new 
TransactionDumpListener(TRANSACTION_TIME_DUMP_REGEX);
 
 /** */
-private final Tr

[ignite] branch master updated: IGNITE-12392 Faster transaction rolled back when one of backup node failed - Fixes #7072.

2019-11-28 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 31506f0  IGNITE-12392 Faster transaction rolled back when one of 
backup node failed - Fixes #7072.
31506f0 is described below

commit 31506f0600c433e8873d3f44590e0c34f91a9122
Author: Kirill Tkalenko 
AuthorDate: Thu Nov 28 21:15:08 2019 +0300

IGNITE-12392 Faster transaction rolled back when one of backup node failed 
- Fixes #7072.

Signed-off-by: Ivan Rakov 
---
 .../distributed/dht/GridDhtTxFinishFuture.java |  27 +-
 .../GridCacheFastNodeLeftForTransactionTest.java   | 394 +
 .../ignite/testsuites/IgniteCacheTestSuite2.java   |   2 +
 3 files changed, 414 insertions(+), 9 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index dc29ebe..00d1588 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -48,6 +48,7 @@ import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;
 
+import static java.util.Objects.isNull;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 import static 
org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
 import static org.apache.ignite.transactions.TransactionState.COMMITTING;
@@ -467,18 +468,26 @@ public final class GridDhtTxFinishFuture extends 
GridCacheCompoundIdentity
 req.writeVersion(tx.writeVersion() != null ? tx.writeVersion() : 
tx.xidVersion());
 
 try {
-cctx.io().send(n, req, tx.ioPolicy());
+if (isNull(cctx.discovery().getAlive(n.id( {
+log.error("Unable to send message (node left topology): " 
+ n);
 
-if (msgLog.isDebugEnabled()) {
-msgLog.debug("DHT finish fut, sent request dht [txId=" + 
tx.nearXidVersion() +
-", dhtTxId=" + tx.xidVersion() +
-", node=" + n.id() + ']');
+fut.onNodeLeft(new ClusterTopologyCheckedException("Node 
left grid while sending message to: "
++ n.id()));
 }
+else {
+cctx.io().send(n, req, tx.ioPolicy());
 
-if (sync)
-res = true;
-else
-fut.onDone();
+if (msgLog.isDebugEnabled()) {
+msgLog.debug("DHT finish fut, sent request dht [txId=" 
+ tx.nearXidVersion() +
+", dhtTxId=" + tx.xidVersion() +
+", node=" + n.id() + ']');
+}
+
+if (sync)
+res = true;
+else
+fut.onDone();
+}
 }
 catch (IgniteCheckedException e) {
 // Fail the whole thing.
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheFastNodeLeftForTransactionTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheFastNodeLeftForTransactionTest.java
new file mode 100644
index 000..6bccbd2
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/local/GridCacheFastNodeLeftForTransactionTest.java
@@ -0,0 +1,394 @@
+/*
+ * 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.local;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStr

[ignite] branch master updated: IGNITE-12329 Invalid handling of remote entries causes partition desync and transaction hanging in COMMITTING state. - Fixes #7018.

2019-10-30 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 7d4bb49  IGNITE-12329 Invalid handling of remote entries causes 
partition desync and transaction hanging in COMMITTING state. - Fixes #7018.
7d4bb49 is described below

commit 7d4bb49264b2e907c2be0714d72c63ad269fcee4
Author: Alexey Scherbakov 
AuthorDate: Wed Oct 30 21:16:01 2019 +0300

IGNITE-12329 Invalid handling of remote entries causes partition desync and 
transaction hanging in COMMITTING state. - Fixes #7018.

Signed-off-by: Ivan Rakov 
---
 .../processors/cache/GridCacheMapEntry.java|  20 +-
 .../internal/processors/cache/GridCacheMvcc.java   |   3 +-
 .../distributed/GridDistributedCacheEntry.java |  19 +-
 .../GridDistributedTxRemoteAdapter.java|  47 +--
 .../cache/distributed/dht/GridDhtLockFuture.java   |   2 +-
 .../distributed/dht/GridDhtTxLocalAdapter.java |   2 +-
 .../cache/distributed/dht/GridDhtTxRemote.java |   8 +-
 .../dht/topology/GridDhtLocalPartition.java|  14 +-
 .../cache/local/GridLocalCacheEntry.java   |  22 +-
 .../cache/transactions/IgniteInternalTx.java   |   4 +-
 .../cache/transactions/IgniteTxAdapter.java|  10 +-
 .../cache/transactions/IgniteTxEntry.java  |   5 +-
 .../cache/transactions/IgniteTxHandler.java|  14 +-
 .../cache/transactions/IgniteTxManager.java|  11 +-
 .../cache/transactions/IgniteTxRemoteEx.java   |   5 +-
 .../IgniteTxRemoteSingleStateImpl.java |   3 +-
 .../cache/transactions/IgniteTxRemoteState.java|   6 +-
 .../transactions/IgniteTxRemoteStateImpl.java  |  22 +-
 modules/core/src/test/config/log4j-test.xml|  23 +-
 .../cache/CacheLockCandidatesThreadTest.java   |   6 +-
 .../distributed/CacheRentingStateRepairTest.java   |   3 +-
 ...omicClientInvalidPartitionHandlingSelfTest.java |  10 +
 ...acheAtomicInvalidPartitionHandlingSelfTest.java |   4 +-
 .../TxCrossCacheMapOnInvalidTopologyTest.java  |   1 -
 .../TxCrossCachePartitionConsistencyTest.java  | 320 +
 ...acheRemoteMultiplePartitionReservationTest.java | 164 +++
 .../TxPartitionCounterStateAbstractTest.java   |  12 +-
 .../TxPartitionCounterStateConsistencyTest.java| 110 ++-
 ...nterStateConsistencyVolatileRebalanceTest.java} |  47 ++-
 .../testsuites/IgniteCacheMvccTestSuite7.java  |   2 +
 .../testsuites/IgniteCacheMvccTestSuite9.java  |   4 +
 .../ignite/testsuites/IgniteCacheTestSuite7.java   |   2 +
 .../ignite/testsuites/IgniteCacheTestSuite9.java   |   6 +-
 33 files changed, 791 insertions(+), 140 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 6936b98..641001f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -4433,6 +4433,7 @@ public abstract class GridCacheMapEntry extends 
GridMetadataAwareAdapter impleme
 protected void removeValue() throws IgniteCheckedException {
 assert lock.isHeldByCurrentThread();
 
+// Removals are possible from RENTING partition on clearing/evicting.
 cctx.offheap().remove(cctx, key, partition(), localPartition());
 }
 
@@ -4905,22 +4906,26 @@ public abstract class GridCacheMapEntry extends 
GridMetadataAwareAdapter impleme
  * @param owners Current owners.
  * @param val Entry value.
  */
-protected final void checkOwnerChanged(@Nullable CacheLockCandidates 
prevOwners,
+protected final void checkOwnerChanged(
+@Nullable CacheLockCandidates prevOwners,
 @Nullable CacheLockCandidates owners,
-CacheObject val) {
-checkOwnerChanged(prevOwners, owners, val, null);
+CacheObject val
+) {
+checkOwnerChanged(prevOwners, owners, val, false);
 }
 
 /**
  * @param prevOwners Previous owners.
  * @param owners Current owners.
  * @param val Entry value.
- * @param checkingCandidate flag to enable or disable check of candidate 
chain
+ * @param inThreadChain {@code True} if called during thread chain 
checking.
  */
-protected final void checkOwnerChanged(@Nullable CacheLockCandidates 
prevOwners,
+protected final void checkOwnerChanged(
+@Nullable CacheLockCandidates prevOwners,
 @Nullable CacheLockCandidates owners,
 CacheObject val,
-CacheLockCandidates checkingCandidate) {
+boolean inThreadChain
+) {
 assert !lock.isHeldByCurrentThread();
 
 if (prevOwners != null && owners == null) {
@@

[ignite] branch master updated: IGNITE-12328 IgniteException "Failed to resolve nodes topology" during cache.removeAll() and constantly changing topology - Fixes #7015.

2019-10-29 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 6c41ed2  IGNITE-12328 IgniteException "Failed to resolve nodes 
topology" during cache.removeAll() and constantly changing topology - Fixes 
#7015.
6c41ed2 is described below

commit 6c41ed2ac91070d334a2c4eddf8a4dfebc44037b
Author: Alexey Scherbakov 
AuthorDate: Tue Oct 29 14:22:00 2019 +0300

IGNITE-12328 IgniteException "Failed to resolve nodes topology" during 
cache.removeAll() and constantly changing topology - Fixes #7015.

Signed-off-by: Ivan Rakov 
---
 .../processors/cache/GridCacheIdMessage.java   |   2 +-
 .../cache/distributed/dht/GridDhtCacheAdapter.java |  17 +-
 .../dht/GridDhtTransactionalCacheAdapter.java  |   2 +-
 .../distributed/dht/atomic/GridDhtAtomicCache.java |  10 +-
 .../dht/colocated/GridDhtColocatedLockFuture.java  |  39 +-
 .../cache/distributed/near/GridNearLockFuture.java |   4 -
 .../cache/ClientSlowDiscoveryAbstractTest.java | 121 ++
 ... => ClientSlowDiscoveryTopologyChangeTest.java} | 105 +
 .../ClientSlowDiscoveryTransactionRemapTest.java   | 473 +
 .../TxCrossCacheMapOnInvalidTopologyTest.java  | 133 --
 .../TxPartitionCounterStateConsistencyTest.java|  24 +-
 .../testsuites/IgniteCacheMvccTestSuite5.java  |   2 +
 .../ignite/testsuites/IgniteCacheTestSuite5.java   |   6 +-
 13 files changed, 758 insertions(+), 180 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java
index e094439..84d890c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java
@@ -112,6 +112,6 @@ public abstract class GridCacheIdMessage extends 
GridCacheMessage {
 
 /** {@inheritDoc} */
 @Override public String toString() {
-return S.toString(GridCacheIdMessage.class, this);
+return S.toString(GridCacheIdMessage.class, this, "super", 
super.toString());
 }
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 31adc06..da03d00 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -1274,30 +1274,29 @@ public abstract class GridDhtCacheAdapter extends 
GridDistributedCacheAdap
 }
 
 /**
- * @param expVer Expected topology version.
+ * @param mapVer Mapped topology version.
  * @param curVer Current topology version.
  * @return {@code True} if cache affinity changed and operation should be 
remapped.
  */
-protected final boolean needRemap(AffinityTopologyVersion expVer, 
AffinityTopologyVersion curVer,
-Collection keys) {
-if (curVer.equals(expVer))
+protected final boolean needRemap(AffinityTopologyVersion mapVer, 
AffinityTopologyVersion curVer) {
+if (curVer.equals(mapVer))
 return false;
 
-AffinityTopologyVersion lastAffChangedTopVer = 
ctx.shared().exchange().lastAffinityChangedTopologyVersion(expVer);
+AffinityTopologyVersion lastAffChangedTopVer = 
ctx.shared().exchange().lastAffinityChangedTopologyVersion(mapVer);
 
-if (curVer.compareTo(lastAffChangedTopVer) >= 0 && 
curVer.compareTo(expVer) <= 0)
+if (curVer.isBetween(lastAffChangedTopVer, mapVer))
 return false;
 
 // TODO IGNITE-7164 check mvcc crd for mvcc enabled txs.
 
-Collection cacheNodes0 = 
ctx.discovery().cacheGroupAffinityNodes(ctx.groupId(), expVer);
+Collection cacheNodes0 = 
ctx.discovery().cacheGroupAffinityNodes(ctx.groupId(), mapVer);
 Collection cacheNodes1 = 
ctx.discovery().cacheGroupAffinityNodes(ctx.groupId(), curVer);
 
-if (!cacheNodes0.equals(cacheNodes1) || 
ctx.affinity().affinityTopologyVersion().compareTo(curVer) < 0)
+if (!cacheNodes0.equals(cacheNodes1) || 
ctx.affinity().affinityTopologyVersion().before(curVer))
 return true;
 
 try {
-List> aff1 = ctx.affinity().assignments(expVer);
+List> aff1 = ctx.affinity().assignments(mapVer);
 List> aff2 = ctx.affinity().assignments(curVer);
 
 return !aff1.equals(aff2);
diff --git 
a/modules/core/src/main/java/

[ignite] branch master updated: IGNITE-11868 GridClient#data() should be deprecated/removed. - Fixes #6894.

2019-10-03 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new a0e0bef  IGNITE-11868 GridClient#data() should be deprecated/removed. 
- Fixes #6894.
a0e0bef is described below

commit a0e0befbc97b24c4dd092d148f4540da5f2548ef
Author: kcheng.mvp 
AuthorDate: Thu Oct 3 20:07:51 2019 +0300

IGNITE-11868 GridClient#data() should be deprecated/removed. - Fixes #6894.

Signed-off-by: Ivan Rakov 
---
 .../java/org/apache/ignite/internal/client/GridClient.java| 11 +--
 .../apache/ignite/internal/client/impl/GridClientImpl.java|  5 -
 .../internal/client/router/impl/GridRouterClientImpl.java |  5 -
 3 files changed, 1 insertion(+), 20 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClient.java 
b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClient.java
index 0405a90..f84c3f1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClient.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClient.java
@@ -31,9 +31,8 @@ import java.util.UUID;
  * can have multiple instances of {@code GridClient} running in the same VM. 
For
  * information on how to start or stop Grid please refer to {@link 
GridClientFactory} class.
  * 
- * Use following methods to get access to remote cache functionality:
+ * Use the following method to get access to remote cache functionality:
  * 
- * {@link #data()}
  * {@link #data(String)}
  * 
  * Use following methods to get access to remote compute functionality:
@@ -63,14 +62,6 @@ public interface GridClient extends AutoCloseable {
 public UUID id();
 
 /**
- * Gets a data projection for a default grid cache with {@code null} name.
- *
- * @return Data projection for grid cache with {@code null} name.
- * @throws GridClientException If client was closed.
- */
-public GridClientData data() throws GridClientException;
-
-/**
  * Gets a data projection for grid cache with name cacheName. If
  * no data configuration with given name was provided at client startup, an
  * exception will be thrown.
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientImpl.java
index 21e09bf..546f97a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientImpl.java
@@ -261,11 +261,6 @@ public class GridClientImpl implements GridClient {
 }
 
 /** {@inheritDoc} */
-@Override public GridClientData data() throws GridClientException {
-return data(null);
-}
-
-/** {@inheritDoc} */
 @Override public GridClientData data(@Nullable final String cacheName) 
throws GridClientException {
 checkClosed();
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridRouterClientImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridRouterClientImpl.java
index f3c9d39..68b56b5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridRouterClientImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridRouterClientImpl.java
@@ -176,11 +176,6 @@ public class GridRouterClientImpl implements GridClient {
 }
 
 /** {@inheritDoc} */
-@Override public GridClientData data() throws GridClientException {
-return clientImpl.data();
-}
-
-/** {@inheritDoc} */
 @Override public GridClientData data(String cacheName) throws 
GridClientException {
 return clientImpl.data(cacheName);
 }



[ignite] branch ignite-2.7.6 updated: IGNITE-12163 .NET: CacheEntryEventType.Removed is not being risen - Fixes #6862.

2019-09-11 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch ignite-2.7.6
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-2.7.6 by this push:
 new 1186c6d  IGNITE-12163 .NET: CacheEntryEventType.Removed is not being 
risen - Fixes #6862.
1186c6d is described below

commit 1186c6da1296903f63e580bc5772934ff7e4fcc6
Author: Aleksandr Shapkin 
AuthorDate: Wed Sep 11 20:31:54 2019 +0300

IGNITE-12163 .NET: CacheEntryEventType.Removed is not being risen - Fixes 
#6862.

(cherry picked from commit 3110d72)
Signed-off-by: Ivan Rakov 
---
 .../processors/platform/utils/PlatformUtils.java | 18 ++
 .../include/ignite/cache/event/cache_entry_event.h   |  3 +++
 .../Query/Continuous/ContinuousQueryAbstractTest.cs  | 18 ++
 .../Cache/Query/Continuous/ContinuousQueryUtils.cs   | 20 +---
 4 files changed, 44 insertions(+), 15 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
index 12f70dd..e08b79e 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
@@ -62,6 +62,7 @@ import org.jetbrains.annotations.Nullable;
 import javax.cache.CacheException;
 import javax.cache.event.CacheEntryEvent;
 import javax.cache.event.CacheEntryListenerException;
+import javax.cache.event.EventType;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.security.Timestamp;
@@ -612,6 +613,23 @@ public class PlatformUtils {
 writer.writeObjectDetached(evt.getKey());
 writer.writeObjectDetached(evt.getOldValue());
 writer.writeObjectDetached(evt.getValue());
+writeEventType(writer, evt.getEventType());
+}
+
+/**
+ * Write event type to the writer.
+ * @param writer Writer.
+ * @param evtType Type of event.
+ */
+private static void writeEventType(BinaryRawWriterEx writer, EventType 
evtType) {
+switch (evtType){
+case CREATED: writer.writeByte((byte) 0); break;
+case UPDATED: writer.writeByte((byte) 1); break;
+case REMOVED: writer.writeByte((byte) 2); break;
+case EXPIRED: writer.writeByte((byte) 3); break;
+default:
+throw new IllegalArgumentException("Unknown event type: " + 
evtType);
+}
 }
 
 /**
diff --git 
a/modules/platforms/cpp/core/include/ignite/cache/event/cache_entry_event.h 
b/modules/platforms/cpp/core/include/ignite/cache/event/cache_entry_event.h
index 14fa185..0a48c71 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/event/cache_entry_event.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/event/cache_entry_event.h
@@ -124,6 +124,9 @@ namespace ignite
 
 this->hasOldValue = reader.TryReadObject(this->oldVal);
 this->hasValue = reader.TryReadObject(this->val);
+
+// Java send an event type, we need to fetch it from the 
buffer.
+reader.ReadInt8();
 }
 
 private:
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
index 7326a82..5b56da1 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
@@ -921,7 +921,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous
 }
 
 /// 
-/// Craate entry.
+/// Create entry.
 /// 
 /// Value.
 /// Entry.
@@ -945,13 +945,15 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous
 /// 
 private static ICacheEntryEvent CreateEvent(ICacheEntryEvent e)
 {
-if (!e.HasOldValue)
-return new CacheEntryCreateEvent(e.Key, 
e.Value);
-
-if (e.Value.Equals(e.OldValue))
-return new CacheEntryRemoveEvent(e.Key, 
e.OldValue);
-
-return new CacheEntryUpdateEvent(e.Key, 
e.OldValue, e.Value);
+switch (e.EventType)
+{
+case CacheEntryEventType.Created:
+return new CacheEntryCreateEvent(e.Key, 
e.Value);
+case CacheEntryEventType.Updated:
+return new CacheEntryUpdateEvent(e.Key, 
e.OldValue, e.Value);
+default:
+return new CacheEntryRemoveEv

[ignite] branch master updated: IGNITE-12163 .NET: CacheEntryEventType.Removed is not being risen - Fixes #6862.

2019-09-11 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 3110d72  IGNITE-12163 .NET: CacheEntryEventType.Removed is not being 
risen - Fixes #6862.
3110d72 is described below

commit 3110d7230182ef61222b74b1a7123c45ef646775
Author: Aleksandr Shapkin 
AuthorDate: Wed Sep 11 20:31:54 2019 +0300

IGNITE-12163 .NET: CacheEntryEventType.Removed is not being risen - Fixes 
#6862.

Signed-off-by: Ivan Rakov 
---
 .../processors/platform/utils/PlatformUtils.java | 18 ++
 .../include/ignite/cache/event/cache_entry_event.h   |  3 +++
 .../Query/Continuous/ContinuousQueryAbstractTest.cs  | 18 ++
 .../Cache/Query/Continuous/ContinuousQueryUtils.cs   | 20 +---
 4 files changed, 44 insertions(+), 15 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
index 4881e5c..5b12c01 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
@@ -63,6 +63,7 @@ import org.jetbrains.annotations.Nullable;
 import javax.cache.CacheException;
 import javax.cache.event.CacheEntryEvent;
 import javax.cache.event.CacheEntryListenerException;
+import javax.cache.event.EventType;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.security.Timestamp;
@@ -612,6 +613,23 @@ public class PlatformUtils {
 writer.writeObjectDetached(evt.getKey());
 writer.writeObjectDetached(evt.getOldValue());
 writer.writeObjectDetached(evt.getValue());
+writeEventType(writer, evt.getEventType());
+}
+
+/**
+ * Write event type to the writer.
+ * @param writer Writer.
+ * @param evtType Type of event.
+ */
+private static void writeEventType(BinaryRawWriterEx writer, EventType 
evtType) {
+switch (evtType){
+case CREATED: writer.writeByte((byte) 0); break;
+case UPDATED: writer.writeByte((byte) 1); break;
+case REMOVED: writer.writeByte((byte) 2); break;
+case EXPIRED: writer.writeByte((byte) 3); break;
+default:
+throw new IllegalArgumentException("Unknown event type: " + 
evtType);
+}
 }
 
 /**
diff --git 
a/modules/platforms/cpp/core/include/ignite/cache/event/cache_entry_event.h 
b/modules/platforms/cpp/core/include/ignite/cache/event/cache_entry_event.h
index 14fa185..0a48c71 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/event/cache_entry_event.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/event/cache_entry_event.h
@@ -124,6 +124,9 @@ namespace ignite
 
 this->hasOldValue = reader.TryReadObject(this->oldVal);
 this->hasValue = reader.TryReadObject(this->val);
+
+// Java send an event type, we need to fetch it from the 
buffer.
+reader.ReadInt8();
 }
 
 private:
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
index 7326a82..5b56da1 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Continuous/ContinuousQueryAbstractTest.cs
@@ -921,7 +921,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous
 }
 
 /// 
-/// Craate entry.
+/// Create entry.
 /// 
 /// Value.
 /// Entry.
@@ -945,13 +945,15 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Continuous
 /// 
 private static ICacheEntryEvent CreateEvent(ICacheEntryEvent e)
 {
-if (!e.HasOldValue)
-return new CacheEntryCreateEvent(e.Key, 
e.Value);
-
-if (e.Value.Equals(e.OldValue))
-return new CacheEntryRemoveEvent(e.Key, 
e.OldValue);
-
-return new CacheEntryUpdateEvent(e.Key, 
e.OldValue, e.Value);
+switch (e.EventType)
+{
+case CacheEntryEventType.Created:
+return new CacheEntryCreateEvent(e.Key, 
e.Value);
+case CacheEntryEventType.Updated:
+return new CacheEntryUpdateEvent(e.Key, 
e.OldValue, e.Value);
+default:
+return new CacheEntryRemoveEvent(e.Key, 
e.OldValue);
+}
 }
 
 /// 

[ignite] branch master updated: IGNITE-12063 Add ability to track system/user time held in transaction - Fixes #6772.

2019-09-05 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new fb3129f  IGNITE-12063 Add ability to track system/user time held in 
transaction - Fixes #6772.
fb3129f is described below

commit fb3129f7501786ec07d82d9b6c85016a54029ad4
Author: denis-chudov 
AuthorDate: Thu Sep 5 20:04:11 2019 +0300

IGNITE-12063 Add ability to track system/user time held in transaction - 
Fixes #6772.

Signed-off-by: Ivan Rakov 
---
 .../org/apache/ignite/IgniteSystemProperties.java  |  24 ++
 .../org/apache/ignite/internal/IgniteFeatures.java |   7 +-
 .../ignite/internal/TransactionsMXBeanImpl.java|  30 ++
 .../processors/cache/GridCacheGateway.java |   6 +
 .../cache/GridCachePartitionExchangeManager.java   |  40 ++-
 .../processors/cache/GridCacheProcessor.java   |  67 +
 .../LongRunningTxTimeDumpSettingsClosure.java  |  74 +
 .../cache/distributed/near/GridNearTxLocal.java| 202 -
 .../cache/transactions/IgniteTxManager.java| 163 +-
 .../transactions/TransactionMetricsAdapter.java|  64 
 .../cache/transactions/TransactionProxyImpl.java   |   4 +
 .../processors/metric/impl/HistogramMetric.java|  11 +
 .../apache/ignite/mxbean/TransactionsMXBean.java   |  90 ++
 .../internal/metric/JmxMetricExporterSpiTest.java  |  28 +-
 .../GridTransactionsSystemUserTimeMetricsTest.java | 327 +
 .../TxDataConsistencyOnCommitFailureTest.java  |   9 +-
 .../testframework/junits/GridAbstractTest.java |  31 ++
 .../junits/common/GridCommonAbstractTest.java  |  32 ++
 .../ignite/testsuites/IgniteCacheTestSuite7.java   |   3 +
 19 files changed, 1180 insertions(+), 32 deletions(-)

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 746c7a2..ad394e8 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -1253,6 +1253,30 @@ public final class IgniteSystemProperties {
 public static final String INDEX_REBUILDING_PARALLELISM = 
"INDEX_REBUILDING_PARALLELISM";
 
 /**
+ * Threshold timeout for long transactions, if transaction exceeds it, it 
will be dumped in log with
+ * information about how much time did it spent in system time (time while 
aquiring locks, preparing,
+ * commiting, etc) and user time (time when client node runs some code 
while holding transaction and not
+ * waiting it). Equals 0 if not set. No long transactions are dumped in 
log if nor this parameter
+ * neither {@link #IGNITE_TRANSACTION_TIME_DUMP_SAMPLES_COEFFICIENT} is 
set.
+ */
+public static final String IGNITE_LONG_TRANSACTION_TIME_DUMP_THRESHOLD = 
"IGNITE_LONG_TRANSACTION_TIME_DUMP_THRESHOLD";
+
+/**
+ * The coefficient for samples of completed transactions that will be 
dumped in log. Must be float value
+ * between 0.0 and 1.0 inclusive. Default value is 0.0.
+ */
+public static final String 
IGNITE_TRANSACTION_TIME_DUMP_SAMPLES_COEFFICIENT =
+"IGNITE_TRANSACTION_TIME_DUMP_SAMPLES_COEFFICIENT";
+
+/**
+ * The limit of samples of completed transactions that will be dumped in 
log per second, if
+ * {@link #IGNITE_TRANSACTION_TIME_DUMP_SAMPLES_COEFFICIENT} is above 
0.0. Must be integer value
+ * greater than 0. Default value is 5.
+ */
+public static final String 
IGNITE_TRANSACTION_TIME_DUMP_SAMPLES_PER_SECOND_LIMIT =
+"IGNITE_TRANSACTION_TIME_DUMP_SAMPLES_PER_SECOND_LIMIT";
+
+/**
  * Enforces singleton.
  */
 private IgniteSystemProperties() {
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java 
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
index f356a9b..fad20f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteFeatures.java
@@ -56,7 +56,7 @@ public enum IgniteFeatures {
 
 /** Command which allow to detect and cleanup garbage which could left 
after destroying caches in shared groups */
 FIND_AND_DELETE_GARBAGE_COMMAND(8),
-
+
 /** Support of cluster read-only mode. */
 CLUSTER_READ_ONLY_MODE(9),
 
@@ -70,7 +70,10 @@ public enum IgniteFeatures {
 CHANNEL_COMMUNICATION(12),
 
 /** Replacing TcpDiscoveryNode field with nodeId field in discovery 
messages. */
-TCP_DISCOVERY_MESSAGE_NODE_COMPACT_REPRESENTATION(14);
+TCP_DISCOVERY_MESSAGE_NODE_COMPACT_REPRESENTATION(14),
+
+/** LRT system and user time dump settings.  */
+LRT_SYSTEM_USER_TIME_DUMP_SETTINGS(18);
 
 /**

[ignite] branch master updated: IGNITE-12136 Test ClusterReadOnlyModeTest is flaky. - Fixes #6835.

2019-09-03 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 1eccb2d  IGNITE-12136 Test ClusterReadOnlyModeTest is flaky. - Fixes 
#6835.
1eccb2d is described below

commit 1eccb2d648e42fd25f3abdf85db95dcdf36aeaea
Author: Sergey Antonov 
AuthorDate: Tue Sep 3 20:54:57 2019 +0300

IGNITE-12136 Test ClusterReadOnlyModeTest is flaky. - Fixes #6835.

Signed-off-by: Ivan Rakov 
---
 .../ignite/internal/processors/cache/ClusterReadOnlyModeTest.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterReadOnlyModeTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterReadOnlyModeTest.java
index e826f73..327a3f5 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterReadOnlyModeTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ClusterReadOnlyModeTest.java
@@ -129,7 +129,7 @@ public class ClusterReadOnlyModeTest extends 
ClusterReadOnlyModeAbstractTest {
 
 firstPackLatch.countDown();
 
-readOnlyEnabled.await(5, TimeUnit.SECONDS);
+assertTrue(cacheName, readOnlyEnabled.await(60, 
TimeUnit.SECONDS));
 
 doLoad(streamer, 100, 100, manualFlush);
 
@@ -148,13 +148,13 @@ public class ClusterReadOnlyModeTest extends 
ClusterReadOnlyModeAbstractTest {
 }));
 }
 
-firstPackLatch.await(5, TimeUnit.SECONDS);
+assertTrue(firstPackLatch.await(60, TimeUnit.SECONDS));
 
 changeClusterReadOnlyMode(true);
 
 readOnlyEnabled.countDown();
 
-finishLatch.await(5, TimeUnit.SECONDS);
+assertTrue(finishLatch.await(60, TimeUnit.SECONDS));
 
 assertEquals("exceptions: " + eMap, cacheNames().size(), 
eMap.size());
 
@@ -181,7 +181,7 @@ public class ClusterReadOnlyModeTest extends 
ClusterReadOnlyModeAbstractTest {
 IgniteInternalFuture fut = futs.get(cacheName);
 
 try {
-fut.get(5, TimeUnit.SECONDS);
+fut.get(15, TimeUnit.SECONDS);
 }
 catch (Exception e) {
 log.error("Failed to get future " + cacheName, e);



[ignite] branch master updated: IGNITE-12062 IntMap throws NullPointerException when map is creating - Fixes #6769.

2019-09-02 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new a7834c6  IGNITE-12062 IntMap throws NullPointerException when map is 
creating - Fixes #6769.
a7834c6 is described below

commit a7834c62d3ad086b4f64f25fb5c926f467225869
Author: mstepachev 
AuthorDate: Mon Sep 2 19:13:58 2019 +0300

IGNITE-12062 IntMap throws NullPointerException when map is creating - 
Fixes #6769.

Signed-off-by: Ivan Rakov 
---
 .../internal/util/collection/IntHashMap.java   | 29 ++
 .../processors/cache/IgniteCacheGroupsTest.java|  6 ++---
 .../internal/util/collection/IntHashMapTest.java   | 10 +++-
 .../ignite/testsuites/IgniteBasicTestSuite.java|  4 +++
 4 files changed, 35 insertions(+), 14 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/collection/IntHashMap.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/collection/IntHashMap.java
index ba68056..d6b57d8 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/collection/IntHashMap.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/collection/IntHashMap.java
@@ -72,13 +72,12 @@ public class IntHashMap implements IntMap {
 }
 }
 
-/** Default constructor. */
-public IntHashMap() {
-entries = (Entry[])new Entry[INITIAL_CAPACITY];
-}
-
-/** Create map with preallocated array. */
-public IntHashMap(int cap) {
+/**
+ * Returns required size of table.
+ *
+ * @param cap Capacity.
+ */
+static int tableSize(int cap) {
 int n = cap - 1;
 n |= n >>> 1;
 n |= n >>> 2;
@@ -86,11 +85,21 @@ public class IntHashMap implements IntMap {
 n |= n >>> 8;
 n |= n >>> 16;
 
-int entriesSize = (n < INITIAL_CAPACITY) ? INITIAL_CAPACITY : (n >= 
MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
+return  (n < INITIAL_CAPACITY) ? INITIAL_CAPACITY : (n >= 
MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
+}
 
-compactThreshold = (int)(COMPACT_LOAD_FACTOR * (entries.length >> 1));
+/** Default constructor. */
+public IntHashMap() {
+entries = (Entry[])new Entry[INITIAL_CAPACITY];
+}
 
-scaleThreshold = (int)(entries.length * SCALE_LOAD_FACTOR);
+/** Create map with preallocated array. */
+public IntHashMap(int cap) {
+int entriesSize = tableSize(cap);
+
+compactThreshold = (int)(COMPACT_LOAD_FACTOR * (entriesSize >> 1));
+
+scaleThreshold = (int)(entriesSize * SCALE_LOAD_FACTOR);
 
 entries = (Entry[])new Entry[entriesSize];
 }
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
index 0ab22fd..1e7f580 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheGroupsTest.java
@@ -81,6 +81,7 @@ import org.apache.ignite.internal.binary.BinaryMarshaller;
 import 
org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtLocalPartition;
 import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
 import 
org.apache.ignite.internal.processors.platform.cache.expiry.PlatformExpiryPolicyFactory;
+import org.apache.ignite.internal.util.collection.IntMap;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.internal.util.lang.GridIterator;
 import org.apache.ignite.internal.util.lang.GridPlainCallable;
@@ -4177,12 +4178,11 @@ public class IgniteCacheGroupsTest extends 
GridCommonAbstractTest {
 assertNotNull(grp);
 
 for (GridDhtLocalPartition part : 
grp.topology().currentLocalPartitions()) {
-Map cachesMap = 
GridTestUtils.getFieldValue(part, "cacheMaps");
+IntMap cachesMap = 
GridTestUtils.getFieldValue(part, "cacheMaps");
 
 assertTrue(cachesMap.size() <= cacheIds.size());
 
-for (Integer cacheId : cachesMap.keySet())
-assertTrue(cachesMap.containsKey(cacheId));
+cachesMap.forEach((cacheId, v) -> 
assertTrue(cachesMap.containsKey(cacheId)));
 }
 }
 }
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/util/collection/IntHashMapTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/util/collection/IntHashMapTest.java
index 0af34c9..da84dfc 100644
--- 
a/modules/core/src/t

[ignite] branch master updated: IGNITE-12084 Client node startup failed if isHandshakeWaitSupported doesn't receive disco message. - Fixes #6792.

2019-09-02 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new b1862bc  IGNITE-12084 Client node startup failed if 
isHandshakeWaitSupported doesn't receive disco message. - Fixes #6792.
b1862bc is described below

commit b1862bc184fc2015c7ccc54264d4ed2c65803134
Author: mstepachev 
AuthorDate: Mon Sep 2 18:42:58 2019 +0300

IGNITE-12084 Client node startup failed if isHandshakeWaitSupported doesn't 
receive disco message. - Fixes #6792.

Signed-off-by: Ivan Rakov 
---
 .../spi/communication/tcp/TcpCommunicationSpi.java |   9 +-
 ...municationSpiSkipWaitHandshakeOnClientTest.java | 139 +
 .../IgniteSpiCommunicationSelfTestSuite.java   |   2 +
 3 files changed, 148 insertions(+), 2 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
 
b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 569798e..618439f 100755
--- 
a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -442,7 +442,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter 
implements Communicati
 ", rmtAddr=" + ses.remoteAddress() + ']');
 
 try {
-if (ctxInitLatch.getCount() == 0 || 
!isHandshakeWaitSupported()) {
+boolean client = 
Boolean.TRUE.equals(ignite().configuration().isClientMode());
+
+if (client || ctxInitLatch.getCount() == 0 || 
!isHandshakeWaitSupported()) {
 if (log.isDebugEnabled())
 log.debug("Sending local node ID to newly 
accepted session: " + ses);
 
@@ -4208,7 +4210,10 @@ public class TcpCommunicationSpi extends 
IgniteSpiAdapter implements Communicati
  * @return Node ID message.
  */
 private NodeIdMessage nodeIdMessage() {
-return new NodeIdMessage(safeLocalNodeId());
+final UUID locNodeId = (ignite instanceof IgniteEx) ? 
((IgniteEx)ignite).context().localNodeId() :
+safeLocalNodeId();
+
+return new NodeIdMessage(locNodeId);
 }
 
 /**
diff --git 
a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest.java
 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest.java
new file mode 100644
index 000..93ce801
--- /dev/null
+++ 
b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest.java
@@ -0,0 +1,139 @@
+/*
+ * 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.communication.tcp;
+
+import java.io.InputStream;
+import java.net.Socket;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.ListeningTestLogger;
+import org.apache.ignite.internal.IgniteFeatures;
+import org.apache.ignite.testframework.LogListener;
+import org.apache.ignite.testframework.junits.GridAbstractTest;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Assert;
+import org.junit.Test;
+
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.NODE_ID_MSG_TYPE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.makeMessageType;
+
+/**
+ * This test check that client sends only Node ID message type on connect. 
There is a gap when {@link
+ * IgniteFeatures#allNodesSupports} isn't consistent, because the list of 
nodes is empty.
+ */
+public class GridTcpCommunicationSpiSkipWaitHandshakeOnClientTest extends 
GridCommonAbstractTest {
+/** Tcp communication sta

[ignite] branch master updated: IGNITE-12076 Fixed PME hang on client node caused by optimistic transactions and cache destroying - Fixes #6779.

2019-08-30 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 83f3baa  IGNITE-12076 Fixed PME hang on client node caused by 
optimistic transactions and cache destroying - Fixes #6779.
83f3baa is described below

commit 83f3baa60f7faf031279ec43772de7f3c1c8c769
Author: Slava Koptilin 
AuthorDate: Fri Aug 30 20:28:31 2019 +0300

IGNITE-12076 Fixed PME hang on client node caused by optimistic 
transactions and cache destroying - Fixes #6779.

Signed-off-by: Ivan Rakov 
---
 .../processors/cache/GridCacheContext.java |  42 +--
 .../processors/cache/GridCacheEventManager.java|  14 +-
 .../processors/cache/GridCacheProcessor.java   |  31 +--
 .../processors/cache/GridCacheProxyImpl.java   |   6 +-
 ...dNearOptimisticSerializableTxPrepareFuture.java |  10 +
 .../near/GridNearOptimisticTxPrepareFuture.java|   8 +
 .../GridNearOptimisticTxPrepareFutureAdapter.java  |  18 ++
 .../cache/transactions/IgniteTxManager.java|  71 +++--
 .../cache/transactions/IgniteTxStateImpl.java  |  24 +-
 .../cache/transactions/TxOnCachesStopTest.java | 288 -
 10 files changed, 425 insertions(+), 87 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 9d52c75..9ddafb2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -675,14 +675,14 @@ public class GridCacheContext implements 
Externalizable {
  * @return {@code True} if cache is replicated cache.
  */
 public boolean isReplicated() {
-return cacheCfg.getCacheMode() == CacheMode.REPLICATED;
+return config().getCacheMode() == CacheMode.REPLICATED;
 }
 
 /**
  * @return {@code True} if cache is partitioned cache.
  */
 public boolean isPartitioned() {
-return cacheCfg.getCacheMode() == CacheMode.PARTITIONED;
+return config().getCacheMode() == CacheMode.PARTITIONED;
 }
 
 /**
@@ -696,7 +696,7 @@ public class GridCacheContext implements 
Externalizable {
  * @return {@code True} in case cache supports query.
  */
 public boolean isQueryEnabled() {
-return !F.isEmpty(cacheCfg.getQueryEntities());
+return !F.isEmpty(config().getQueryEntities());
 }
 
 /**
@@ -849,21 +849,23 @@ public class GridCacheContext implements 
Externalizable {
  * @return {@code True} if atomic.
  */
 public boolean atomic() {
-return cacheCfg.getAtomicityMode() == ATOMIC;
+return config().getAtomicityMode() == ATOMIC;
 }
 
 /**
  * @return {@code True} if transactional.
  */
 public boolean transactional() {
-return cacheCfg.getAtomicityMode() == TRANSACTIONAL || 
cacheCfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT;
+CacheConfiguration cfg = config();
+
+return cfg.getAtomicityMode() == TRANSACTIONAL || 
cfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT;
 }
 
 /**
  * @return {@code True} if transactional snapshot.
  */
 public boolean transactionalSnapshot() {
-return cacheCfg.getAtomicityMode() == TRANSACTIONAL_SNAPSHOT;
+return config().getAtomicityMode() == TRANSACTIONAL_SNAPSHOT;
 }
 
 /**
@@ -1043,9 +1045,15 @@ public class GridCacheContext implements 
Externalizable {
 
 /**
  * @return Cache configuration for given cache instance.
+ * @throws IllegalStateException If this cache context was cleaned up.
  */
 public CacheConfiguration config() {
-return cacheCfg;
+CacheConfiguration res = cacheCfg;
+
+if (res == null)
+throw new IllegalStateException((new 
CacheStoppedException(name(;
+
+return res;
 }
 
 /**
@@ -1054,7 +1062,7 @@ public class GridCacheContext implements 
Externalizable {
  *  are set to {@code true} or the store is local.
  */
 public boolean writeToStoreFromDht() {
-return store().isLocal() || cacheCfg.isWriteBehindEnabled();
+return store().isLocal() || config().isWriteBehindEnabled();
 }
 
 /**
@@ -1488,56 +1496,56 @@ public class GridCacheContext implements 
Externalizable {
  * @return {@code True} if store read-through mode is enabled.
  */
 public boolean readThrough() {
-return cacheCfg.isReadThrough() && !skipStore();
+return config().isReadThrough() && !skipStore();
 }
 
 /**
  * @return {@code True} if store and read-through mode are enabled in 
configuration.
  */
 public boolean readT

[ignite] branch master updated: IGNITE-12042 Atempt to remove entries from fully populated data region may result in IgineOutOfMemoryException - Fixes #6745.

2019-08-30 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 96dd04a  IGNITE-12042 Atempt to remove entries from fully populated 
data region may result in IgineOutOfMemoryException - Fixes #6745.
96dd04a is described below

commit 96dd04a5834e8b0ef610fab8b18e287f09ceaa89
Author: Slava Koptilin 
AuthorDate: Fri Aug 30 20:24:50 2019 +0300

IGNITE-12042 Atempt to remove entries from fully populated data region may 
result in IgineOutOfMemoryException - Fixes #6745.

Signed-off-by: Ivan Rakov 
---
 .../cache/persistence/GridCacheOffheapManager.java |   1 -
 .../IgniteCacheDatabaseSharedManager.java  |  68 -
 .../processors/cache/persistence/RowStore.java |   9 +-
 .../cache/persistence/freelist/CacheFreeList.java  |   7 +-
 .../processors/cache/tree/CacheDataRowStore.java   |   4 -
 .../cache/CacheIgniteOutOfMemoryExceptionTest.java | 156 +
 .../IgniteDataStorageMetricsSelfTest.java  |   5 +-
 .../processors/database/CacheFreeListSelfTest.java |   1 -
 .../testsuites/IgniteCacheMvccTestSuite6.java  |   2 +
 .../ignite/testsuites/IgniteCacheTestSuite6.java   |   2 +
 10 files changed, 241 insertions(+), 14 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
index bbddc1c..be340c4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
@@ -1686,7 +1686,6 @@ public class GridCacheOffheapManager extends 
IgniteCacheOffheapManagerImpl imple
 freeListName,
 grp.dataRegion().memoryMetrics(),
 grp.dataRegion(),
-null,
 ctx.wal(),
 reuseRoot.pageId().pageId(),
 reuseRoot.isAllocated(),
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 aad30fc..bc0a5ed 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
@@ -37,11 +37,14 @@ import org.apache.ignite.configuration.DataPageEvictionMode;
 import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.failure.FailureContext;
+import org.apache.ignite.failure.FailureType;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
 import org.apache.ignite.internal.mem.DirectMemoryProvider;
 import org.apache.ignite.internal.mem.DirectMemoryRegion;
+import org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
 import org.apache.ignite.internal.mem.file.MappedFileMemoryProvider;
 import org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider;
 import org.apache.ignite.internal.pagemem.PageMemory;
@@ -58,6 +61,7 @@ import 
org.apache.ignite.internal.processors.cache.persistence.evict.PageEvictio
 import 
org.apache.ignite.internal.processors.cache.persistence.evict.Random2LruPageEvictionTracker;
 import 
org.apache.ignite.internal.processors.cache.persistence.evict.RandomLruPageEvictionTracker;
 import 
org.apache.ignite.internal.processors.cache.persistence.filename.PdsFolderSettings;
+import 
org.apache.ignite.internal.processors.cache.persistence.freelist.AbstractFreeList;
 import 
org.apache.ignite.internal.processors.cache.persistence.freelist.CacheFreeList;
 import 
org.apache.ignite.internal.processors.cache.persistence.freelist.FreeList;
 import 
org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage;
@@ -259,7 +263,6 @@ public class IgniteCacheDatabaseSharedManager extends 
GridCacheSharedManagerAdap
 freeListName,
 memMetrics,
 memPlc,
-null,
 persistenceEnabled ? cctx.wal() : null,
 0L,
 true,
@@ -986,6 +989,69 @@ public class IgniteCacheDatabaseSharedManager extends 
GridCacheSharedManagerAdap
 }
 
 /**
+ * Checks

[ignite] branch master updated: IGNITE-12087 Transactional putAll - significant performance drop on big batches of entries. - Fixes #6797.

2019-08-30 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 626c4cd  IGNITE-12087 Transactional putAll - significant performance 
drop on big batches of entries. - Fixes #6797.
626c4cd is described below

commit 626c4cda245940ad87958b3698ce2a46ec72ea66
Author: Eduard Shangareev 
AuthorDate: Fri Aug 30 20:19:46 2019 +0300

IGNITE-12087 Transactional putAll - significant performance drop on big 
batches of entries. - Fixes #6797.

Signed-off-by: Ivan Rakov 
---
 .../processors/cache/distributed/GridDistributedCacheEntry.java| 3 +++
 .../internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
index 51245e8..94349a0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheEntry.java
@@ -750,6 +750,9 @@ public class GridDistributedCacheEntry extends 
GridCacheMapEntry {
 
 // Allow next lock in the thread to proceed.
 if (!cand.used()) {
+if (cand.owner())
+break;
+
 GridCacheContext cctx0 = cand.parent().context();
 
 GridDistributedCacheEntry e =
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java
index dc362f6..66b3768 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreTxPutAllMultiNodeTest.java
@@ -139,7 +139,7 @@ public class CacheStoreTxPutAllMultiNodeTest extends 
GridCommonAbstractTest {
 private static Map createMap() {
 Map data = new TreeMap<>();
 
-for (int i = 1; i < 500; i ++)
+for (int i = 1; i < 10_000; i ++)
 data.put(i, "Eddy " + i);
 
 return data;



[ignite] branch master updated: IGNITE-12125 Concurrency problem in PagesWriteThrottle - Fixes #6826.

2019-08-30 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new fcec4e1  IGNITE-12125 Concurrency problem in PagesWriteThrottle - 
Fixes #6826.
fcec4e1 is described below

commit fcec4e125b514bc2f2e8f7c2165bc3c5b12a2352
Author: Sergey Antonov 
AuthorDate: Fri Aug 30 20:10:54 2019 +0300

IGNITE-12125 Concurrency problem in PagesWriteThrottle - Fixes #6826.

Signed-off-by: Ivan Rakov 
---
 .../persistence/pagemem/PagesWriteThrottle.java| 39 ++
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottle.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottle.java
index 1586599..b2a0ec0 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottle.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteThrottle.java
@@ -16,8 +16,7 @@
 */
 package org.apache.ignite.internal.processors.cache.persistence.pagemem;
 
-import java.util.Collection;
-import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.LockSupport;
 import org.apache.ignite.IgniteLogger;
@@ -60,8 +59,8 @@ public class PagesWriteThrottle implements 
PagesWriteThrottlePolicy {
 /** Logger. */
 private IgniteLogger log;
 
-/** Currently parking threads. */
-private final Collection parkThrds = new ConcurrentLinkedQueue<>();
+/** Threads that are throttled due to checkpoint buffer overflow. */
+private final ConcurrentHashMap cpBufThrottledThreads = new 
ConcurrentHashMap<>();
 
 /**
  * @param pageMemory Page memory.
@@ -126,23 +125,36 @@ public class PagesWriteThrottle implements 
PagesWriteThrottlePolicy {
 
 long throttleParkTimeNs = (long) (STARTING_THROTTLE_NANOS * 
Math.pow(BACKOFF_RATIO, throttleLevel));
 
+Thread curThread = Thread.currentThread();
+
 if (throttleParkTimeNs > LOGGING_THRESHOLD) {
-U.warn(log, "Parking thread=" + 
Thread.currentThread().getName()
+U.warn(log, "Parking thread=" + curThread.getName()
 + " for timeout(ms)=" + (throttleParkTimeNs / 1_000_000));
 }
 
-if (isPageInCheckpoint)
-parkThrds.add(Thread.currentThread());
+if (isPageInCheckpoint) {
+cpBufThrottledThreads.put(curThread.getId(), curThread);
+
+try {
+LockSupport.parkNanos(throttleParkTimeNs);
+}
+finally {
+cpBufThrottledThreads.remove(curThread.getId());
 
-LockSupport.parkNanos(throttleParkTimeNs);
+if (throttleParkTimeNs > LOGGING_THRESHOLD) {
+U.warn(log, "Unparking thread=" + curThread.getName()
++ " with park timeout(ms)=" + (throttleParkTimeNs 
/ 1_000_000));
+}
+}
+}
+else
+LockSupport.parkNanos(throttleParkTimeNs);
 }
 else {
 int oldCntr = cntr.getAndSet(0);
 
-if (isPageInCheckpoint && oldCntr != 0) {
-parkThrds.forEach(LockSupport::unpark);
-parkThrds.clear();
-}
+if (isPageInCheckpoint && oldCntr != 0)
+cpBufThrottledThreads.values().forEach(LockSupport::unpark);
 }
 }
 
@@ -151,8 +163,7 @@ public class PagesWriteThrottle implements 
PagesWriteThrottlePolicy {
 if (!shouldThrottle()) {
 inCheckpointBackoffCntr.set(0);
 
-parkThrds.forEach(LockSupport::unpark);
-parkThrds.clear();
+cpBufThrottledThreads.values().forEach(LockSupport::unpark);
 }
 }
 



[ignite] branch master updated: IGNITE-12059 DiskPageCompressionConfigValidationTest.testIncorrectStaticCacheConfiguration fails - Fixes #6765.

2019-08-15 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new d13e442  IGNITE-12059 
DiskPageCompressionConfigValidationTest.testIncorrectStaticCacheConfiguration 
fails - Fixes #6765.
d13e442 is described below

commit d13e442b55a6f3fee25e38accd8440c673d8d691
Author: Eduard Shangareev 
AuthorDate: Thu Aug 15 19:35:52 2019 +0300

IGNITE-12059 
DiskPageCompressionConfigValidationTest.testIncorrectStaticCacheConfiguration 
fails - Fixes #6765.

Signed-off-by: Ivan Rakov 
---
 .../internal/processors/cache/GridCacheProcessor.java|  1 +
 .../processors/cache/ValidationOnNodeJoinUtils.java  | 16 
 .../db/IgniteCacheGroupsWithRestartsTest.java|  2 +-
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 2285eb6..44a985c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -605,6 +605,7 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 CU.initializeConfigDefaults(log, cfg, cacheObjCtx);
 
 ctx.coordinators().preProcessCacheConfiguration(cfg);
+ctx.igfsHelper().preProcessCacheConfiguration(cfg);
 }
 
 /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ValidationOnNodeJoinUtils.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ValidationOnNodeJoinUtils.java
index f275f28..9916b3a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ValidationOnNodeJoinUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ValidationOnNodeJoinUtils.java
@@ -42,6 +42,7 @@ import org.apache.ignite.configuration.DataPageEvictionMode;
 import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.DeploymentMode;
+import org.apache.ignite.configuration.DiskPageCompression;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.MemoryConfiguration;
 import org.apache.ignite.configuration.TransactionConfiguration;
@@ -407,19 +408,26 @@ public class ValidationOnNodeJoinUtils {
 }
 
 if (cc.isEncryptionEnabled() && !ctx.clientNode()) {
+StringBuilder cacheSpec = new 
StringBuilder("[cacheName=").append(cc.getName())
+.append(", groupName=").append(cc.getGroupName())
+.append(", cacheType=").append(cacheType)
+.append(']');
+
 if (!CU.isPersistentCache(cc, c.getDataStorageConfiguration())) {
 throw new IgniteCheckedException("Using encryption is not 
allowed" +
-" for not persistent cache  [cacheName=" + cc.getName() + 
", groupName=" + cc.getGroupName() +
-", cacheType=" + cacheType + "]");
+" for not persistent cache " + cacheSpec.toString());
 }
 
 EncryptionSpi encSpi = c.getEncryptionSpi();
 
 if (encSpi == null) {
 throw new IgniteCheckedException("EncryptionSpi should be 
configured to use encrypted cache " +
-"[cacheName=" + cc.getName() + ", groupName=" + 
cc.getGroupName() +
-", cacheType=" + cacheType + "]");
+cacheSpec.toString());
 }
+
+if (cc.getDiskPageCompression() != DiskPageCompression.DISABLED)
+throw new IgniteCheckedException("Encryption cannot be used 
with disk page compression " +
+cacheSpec.toString());
 }
 
 Collection ents = cc.getQueryEntities();
diff --git 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteCacheGroupsWithRestartsTest.java
 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteCacheGroupsWithRestartsTest.java
index 833af0e..c6851c6 100644
--- 
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteCacheGroupsWithRestartsTest.java
+++ 
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgniteCacheGroupsWithRestartsTest.java
@@ -220,7 +220,7 @@ public class IgniteCacheGroupsWithResta

[ignite] branch master updated: IGNITE-6957 Reduce excessive int boxing when accessing cache by ID - Fixes #6536.

2019-08-11 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 4eda065  IGNITE-6957 Reduce excessive int boxing when accessing cache 
by ID - Fixes #6536.
4eda065 is described below

commit 4eda06575f1831350ff0545c2b78bb3cb9a811b5
Author: mstepachev 
AuthorDate: Mon Aug 12 02:32:55 2019 +0300

IGNITE-6957 Reduce excessive int boxing when accessing cache by ID - Fixes 
#6536.

Signed-off-by: Ivan Rakov 
---
 .../affinity/GridAffinityAssignmentV2.java |  15 +-
 .../affinity/HistoryAffinityAssignmentImpl.java|   7 +-
 .../processors/cache/CacheMetricsImpl.java |   9 +-
 .../cache/IgniteCacheOffheapManagerImpl.java   |  35 +--
 .../dht/topology/GridDhtLocalPartition.java|  19 +-
 .../util/{ => collection}/BitSetIntSet.java| 112 +---
 .../internal/util/collection/ImmutableIntSet.java  | 206 ++
 .../internal/util/collection/IntHashMap.java   | 309 +
 .../ignite/internal/util/collection/IntMap.java|  85 ++
 .../internal/util/collection/IntRWHashMap.java | 141 ++
 .../ignite/internal/util/collection/IntSet.java|  37 +++
 .../main/resources/META-INF/classnames.properties  |   5 +-
 .../affinity/GridAffinityAssignmentV2Test.java |   4 +-
 .../util/collection/AbstractBaseIntMapTest.java| 248 +
 .../util/{ => collection}/BitSetIntSetTest.java| 188 +++--
 .../util/collection/ImmutableIntSetTest.java   |  92 ++
 .../internal/util/collection/IntHashMapTest.java   | 126 +
 .../internal/util/collection/IntRWHashMapTest.java |  28 ++
 .../ignite/testsuites/IgniteBasicTestSuite.java|   4 +-
 19 files changed, 1504 insertions(+), 166 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentV2.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentV2.java
index ddb5716..1c8ef38 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentV2.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentV2.java
@@ -31,7 +31,8 @@ import java.util.Set;
 import java.util.UUID;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.internal.dto.IgniteDataTransferObject;
-import org.apache.ignite.internal.util.BitSetIntSet;
+import org.apache.ignite.internal.util.collection.BitSetIntSet;
+import org.apache.ignite.internal.util.collection.ImmutableIntSet;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -117,16 +118,16 @@ public class GridAffinityAssignmentV2 extends 
IgniteDataTransferObject implement
 for (int partsCnt = assignment.size(), p = 0; p < partsCnt; p++) {
 isPrimary = true;
 
-List currentOwners = assignment.get(p);
+List currOwners = assignment.get(p);
 
-for (ClusterNode node : currentOwners) {
+for (ClusterNode node : currOwners) {
 UUID id = node.id();
 
 Map> tmp = isPrimary ? tmpPrimary : 
tmpBackup;
 
 /*
 https://issues.apache.org/jira/browse/IGNITE-4554 BitSet 
performs better than HashSet at most cases.
-However with 65k partition and high number of nodes (700+) 
BitSet is loosing HashSet.
+However with 65k partition and high number of nodes (700+) 
BitSet is losing HashSet.
 We need to replace it with sparse bitsets.
  */
 tmp.computeIfAbsent(id, uuid ->
@@ -138,7 +139,7 @@ public class GridAffinityAssignmentV2 extends 
IgniteDataTransferObject implement
 
 List idealOwners = p < idealAssignment.size() ? 
idealAssignment.get(p) : Collections.emptyList();
 
-ClusterNode curPrimary = !currentOwners.isEmpty() ? 
currentOwners.get(0) : null;
+ClusterNode curPrimary = !currOwners.isEmpty() ? currOwners.get(0) 
: null;
 ClusterNode idealPrimary = !idealOwners.isEmpty() ? 
idealOwners.get(0) : null;
 
 if (curPrimary != null && !curPrimary.equals(idealPrimary))
@@ -288,7 +289,7 @@ public class GridAffinityAssignmentV2 extends 
IgniteDataTransferObject implement
 @Override public Set primaryPartitions(UUID nodeId) {
 Set set = primary.get(nodeId);
 
-return set == null ? Collections.emptySet() : 
Collections.unmodifiableSet(set);
+return set == null ? ImmutableIntSet.emptySet() : 
ImmutableIntSet.wrap(set);
 }
 
 /**
@@ -300,7 +301,7 @@ public class GridAf

[ignite] branch master updated: IGNITE-12036 Changing baseline via set command may cause NPEs if configured NodeFilter takes node attributes into account - Fixes #6743.

2019-08-11 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new e7864f1  IGNITE-12036 Changing baseline via set command may cause NPEs 
if configured NodeFilter takes node attributes into account - Fixes #6743.
e7864f1 is described below

commit e7864f198539f87a38e993cc68f0931dca195534
Author: alapin 
AuthorDate: Mon Aug 12 01:54:34 2019 +0300

IGNITE-12036 Changing baseline via set command may cause NPEs if configured 
NodeFilter takes node attributes into account - Fixes #6743.

Signed-off-by: Ivan Rakov 
---
 .../internal/cluster/DetachedClusterNode.java  |  4 +-
 .../ignite/internal/cluster/IgniteClusterImpl.java | 21 +++-
 .../distributed/CacheBaselineTopologyTest.java | 62 +-
 ...niteBaselineAffinityTopologyActivationTest.java | 33 
 .../apache/ignite/util/GridCommandHandlerTest.java | 21 
 .../Cache/PersistenceTest.cs   | 28 +-
 6 files changed, 119 insertions(+), 50 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/cluster/DetachedClusterNode.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/DetachedClusterNode.java
index 2c72bb0..a3a69e1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/cluster/DetachedClusterNode.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/DetachedClusterNode.java
@@ -30,7 +30,9 @@ import org.apache.ignite.lang.IgniteProductVersion;
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Representation of cluster node that isn't currently present in cluster.
+ * Representation of cluster node that either isn't currently present in 
cluster, or semantically detached.
+ * For example nodes returned from {@code BaselineTopology.currentBaseline()} 
are always considered as
+ * semantically detached, even if they are currently present in cluster.
  */
 public class DetachedClusterNode implements ClusterNode {
 /** */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
index 3659241..6249301 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
@@ -29,7 +29,10 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentLinkedQueue;
@@ -404,6 +407,22 @@ public class IgniteClusterImpl extends ClusterGroupAdapter 
implements IgniteClus
 if (baselineTop.isEmpty())
 throw new IgniteException("BaselineTopology must contain at 
least one node.");
 
+List currBlT = 
Optional.ofNullable(ctx.state().clusterState().baselineTopology()).
+
map(BaselineTopology::currentBaseline).orElse(Collections.emptyList());
+
+Collection srvrs = 
ctx.cluster().get().forServers().nodes();
+
+for (BaselineNode node : baselineTop) {
+Object consistentId = node.consistentId();
+
+if (currBlT.stream().noneMatch(
+currBlTNode -> Objects.equals(currBlTNode.consistentId(), 
consistentId)) &&
+srvrs.stream().noneMatch(
+currServersNode -> 
Objects.equals(currServersNode.consistentId(), consistentId)))
+throw new IgniteException("Check arguments. Node with 
consistent ID [" + consistentId +
+"] not found in server nodes.");
+}
+
 Collection onlineNodes = 
onlineBaselineNodesRequestedForRemoval(baselineTop);
 
 if (onlineNodes != null) {
@@ -473,7 +492,7 @@ public class IgniteClusterImpl extends ClusterGroupAdapter 
implements IgniteClus
 Collection target = new ArrayList<>(top.size());
 
 for (ClusterNode node : top) {
-if (!node.isClient())
+if (!node.isClient() && !node.isDaemon())
 target.add(node);
 }
 
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 93b2fbb..6d80c19 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheBaselineTopologyTest.java
+++ 
b/modules/core/src/test/ja

[ignite] branch master updated: IGNITE-12052 GridDhtTxPrepareFuture should print transaction in case of assertion error - Fixes #6761.

2019-08-11 Thread irakov
This is an automated email from the ASF dual-hosted git repository.

irakov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
 new 1392332  IGNITE-12052 GridDhtTxPrepareFuture should print transaction 
in case of assertion error - Fixes #6761.
1392332 is described below

commit 1392332d84a1fc21700292ef4d16d028b23f01de
Author: Sergey Antonov 
AuthorDate: Mon Aug 12 01:43:58 2019 +0300

IGNITE-12052 GridDhtTxPrepareFuture should print transaction in case of 
assertion error - Fixes #6761.

Signed-off-by: Ivan Rakov 
---
 .../internal/processors/cache/GridCacheUtils.java  |  7 ++
 .../distributed/dht/GridDhtTxPrepareFuture.java| 25 --
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index f6ea2ba..a249914 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -841,6 +841,13 @@ public class GridCacheUtils {
 }
 
 /**
+ * Alias for {@link #txString(IgniteInternalTx)}.
+ */
+public static String txDump(@Nullable IgniteInternalTx tx) {
+return txString(tx);
+}
+
+/**
  * @param tx Transaction.
  * @return String view of all safe-to-print transaction properties.
  */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index 83edb29..ec8a451 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -1455,8 +1455,12 @@ public final class GridDhtTxPrepareFuture extends 
GridCacheCompoundFuture

  1   2   3   >