[ignite] branch master updated: IGNITE-18935 Fix late stopping of TTL workers during deactivation leads to corrupted PDS (#10570)

2023-03-07 Thread ivandasch
This is an automated email from the ASF dual-hosted git repository.

ivandasch 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 6229b46c277 IGNITE-18935 Fix late stopping of TTL workers during 
deactivation leads to corrupted PDS (#10570)
6229b46c277 is described below

commit 6229b46c277707743da4f5fce881450a8a6ca151
Author: Ivan Daschinskiy 
AuthorDate: Tue Mar 7 11:03:29 2023 +0300

IGNITE-18935 Fix late stopping of TTL workers during deactivation leads to 
corrupted PDS (#10570)
---
 modules/compress/pom.xml   |   7 +
 .../processors/cache/GridCacheProcessor.java   |  58 --
 ...IgnitePdsWithTtlExpirationOnDeactivateTest.java | 222 +
 .../ignite/testsuites/IgnitePdsTestSuite.java  |   2 +
 4 files changed, 268 insertions(+), 21 deletions(-)

diff --git a/modules/compress/pom.xml b/modules/compress/pom.xml
index f9c4db51f42..c07bb0b7f8a 100644
--- a/modules/compress/pom.xml
+++ b/modules/compress/pom.xml
@@ -131,6 +131,13 @@
 ${guava.version}
 test
 
+
+
+org.apache.commons
+commons-lang3
+${commons.lang3.version}
+test
+
 
 
 
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 53b29937c6f..6cb8c84b5b0 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
@@ -2744,9 +2744,6 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 // Wait until all evictions are finished.
 grpsToStop.forEach(t -> 
sharedCtx.evict().onCacheGroupStopped(t.get1()));
 
-if (!exchActions.cacheStopRequests().isEmpty())
-removeOffheapListenerAfterCheckpoint(grpsToStop);
-
 Map> cachesToStop = 
exchActions.cacheStopRequests().stream()
 .collect(groupingBy(action -> action.descriptor().groupId()));
 
@@ -2763,31 +2760,50 @@ public class GridCacheProcessor extends 
GridProcessorAdapter {
 
 CacheGroupContext gctx = cacheGrps.get(groupId);
 
-if (gctx != null)
-gctx.preloader().pause();
+if (gctx != null) {
+final String msg = "Failed to wait for topology 
update, cache group is stopping.";
 
-try {
-if (gctx != null) {
-final String msg = "Failed to wait for topology 
update, cache group is stopping.";
+// If snapshot operation in progress we must throw 
CacheStoppedException
+// for correct cache proxy restart. For more details 
see
+// IgniteCacheProxy.cacheException()
+gctx.affinity().cancelFutures(new 
CacheStoppedException(msg));
+}
 
-// If snapshot operation in progress we must throw 
CacheStoppedException
-// for correct cache proxy restart. For more 
details see
-// IgniteCacheProxy.cacheException()
-gctx.affinity().cancelFutures(new 
CacheStoppedException(msg));
-}
+for (ExchangeActions.CacheActionData action : 
cachesToStopByGrp.getValue()) {
+
context().tm().rollbackTransactionsForStoppingCache(action.descriptor().cacheId());
 
-for (ExchangeActions.CacheActionData action : 
cachesToStopByGrp.getValue()) {
-
context().tm().rollbackTransactionsForStoppingCache(action.descriptor().cacheId());
+stopGateway(action.request());
 
-stopGateway(action.request());
+String cacheName = action.request().cacheName();
 
-String cacheName = action.request().cacheName();
+GridCacheAdapter cache = caches.get(cacheName);
 
-// TTL manager has to be unregistered before the 
checkpointReadLock is acquired.
-GridCacheAdapter cache = 
caches.get(cacheName);
+if (cache != null)
+cache.context().ttl().unregister();
+}
 
-if (cache != null)
-cache.context().ttl().unregister();
+return null;
+}
+);
+
+if (!exchActions.cacheStopRequests().isEmpty())
+removeOffheapListenerAfterCheck

[ignite-3] branch main updated: IGNITE-18884 .NET: Add TLS support (#1752)

2023-03-07 Thread ptupitsyn
This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new 8cab5a5337 IGNITE-18884 .NET: Add TLS support (#1752)
8cab5a5337 is described below

commit 8cab5a533721220db34626d75106fd17465806b0
Author: Pavel Tupitsyn 
AuthorDate: Tue Mar 7 11:15:16 2023 +0300

IGNITE-18884 .NET: Add TLS support (#1752)

**Public API Changes**

* Add `IgniteClientConfiguration.SslStreamFactory` - same API as in 2.x
  * Allow the factory to return `null` to disable SSL
* Change `IIgniteClient.GetConnections` to return a list of 
`IConnectionInfo` (`IClusterNode` + `ISslInfo`)

**Other Changes**

* Fix `ClientHandlerModule` to initialize `SslContext` once on startup:
  * Improves performance (no need to initialize on every client connection)
  * Fails node startup in case of SSL misconfiguration
* Use 4 nodes in `PlatformTestNodeRunner`: 2 without SSL, 1 with SSL, 1 
with SSL and client authentication.
---
 .../client/handler/ItSslClientHandlerTest.java |  18 +-
 .../ignite/client/handler/ClientHandlerModule.java |   7 +-
 .../Apache.Ignite.Tests/Apache.Ignite.Tests.csproj |   9 +
 .../Apache.Ignite.Tests/ClientSocketTests.cs   |  11 +-
 .../Compute/ComputeClusterAwarenessTests.cs|   2 +-
 .../Apache.Ignite.Tests/Compute/ComputeTests.cs|  21 ++-
 .../dotnet/Apache.Ignite.Tests/JavaServer.cs   |   7 +
 .../dotnet/Apache.Ignite.Tests/MultiClusterTest.cs |   2 +-
 .../dotnet/Apache.Ignite.Tests/SslTests.cs | 189 +
 .../dotnet/Apache.Ignite.Tests/keystore.pfx| Bin 0 -> 4670 bytes
 .../dotnet/Apache.Ignite.Tests/truststore.pfx  | Bin 0 -> 1814 bytes
 .../dotnet/Apache.Ignite/IIgniteClient.cs  |   2 +-
 .../ConnectionContext.cs => ISslStreamFactory.cs}  |  28 +--
 .../Apache.Ignite/IgniteClientConfiguration.cs |  10 ++
 .../Apache.Ignite/Internal/ClientFailoverSocket.cs |  10 +-
 .../dotnet/Apache.Ignite/Internal/ClientSocket.cs  |  73 ++--
 .../Apache.Ignite/Internal/ConnectionContext.cs|   8 +-
 .../Apache.Ignite/Internal/IgniteClientInternal.cs |   4 +-
 .../ConnectionInfo.cs} |  17 +-
 .../{ConnectionContext.cs => Network/SslInfo.cs}   |  25 ++-
 .../IConnectionInfo.cs}|  21 ++-
 .../dotnet/Apache.Ignite/Network/ISslInfo.cs   |  58 +++
 .../dotnet/Apache.Ignite/SslStreamFactory.cs   | 105 
 modules/platforms/dotnet/DEVNOTES.md   |   2 +
 .../runner/app/PlatformTestNodeRunner.java |  73 +++-
 .../src/integrationTest/resources/ssl/client.pfx   | Bin 0 -> 2717 bytes
 .../src/integrationTest/resources/ssl/server.jks   | Bin 0 -> 2392 bytes
 .../src/integrationTest/resources/ssl/trust.jks| Bin 0 -> 1199 bytes
 28 files changed, 609 insertions(+), 93 deletions(-)

diff --git 
a/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/ItSslClientHandlerTest.java
 
b/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/ItSslClientHandlerTest.java
index 585167418d..b341350c36 100644
--- 
a/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/ItSslClientHandlerTest.java
+++ 
b/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/ItSslClientHandlerTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.client.handler;
 
+import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.assertThrowsWithCause;
 import static org.junit.jupiter.api.Assertions.assertArrayEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -34,6 +35,7 @@ import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
 import org.apache.ignite.internal.testframework.WorkDirectory;
 import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
+import org.apache.ignite.lang.IgniteException;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.DisplayName;
@@ -68,7 +70,7 @@ public class ItSslClientHandlerTest {
 throws KeyStoreException, IOException, NoSuchAlgorithmException, 
CertificateException {
 KeyStore ks = KeyStore.getInstance("PKCS12");
 ks.load(null, null);
-ks.setKeyEntry("key", cert.key(), null, new 
Certificate[]{cert.cert()});
+ks.setKeyEntry("key", cert.key(), "changeit".toCharArray(), new 
Certificate[]{cert.cert()});
 try (FileOutputStream fos = new FileOutputStream(keyStorePkcs12Path)) {
 ks.store(fos, "changeit".toCharArray());
 }
@@ -108,6 +110,20 @@ public class ItSslClientHandlerTest {
 assertThrows(SocketException.class, this::performAndCheckMagic);
 }
 
+@Test
+@DisplayName("When SSL is confi

[ignite-3] branch main updated: IGNITE-18968 Possible race between updating a low watermark and processing the last batch for storage in a background GC (#1760)

2023-03-07 Thread tkalkirill
This is an automated email from the ASF dual-hosted git repository.

tkalkirill pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new e1a4ded604 IGNITE-18968 Possible race between updating a low watermark 
and processing the last batch for storage in a background GC (#1760)
e1a4ded604 is described below

commit e1a4ded604c735209fa5188c8fe1da9a0559e406
Author: Kirill Tkalenko 
AuthorDate: Tue Mar 7 11:40:22 2023 +0300

IGNITE-18968 Possible race between updating a low watermark and processing 
the last batch for storage in a background GC (#1760)
---
 .../ignite/internal/table/distributed/gc/MvGc.java | 41 
 .../internal/table/distributed/gc/MvGcTest.java| 54 +-
 2 files changed, 86 insertions(+), 9 deletions(-)

diff --git 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/gc/MvGc.java
 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/gc/MvGc.java
index 91b7867dec..a29f4e6d36 100644
--- 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/gc/MvGc.java
+++ 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/gc/MvGc.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.table.distributed.gc;
 
 import static java.util.concurrent.CompletableFuture.completedFuture;
+import static 
org.apache.ignite.internal.thread.NamedThreadFactory.threadPrefix;
 import static 
org.apache.ignite.internal.util.IgniteUtils.shutdownAndAwaitTermination;
 
 import java.util.concurrent.CompletableFuture;
@@ -42,6 +43,7 @@ import org.apache.ignite.internal.thread.NamedThreadFactory;
 import org.apache.ignite.internal.util.IgniteSpinBusyLock;
 import org.apache.ignite.lang.ErrorGroups.GarbageCollector;
 import org.apache.ignite.lang.IgniteInternalException;
+import org.jetbrains.annotations.TestOnly;
 
 /**
  * Garbage collector for multi-versioned storages and their indexes in the 
background.
@@ -98,7 +100,7 @@ public class MvGc implements ManuallyCloseable {
 30,
 TimeUnit.SECONDS,
 new LinkedBlockingQueue<>(),
-new NamedThreadFactory(nodeName, LOG)
+new NamedThreadFactory(threadPrefix(nodeName, "mv-gc"), LOG)
 );
 }
 
@@ -193,17 +195,34 @@ public class MvGc implements ManuallyCloseable {
 
 private void scheduleGcForStorage(TablePartitionId tablePartitionId) {
 executor.submit(() -> inBusyLock(() -> {
-GcStorageHandler storageHandler = 
storageHandlerByPartitionId.get(tablePartitionId);
+CompletableFuture future = new CompletableFuture<>();
+
+GcStorageHandler storageHandler = 
storageHandlerByPartitionId.compute(tablePartitionId, (tablePartId, 
gcStorageHandler) -> {
+if (gcStorageHandler == null) {
+// Storage has been removed from garbage collection.
+return null;
+}
+
+CompletableFuture inProgressFuture = 
gcStorageHandler.gcInProgressFuture.get();
+
+if (inProgressFuture == null || inProgressFuture.isDone()) {
+boolean casResult = 
gcStorageHandler.gcInProgressFuture.compareAndSet(inProgressFuture, future);
+
+assert casResult : tablePartId;
+} else {
+inProgressFuture.whenComplete((unused, throwable) -> 
scheduleGcForStorage(tablePartitionId));
+}
+
+return gcStorageHandler;
+});
 
 if (storageHandler == null) {
 // Storage has been removed from garbage collection.
 return;
 }
 
-CompletableFuture future = new CompletableFuture<>();
-
-if (!storageHandler.gcInProgressFuture.compareAndSet(null, 
future)) {
-// In parallel, another task has already begun collecting 
garbage.
+if (storageHandler.gcInProgressFuture.get() != future) {
+// Someone in parallel is already collecting garbage, we will 
try once again after completion of gcInProgressFuture.
 return;
 }
 
@@ -227,8 +246,6 @@ public class MvGc implements ManuallyCloseable {
 if (!future.isCompletedExceptionally()) {
 future.complete(null);
 }
-
-storageHandler.gcInProgressFuture.set(null);
 }
 
 scheduleGcForStorage(tablePartitionId);
@@ -254,4 +271,12 @@ public class MvGc implements ManuallyCloseable {
 return null;
 });
 }
+
+/**
+ * Schedule a new garbage collection for all storages.
+ */
+@TestOnly
+void scheduleGcForAllStorages() {
+inBusyLock(this::initNewGcBusy);
+}
 }
diff --git 
a/modules/table/src/test/java/org/apache/ignite/internal/table/distribu

[ignite-3] branch main updated: IGNITE-18529 Deal with deleting a table/partition and rebalancing partitions (#1745)

2023-03-07 Thread tkalkirill
This is an automated email from the ASF dual-hosted git repository.

tkalkirill pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new d7d0f741e3 IGNITE-18529 Deal with deleting a table/partition and 
rebalancing partitions (#1745)
d7d0f741e3 is described below

commit d7d0f741e35c85fc63c28466c4caad93d160e9e1
Author: Kirill Tkalenko 
AuthorDate: Tue Mar 7 11:42:54 2023 +0300

IGNITE-18529 Deal with deleting a table/partition and rebalancing 
partitions (#1745)
---
 docs/_docs/glossary/glossary.adoc  |   2 +-
 .../internal/storage/util/MvPartitionStorages.java | 158 +++--
 .../internal/storage/util/StorageOperation.java|  87 ++--
 .../storage/util/MvPartitionStoragesTest.java  | 154 +++-
 .../storage/AbstractMvTableStorageTest.java|  18 +++
 .../storage/impl/TestMvPartitionStorage.java   |   2 -
 .../internal/storage/impl/TestMvTableStorage.java  |   6 +-
 .../pagememory/AbstractPageMemoryTableStorage.java |  14 +-
 .../mv/AbstractPageMemoryMvPartitionStorage.java   |   6 +-
 .../storage/rocksdb/RocksDbMvPartitionStorage.java |   6 +-
 .../storage/rocksdb/RocksDbTableStorage.java   |  27 ++--
 11 files changed, 304 insertions(+), 176 deletions(-)

diff --git a/docs/_docs/glossary/glossary.adoc 
b/docs/_docs/glossary/glossary.adoc
index b43156752d..d3c5393817 100644
--- a/docs/_docs/glossary/glossary.adoc
+++ b/docs/_docs/glossary/glossary.adoc
@@ -22,7 +22,7 @@ Cluster Management Group::A subset of Ignite nodes in a Raft 
cluster. Cluster gr
 
 Data Region:: Data regions are used to control the amount of memory available 
to the storage. Depending on the type of storage the data region is assigned 
to, the data may be loaded into RAM or stored
 
-Data Rebalace:: Data rebalance is the process of redistributing partitions to 
make sure they are distributed equally across all nodes in the cluster.
+Data Rebalance:: Data rebalance is the process of redistributing partitions to 
make sure they are distributed equally across all nodes in the cluster.
 
  M
 
diff --git 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/util/MvPartitionStorages.java
 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/util/MvPartitionStorages.java
index 8f8ce9fcbe..cfb9d6446e 100644
--- 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/util/MvPartitionStorages.java
+++ 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/util/MvPartitionStorages.java
@@ -37,6 +37,7 @@ import org.apache.ignite.internal.storage.StorageException;
 import org.apache.ignite.internal.storage.StorageRebalanceException;
 import 
org.apache.ignite.internal.storage.util.StorageOperation.AbortRebalanceStorageOperation;
 import 
org.apache.ignite.internal.storage.util.StorageOperation.CleanupStorageOperation;
+import 
org.apache.ignite.internal.storage.util.StorageOperation.CloseStorageOperation;
 import 
org.apache.ignite.internal.storage.util.StorageOperation.CreateStorageOperation;
 import 
org.apache.ignite.internal.storage.util.StorageOperation.DestroyStorageOperation;
 import 
org.apache.ignite.internal.storage.util.StorageOperation.FinishRebalanceStorageOperation;
@@ -54,7 +55,7 @@ public class MvPartitionStorages {
 
 private final ConcurrentMap 
operationByPartitionId = new ConcurrentHashMap<>();
 
-private final ConcurrentMap> 
rebalaceFutureByPartitionId = new ConcurrentHashMap<>();
+private final ConcurrentMap> 
rebalanceFutureByPartitionId = new ConcurrentHashMap<>();
 
 /**
  * Constructor.
@@ -127,7 +128,7 @@ public class MvPartitionStorages {
 }).whenComplete((storage, throwable) -> 
operationByPartitionId.compute(partitionId, (partId, operation) -> {
 assert operation instanceof CreateStorageOperation : 
createStorageInfo(partitionId) + ", op=" + operation;
 
-return null;
+return completeOperation(operation);
 }));
 }
 
@@ -158,9 +159,7 @@ public class MvPartitionStorages {
 operationByPartitionId.compute(partitionId, (partId, 
operation) -> {
 assert operation instanceof DestroyStorageOperation : 
createStorageInfo(partitionId) + ", op=" + operation;
 
-DestroyStorageOperation destroyStorageOperation = 
(DestroyStorageOperation) operation;
-
-return 
destroyStorageOperation.getCreateStorageOperation();
+return completeOperation(operation);
 });
 
 if (throwable == null) {
@@ -198,7 +197,7 @@ public class MvPartitionStorages {
 operationByPartitionId.compute(partitionId, (partId, 
operation) -> {
 assert operation instanceof 
CleanupStorageOperation : createStorageInfo(partitionId

[ignite-3] branch main updated: IGNITE-18792 Added doc for distribution zones phase 1. Fixes #1708

2023-03-07 Thread sk0x50
This is an automated email from the ASF dual-hosted git repository.

sk0x50 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new f4f505f3ac IGNITE-18792 Added doc for distribution zones phase 1. 
Fixes #1708
f4f505f3ac is described below

commit f4f505f3ac23c4e29f84656385ba491e51245ac0
Author: IgGusev 
AuthorDate: Tue Mar 7 11:14:07 2023 +0200

IGNITE-18792 Added doc for distribution zones phase 1. Fixes #1708

Signed-off-by: Slava Koptilin 
---
 docs/_data/toc.yaml  |   2 +
 docs/_docs/sql-reference/ddl.adoc|  18 
 docs/_docs/sql-reference/distribution-zones.adoc | 119 +++
 3 files changed, 139 insertions(+)

diff --git a/docs/_data/toc.yaml b/docs/_data/toc.yaml
index 5bd7e9b2cf..2f2dec7c92 100644
--- a/docs/_data/toc.yaml
+++ b/docs/_data/toc.yaml
@@ -41,6 +41,8 @@
   url: sql-reference/ddl
 - title: Data Manipulation Language (DML)
   url: sql-reference/dml
+- title: Distribution Zones
+  url: sql-reference/distribution-zones
 - title: Supported Operators and Functions
   url: sql-reference/operators-and-functions
 - title: REST
diff --git a/docs/_docs/sql-reference/ddl.adoc 
b/docs/_docs/sql-reference/ddl.adoc
index caba17a2df..d7d5d8eacd 100644
--- a/docs/_docs/sql-reference/ddl.adoc
+++ b/docs/_docs/sql-reference/ddl.adoc
@@ -72,6 +72,7 @@ Parameters:
 
 ** `Replicas` - sets the number of partition copies, including the master copy.
 ** `Partitions` - sets the number of table partitions.
+** `PRIMARY_ZONE` - sets the link:distribution-zones[Distriburion Zone].
 ** Other parameters, depending on the database engine.
 
 
@@ -298,6 +299,23 @@ Drop Person table if the one exists:
 DROP TABLE IF EXISTS "Person";
 
 
+== DESCRIBE TABLE
+
+Returns information about the distribution zones of the table.
+
+[.diagram-container]
+Diagram(
+NonTerminal('DESCRIBE TABLE'),
+Optional('IF NOT EXISTS'),
+NonTerminal('qualified_table_name'),
+End({type:'complex'})
+)
+
+Parameters:
+
+- `IF EXISTS` - do not throw an error if a table with the same name does not 
exist.
+- `qualified_table_name` - the name of the table. Can be schema-qualified.
+
 == CREATE INDEX
 
 Creates a new index.
diff --git a/docs/_docs/sql-reference/distribution-zones.adoc 
b/docs/_docs/sql-reference/distribution-zones.adoc
new file mode 100644
index 00..22b0a3262f
--- /dev/null
+++ b/docs/_docs/sql-reference/distribution-zones.adoc
@@ -0,0 +1,119 @@
+// 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.
+= Distribution Zones
+
+This section describes Apache Ignite 3 distribution zones.
+
+== CREATE ZONE
+
+Creates a new distribution zone.
+
+[source,sql]
+
+CREATE ZONE [IF NOT EXISTS] qualified_zone_name [;]
+
+
+Parameters:
+
+
+* `qualified_zone_name` - name of the distribution zone. Can be 
schema-qualified.
+* `IF NOT EXISTS` - create a zone only if a different zone with the same name 
does not exist.
+//* `WITH` - accepts the following additional parameters:
+//- `DATA_NODES_AUTO_ADJUST` - the delay in seconds between any topology 
changes and the start of data zone adjustment.
+//- `DATA_NODES_AUTO_ADJUST_SCALE_UP` - the delay in seconds between the new 
node joining and the start of data zone adjustment.
+//- `DATA_NODES_AUTO_ADJUST_SCALE_DOWN` - the delay in seconds between the 
node leaving the cluster and the start of data zone adjustment.
+
+Examples:
+
+Creates an `exampleZone` distribution zone:
+
+[source,sql]
+
+CREATE ZONE IF NOT EXISTS exampleZone
+
+
+
+//Creates an `exampleZone` distribution zone that will only use nodes with SSD 
attribute and adjust 300 seconds after cluster topology changes:
+
+//[source,sql]
+//
+//CREATE ZONE IF NOT EXISTS exampleZone WITH DATA_NODES_AUTO_ADJUST=300
+//
+
+
+//== ALTER ZONE
+
+//Modifies an existing distribution zone.
+
+//[source,sql]
+//
+//ALTER ZONE IF EXISTS { 'qualified_zone_name' }
+//[WITH
+//[
+//([DATA_NODES_AUTO_ADJUST = adjust_value],
+//[DATA_NODES_AUTO_ADJUST_SCALE_UP = adjust_value],
+//[DATA_NODES_AUTO_ADJUST_SCALE_DOWN = adj

[ignite-3] branch main updated: IGNITE-18972 SSL configuration validation doesn't work (#1755)

2023-03-07 Thread apkhmv
This is an automated email from the ASF dual-hosted git repository.

apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new 411261841b IGNITE-18972 SSL configuration validation doesn't work 
(#1755)
411261841b is described below

commit 411261841bf8b7080ae3d44634df6e87fb52476e
Author: Vadim Pakhnushev <8614891+valep...@users.noreply.github.com>
AuthorDate: Tue Mar 7 12:36:42 2023 +0300

IGNITE-18972 SSL configuration validation doesn't work (#1755)
---
 .../ClientConnectorConfigurationSchema.java|  2 +
 .../configuration/NetworkConfigurationModule.java  |  7 +++
 .../SslConfigurationValidatorImpl.java |  8 +--
 .../SslConfigurationValidatorImplTest.java |  6 +--
 .../configuration/RestConfigurationModule.java |  8 ---
 .../configuration/RestConfigurationSchema.java |  2 +
 .../ItSslConfigurationValidationTest.java  | 58 ++
 7 files changed, 76 insertions(+), 15 deletions(-)

diff --git 
a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/configuration/ClientConnectorConfigurationSchema.java
 
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/configuration/ClientConnectorConfigurationSchema.java
index 22525e0572..837b959fad 100644
--- 
a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/configuration/ClientConnectorConfigurationSchema.java
+++ 
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/configuration/ClientConnectorConfigurationSchema.java
@@ -23,6 +23,7 @@ import 
org.apache.ignite.configuration.annotation.ConfigurationType;
 import org.apache.ignite.configuration.annotation.Value;
 import org.apache.ignite.configuration.validation.Range;
 import org.apache.ignite.internal.network.configuration.SslConfigurationSchema;
+import 
org.apache.ignite.internal.network.configuration.SslConfigurationValidator;
 
 /**
  * Configuration schema for thin client connector.
@@ -56,5 +57,6 @@ public class ClientConnectorConfigurationSchema {
 
 /** SSL configuration schema. */
 @ConfigValue
+@SslConfigurationValidator
 public SslConfigurationSchema ssl;
 }
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/configuration/NetworkConfigurationModule.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/configuration/NetworkConfigurationModule.java
index 3c25b93915..60aebb0c24 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/configuration/NetworkConfigurationModule.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/configuration/NetworkConfigurationModule.java
@@ -20,8 +20,10 @@ package org.apache.ignite.internal.network.configuration;
 import com.google.auto.service.AutoService;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Set;
 import org.apache.ignite.configuration.RootKey;
 import org.apache.ignite.configuration.annotation.ConfigurationType;
+import org.apache.ignite.configuration.validation.Validator;
 import org.apache.ignite.internal.configuration.ConfigurationModule;
 
 /**
@@ -38,4 +40,9 @@ public class NetworkConfigurationModule implements 
ConfigurationModule {
 public Collection> rootKeys() {
 return Collections.singleton(NetworkConfiguration.KEY);
 }
+
+@Override
+public Set> validators() {
+return Set.of(SslConfigurationValidatorImpl.INSTANCE);
+}
 }
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/configuration/SslConfigurationValidatorImpl.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/configuration/SslConfigurationValidatorImpl.java
index 03b8dbcb66..0efc970d06 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/configuration/SslConfigurationValidatorImpl.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/configuration/SslConfigurationValidatorImpl.java
@@ -30,13 +30,13 @@ import org.apache.ignite.configuration.validation.Validator;
 /**
  * SSL configuration validator implementation.
  */
-public class SslConfigurationValidatorImpl implements 
Validator {
+public class SslConfigurationValidatorImpl implements 
Validator {
 
 public static final SslConfigurationValidatorImpl INSTANCE = new 
SslConfigurationValidatorImpl();
 
 @Override
-public void validate(SslConfigurationValidator annotation, 
ValidationContext ctx) {
-SslView ssl = ctx.getNewValue();
+public void validate(SslConfigurationValidator annotation, 
ValidationContext ctx) {
+AbstractSslView ssl = ctx.getNewValue();
 if (ssl.enabled()) {
 validateKeyStore(ctx, ".keyStore", "Key store", ssl.keyStore());
 
@@ -51,7 +51,7 @@ public class SslConfigurationValidatorImpl implements 
Validator ctx, 
String keyName, String type, Ke

[ignite-3] branch main updated: IGNITE-18900 Sql. Remove hash function creation from ExecutionContext (#1756)

2023-03-07 Thread korlov
This is an automated email from the ASF dual-hosted git repository.

korlov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new 8314beacd1 IGNITE-18900 Sql. Remove hash function creation from 
ExecutionContext (#1756)
8314beacd1 is described below

commit 8314beacd11ef54690d2ca350a8a043bbf21e262
Author: korlov42 
AuthorDate: Tue Mar 7 11:42:24 2023 +0200

IGNITE-18900 Sql. Remove hash function creation from ExecutionContext 
(#1756)
---
 .../ignite/client/fakes/FakeInternalTable.java |  6 ++
 .../internal/sql/engine/exec/ExecutionContext.java | 65 +
 .../sql/engine/exec/ExecutionServiceImpl.java  |  3 +-
 .../sql/engine/schema/IgniteTableImpl.java | 66 +-
 .../sql/engine/exec/RuntimeSortedIndexTest.java|  1 -
 .../sql/engine/exec/rel/AbstractExecutionTest.java |  3 +-
 .../engine/exec/rel/MergeJoinExecutionTest.java|  2 +-
 .../sql/engine/framework/TestBuilders.java |  3 +-
 .../ignite/internal/table/InternalTable.java   |  8 +++
 .../distributed/storage/InternalTableImpl.java | 27 -
 10 files changed, 56 insertions(+), 128 deletions(-)

diff --git 
a/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeInternalTable.java
 
b/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeInternalTable.java
index 50036afd99..ba232b6580 100644
--- 
a/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeInternalTable.java
+++ 
b/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeInternalTable.java
@@ -100,6 +100,12 @@ public class FakeInternalTable implements InternalTable {
 return tableName;
 }
 
+/** {@inheritDoc} */
+@Override
+public int partitionId(BinaryRowEx row) {
+return 0;
+}
+
 /** {@inheritDoc} */
 @Override
 public CompletableFuture get(BinaryRowEx keyRow, @Nullable 
InternalTransaction tx) {
diff --git 
a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionContext.java
 
b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionContext.java
index 053c921b97..3a8770f1ea 100644
--- 
a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionContext.java
+++ 
b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionContext.java
@@ -20,8 +20,6 @@ package org.apache.ignite.internal.sql.engine.exec;
 import static org.apache.ignite.lang.ErrorGroups.Common.UNEXPECTED_ERR;
 
 import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -44,8 +42,6 @@ import 
org.apache.ignite.internal.sql.engine.metadata.FragmentDescription;
 import org.apache.ignite.internal.sql.engine.type.IgniteTypeFactory;
 import org.apache.ignite.internal.sql.engine.util.AbstractQueryContext;
 import org.apache.ignite.internal.sql.engine.util.BaseQueryContext;
-import org.apache.ignite.internal.sql.engine.util.HashFunctionFactory;
-import 
org.apache.ignite.internal.sql.engine.util.HashFunctionFactory.RowHashFunction;
 import org.apache.ignite.internal.sql.engine.util.TypeUtils;
 import org.apache.ignite.lang.IgniteInternalException;
 import org.apache.ignite.network.ClusterNode;
@@ -82,10 +78,7 @@ public class ExecutionContext extends 
AbstractQueryContext implements Data
 
 private final ExpressionFactory expressionFactory;
 
-private final HashFunctionFactory hashFunctionFactory;
-
 private final AtomicBoolean cancelFlag = new AtomicBoolean();
-private final Map> 
hashFunctionCache = new HashMap<>();
 
 /**
  * Need to store timestamp, since SQL standard says that functions such as 
CURRENT_TIMESTAMP return the same value throughout the
@@ -117,8 +110,7 @@ public class ExecutionContext extends 
AbstractQueryContext implements Data
 FragmentDescription fragmentDesc,
 RowHandler handler,
 Map params,
-TxAttributes txAttributes,
-HashFunctionFactory hashFunctionFactory
+TxAttributes txAttributes
 ) {
 super(qctx);
 
@@ -130,7 +122,6 @@ public class ExecutionContext extends 
AbstractQueryContext implements Data
 this.params = params;
 this.localNode = localNode;
 this.originatingNodeName = originatingNodeName;
-this.hashFunctionFactory = hashFunctionFactory;
 this.txAttributes = txAttributes;
 
 expressionFactory = new ExpressionFactoryImpl<>(
@@ -221,28 +212,6 @@ public class ExecutionContext extends 
AbstractQueryContext implements Data
 return localNode;
 }
 
-/**
- * Returns the function to compute colocation hash for specified table.
- *
- * @param tableId An identifier of a table. This identifier will be used 
to acquire expected types
- 

[ignite-3] branch main updated: IGNITE-18970 Allow WorkDirectoryExtension to preserve work directories of specific tests (#1753)

2023-03-07 Thread sdanilov
This is an automated email from the ASF dual-hosted git repository.

sdanilov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new b1128c227e IGNITE-18970 Allow WorkDirectoryExtension to preserve work 
directories of specific tests (#1753)
b1128c227e is described below

commit b1128c227edc07489a5045c269466f6c1c544407
Author: Semyon Danilov 
AuthorDate: Tue Mar 7 14:10:20 2023 +0400

IGNITE-18970 Allow WorkDirectoryExtension to preserve work directories of 
specific tests (#1753)
---
 .../testframework/WorkDirectoryExtensionTest.java  | 135 -
 .../testframework/WorkDirectoryExtension.java  | 111 ++---
 2 files changed, 228 insertions(+), 18 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/testframework/WorkDirectoryExtensionTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/testframework/WorkDirectoryExtensionTest.java
index d56f78ef1e..0ab278b651 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/testframework/WorkDirectoryExtensionTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/testframework/WorkDirectoryExtensionTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.testframework;
 
 import static 
org.apache.ignite.internal.testframework.JunitExtensionTestUtils.assertExecutesSuccessfully;
 import static 
org.apache.ignite.internal.testframework.JunitExtensionTestUtils.assertExecutesWithFailure;
+import static 
org.apache.ignite.internal.testframework.WorkDirectoryExtension.keepWorkDirPropertyValid;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.contains;
 import static org.hamcrest.Matchers.not;
@@ -31,8 +32,10 @@ import static 
org.junit.platform.testkit.engine.TestExecutionResultConditions.me
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.HashSet;
 import java.util.Set;
+import org.apache.ignite.internal.util.IgniteUtils;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
@@ -204,16 +207,33 @@ class WorkDirectoryExtensionTest {
 
 private static Path file2;
 
+private static Path file3;
+
+private static final String TMP_PATH;
+
+static {
+try {
+TMP_PATH = Files.createTempDirectory("testdir").toString();
+} catch (IOException e) {
+throw new RuntimeException(e);
+}
+}
+
 @AfterAll
-static void verify() throws IOException {
+static void verify() {
 assertTrue(Files.exists(file1));
 assertFalse(Files.exists(file2));
+assertFalse(Files.exists(file3));
+assertTrue(Files.exists(Paths.get(TMP_PATH)));
 
-Files.delete(file1);
+IgniteUtils.deleteIfExists(file1.getParent());
+IgniteUtils.deleteIfExists(Paths.get(TMP_PATH));
+
+System.clearProperty(WorkDirectoryExtension.ARTIFACT_DIR_PROPERTY);
 }
 
 @SuppressWarnings("AssignmentToStaticFieldFromInstanceMethod")
-@WithSystemProperty(key = 
WorkDirectoryExtension.KEEP_WORK_DIR_PROPERTY, value = "true")
+@WithSystemProperty(key = 
WorkDirectoryExtension.KEEP_WORK_DIR_PROPERTY, value = 
"SystemPropertiesTest.test1")
 @Test
 void test1(@WorkDirectory Path workDir) throws IOException {
 file1 = Files.createFile(workDir.resolve("foo"));
@@ -224,6 +244,83 @@ class WorkDirectoryExtensionTest {
 void test2(@WorkDirectory Path workDir) throws IOException {
 file2 = Files.createFile(workDir.resolve("foo"));
 }
+
+@SuppressWarnings("AssignmentToStaticFieldFromInstanceMethod")
+@WithSystemProperty(key = 
WorkDirectoryExtension.KEEP_WORK_DIR_PROPERTY, value = 
"SystemPropertiesTest.test3")
+@Test
+void test3(@WorkDirectory Path workDir) throws IOException {
+file3 = Files.createFile(workDir.resolve("foo"));
+
+System.setProperty(WorkDirectoryExtension.ARTIFACT_DIR_PROPERTY, 
TMP_PATH);
+}
+}
+
+/**
+ * Test class for the {@link #testSystemPropertyWithStaticWorkDir()} test.
+ */
+@ExtendWith(SystemPropertiesExtension.class)
+@ExtendWith(WorkDirectoryExtension.class)
+@WithSystemProperty(key = WorkDirectoryExtension.KEEP_WORK_DIR_PROPERTY, 
value = "SystemPropertiesTestWithStaticWorkDir")
+static class SystemPropertiesTestWithStaticWorkDir {
+private static Path file1;
+
+private static Path file2;
+
+@WorkDirectory
+static Path workDir;
+
+@AfterAll
+static void verify() {
+assertTrue(Files.exists(file1));
+assertTrue(Files.exists(file2));
+
+  

[ignite] branch IGNITE-17177_inc_snapshots updated (4206dec3834 -> 5af734f57ce)

2023-03-07 Thread timoninmaxim
This is an automated email from the ASF dual-hosted git repository.

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


from 4206dec3834 IGNITE-18967 Fix inc snapshot directories structure 
(#10580)
 add 5af734f57ce IGNITE-18975 Add incremental snapshot restore option to 
control.sh (#10582)

No new revisions were added by this update.

Summary of changes:
 .../snapshot/SnapshotRestoreCommand.java   | 21 +-
 .../snapshot/SnapshotRestoreCommandOption.java |  4 +
 .../apache/ignite/util/GridCommandHandlerTest.java | 85 +-
 .../GridCacheDatabaseSharedManager.java|  2 +-
 .../snapshot/IgniteSnapshotManager.java|  4 +-
 .../visor/snapshot/VisorSnapshotRestoreTask.java   |  2 +-
 .../snapshot/VisorSnapshotRestoreTaskArg.java  | 13 
 ...ridCommandHandlerClusterByClassTest_help.output | 11 +--
 ...andHandlerClusterByClassWithSSLTest_help.output | 11 +--
 9 files changed, 135 insertions(+), 18 deletions(-)



[ignite] branch IGNITE-17177_inc_snapshots updated (5af734f57ce -> 2d8e8250a05)

2023-03-07 Thread timoninmaxim
This is an automated email from the ASF dual-hosted git repository.

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


from 5af734f57ce IGNITE-18975 Add incremental snapshot restore option to 
control.sh (#10582)
 add 2d8e8250a05 MINOR: fix misprints, make logs more useful

No new revisions were added by this update.

Summary of changes:
 .../snapshot/SnapshotStatusCommand.java|  4 +-
 .../java/org/apache/ignite/IgniteSnapshot.java |  6 +--
 .../systemview/walker/SnapshotViewWalker.java  |  4 +-
 .../record/IncrementalSnapshotFinishRecord.java|  8 ++--
 .../cache/distributed/near/GridNearTxLocal.java|  2 +-
 .../snapshot/IgniteSnapshotManager.java| 44 ++
 .../snapshot/IncrementalSnapshotAwareMessage.java  |  2 +-
 .../snapshot/IncrementalSnapshotFutureTask.java| 15 +++-
 .../IncrementalSnapshotFutureTaskResult.java   | 22 ---
 .../snapshot/IncrementalSnapshotMarkWalFuture.java | 17 +
 .../snapshot/IncrementalSnapshotMetadata.java  |  4 +-
 .../persistence/snapshot/SnapshotMXBeanImpl.java   |  6 +--
 .../snapshot/SnapshotMetadataVerificationTask.java | 12 +++---
 .../SnapshotMetadataVerificationTaskArg.java   |  2 +-
 .../snapshot/SnapshotRestoreProcess.java   | 31 ---
 .../cache/transactions/IgniteInternalTx.java   |  4 +-
 .../cache/transactions/IgniteTxAdapter.java|  8 ++--
 .../cache/transactions/IgniteTxHandler.java|  8 ++--
 .../visor/snapshot/VisorSnapshotStatusTask.java|  4 +-
 .../org/apache/ignite/mxbean/SnapshotMXBean.java   |  2 +-
 .../ignite/spi/systemview/view/SnapshotView.java   |  6 +--
 .../ignite/internal/metric/SystemViewSelfTest.java |  4 +-
 .../snapshot/IgniteSnapshotMXBeanTest.java |  2 +-
 .../snapshot/IncrementalSnapshotMetricTest.java|  4 +-
 .../IncrementalSnapshotCheckBeforeRestoreTest.java | 10 ++---
 .../testsuites/IncrementalSnapshotsTestSuite.java  | 12 +++---
 26 files changed, 110 insertions(+), 133 deletions(-)
 delete mode 100644 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotFutureTaskResult.java



[ignite] branch IGNITE-17177_inc_snapshots updated (2d8e8250a05 -> 06ee012f2b4)

2023-03-07 Thread timoninmaxim
This is an automated email from the ASF dual-hosted git repository.

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


omit 2d8e8250a05 MINOR: fix misprints, make logs more useful
 add 06ee012f2b4 MINOR: fix misprints, make logs more useful

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2d8e8250a05)
\
 N -- N -- N   refs/heads/IGNITE-17177_inc_snapshots (06ee012f2b4)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 .../ignite/testsuites/IncrementalSnapshotsTestSuite.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)



[ignite-3] branch main updated: IGNITE-18835 Get rid of skipping safe time waiting on a primary node. (#1688)

2023-03-07 Thread vpyatkov
This is an automated email from the ASF dual-hosted git repository.

vpyatkov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
 new cd7d979901 IGNITE-18835 Get rid of skipping safe time waiting on a 
primary node. (#1688)
cd7d979901 is described below

commit cd7d97990125cb02b2401c6140ea98da3ca646e4
Author: Mirza Aliev 
AuthorDate: Tue Mar 7 21:12:18 2023 +0400

IGNITE-18835 Get rid of skipping safe time waiting on a primary node. 
(#1688)
---
 .../ItRaftCommandLeftInLogUntilRestartTest.java|   7 +-
 .../internal/table/ItReadOnlyTransactionTest.java  | 211 
 .../ignite/internal/table/ItRoReadsTest.java   | 543 +
 .../org/apache/ignite/internal/app/IgniteImpl.java |  10 +
 .../replicator/PartitionReplicaListener.java   |  20 +-
 .../table/impl/DummyInternalTableImpl.java |  55 ++-
 6 files changed, 835 insertions(+), 11 deletions(-)

diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItRaftCommandLeftInLogUntilRestartTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItRaftCommandLeftInLogUntilRestartTest.java
index 75688ae3e2..775a423dd7 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItRaftCommandLeftInLogUntilRestartTest.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItRaftCommandLeftInLogUntilRestartTest.java
@@ -32,7 +32,6 @@ import java.util.function.BiConsumer;
 import java.util.function.Consumer;
 import java.util.stream.IntStream;
 import org.apache.ignite.internal.app.IgniteImpl;
-import org.apache.ignite.internal.hlc.HybridClockImpl;
 import org.apache.ignite.internal.schema.BinaryRow;
 import org.apache.ignite.internal.schema.BinaryRowEx;
 import org.apache.ignite.internal.schema.marshaller.TupleMarshallerImpl;
@@ -175,9 +174,9 @@ public class ItRaftCommandLeftInLogUntilRestartTest extends 
ClusterPerClassInteg
 BinaryRowEx key = new 
TupleMarshallerImpl(table.schemaView()).marshal(Tuple.create().set("id", 42));
 
 if (isNode0Leader) {
-assertNull(table.internalTable().get(key, new 
HybridClockImpl().now(), node1.node()).get());
+assertNull(table.internalTable().get(key, node1.clock().now(), 
node1.node()).get());
 } else {
-assertNull(table.internalTable().get(key, new 
HybridClockImpl().now(), node0.node()).get());
+assertNull(table.internalTable().get(key, node1.clock().now(), 
node0.node()).get());
 }
 
 var tx = node0.transactions().begin();
@@ -275,7 +274,7 @@ public class ItRaftCommandLeftInLogUntilRestartTest extends 
ClusterPerClassInteg
 
 BinaryRowEx testKey = new 
TupleMarshallerImpl(table.schemaView()).marshal(Tuple.create().set("ID", 
row[0]));
 
-BinaryRow readOnlyRow = table.internalTable().get(testKey, new 
HybridClockImpl().now(), ignite.node()).get();
+BinaryRow readOnlyRow = table.internalTable().get(testKey, 
ignite.clock().now(), ignite.node()).get();
 
 assertNotNull(readOnlyRow);
 assertEquals(row[1], new Row(table.schemaView().schema(), 
readOnlyRow).stringValue(2));
diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItReadOnlyTransactionTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItReadOnlyTransactionTest.java
new file mode 100644
index 00..dfc77c4e62
--- /dev/null
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/table/ItReadOnlyTransactionTest.java
@@ -0,0 +1,211 @@
+/*
+ * 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.table;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.ArrayList;
+import java.util