(ignite-3) branch main updated: IGNITE-22736 Fix log buffers position change by unmarshalling process (#4086)

2024-07-15 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 8f510c448a IGNITE-22736 Fix log buffers position change by 
unmarshalling process (#4086)
8f510c448a is described below

commit 8f510c448a836ad7e9db18148e0b361326da7885
Author: Ivan Bessonov 
AuthorDate: Mon Jul 15 16:49:38 2024 +0300

IGNITE-22736 Fix log buffers position change by unmarshalling process 
(#4086)
---
 .../replicator/marshaller/PartitionCommandsMarshallerImpl.java  | 2 ++
 .../table/distributed/schema/PartitionCommandsMarshallerImpl.java   | 2 ++
 .../distributed/schema/PartitionCommandsMarshallerImplTest.java | 6 --
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/marshaller/PartitionCommandsMarshallerImpl.java
 
b/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/marshaller/PartitionCommandsMarshallerImpl.java
index 01c777f051..2d48f9ae17 100644
--- 
a/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/marshaller/PartitionCommandsMarshallerImpl.java
+++ 
b/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/marshaller/PartitionCommandsMarshallerImpl.java
@@ -43,6 +43,8 @@ public class PartitionCommandsMarshallerImpl extends 
OptimizedMarshaller impleme
 
 @Override
 public  T unmarshall(ByteBuffer raw) {
+raw = raw.duplicate();
+
 int requiredCatalogVersion = readRequiredCatalogVersion(raw);
 
 T res = super.unmarshall(raw);
diff --git 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImpl.java
 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImpl.java
index be82e953b8..c42cee416c 100644
--- 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImpl.java
+++ 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImpl.java
@@ -43,6 +43,8 @@ public class PartitionCommandsMarshallerImpl extends 
OptimizedMarshaller impleme
 
 @Override
 public  T unmarshall(ByteBuffer raw) {
+raw = raw.duplicate();
+
 int requiredCatalogVersion = readRequiredCatalogVersion(raw);
 
 T res = super.unmarshall(raw);
diff --git 
a/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImplTest.java
 
b/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImplTest.java
index cd4652b754..b93fcef3f3 100644
--- 
a/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImplTest.java
+++ 
b/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/schema/PartitionCommandsMarshallerImplTest.java
@@ -107,11 +107,13 @@ class PartitionCommandsMarshallerImplTest {
 NetworkMessage message = commandWithRequiredCatalogVersion(42);
 
 byte[] serialized = partitionCommandsMarshaller.marshall(message);
+ByteBuffer buffer = ByteBuffer.wrap(serialized);
 
-FinishTxCommand unmarshalled = 
partitionCommandsMarshaller.unmarshall(serialized);
+FinishTxCommand unmarshalled = 
partitionCommandsMarshaller.unmarshall(buffer);
 
 assertThat(unmarshalled.requiredCatalogVersion(), is(42));
+assertThat(buffer.position(), is(0));
 
-
assertThat(partitionCommandsMarshaller.readRequiredCatalogVersion(ByteBuffer.wrap(serialized)),
 is(42));
+
assertThat(partitionCommandsMarshaller.readRequiredCatalogVersion(buffer), 
is(42));
 }
 }



(ignite-3) branch main updated: IGNITE-22544 Benchmark and optimize raft commands serialization. (#3975)

2024-06-24 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 6969d1a0fa IGNITE-22544 Benchmark and optimize raft commands 
serialization. (#3975)
6969d1a0fa is described below

commit 6969d1a0fad24592b926acc522093d505b83a464
Author: Ivan Bessonov 
AuthorDate: Mon Jun 24 17:27:18 2024 +0300

IGNITE-22544 Benchmark and optimize raft commands serialization. (#3975)
---
 .../internal/network/processor/MessageClass.java   |   7 +
 .../processor/messages/MessageImplGenerator.java   |  17 ++
 .../serialization/MessageSerializerGenerator.java  |  16 +-
 .../SerializationFactoryGenerator.java |   2 +-
 .../ignite/internal/network/NetworkMessage.java|   6 +
 .../network/direct/DirectMessageWriter.java| 113 +
 .../network/direct/state/DirectMessageState.java   |   7 +-
 .../stream/DirectByteBufferStreamImplV1.java   | 272 -
 .../MessageSerializationRegistryImplTest.java  |   5 +
 .../internal/raft/util/DefaultByteBuffersPool.java |  57 -
 .../ignite/internal/raft/util/OptimizedStream.java |  96 +++-
 .../UpdateCommandsMarshalingMicroBenchmark.java| 162 
 12 files changed, 573 insertions(+), 187 deletions(-)

diff --git 
a/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/MessageClass.java
 
b/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/MessageClass.java
index 974ad2fe30..784d9c309c 100644
--- 
a/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/MessageClass.java
+++ 
b/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/MessageClass.java
@@ -169,6 +169,13 @@ public class MessageClass {
 return ClassName.get(packageName(), simpleName() + "Builder");
 }
 
+/**
+ * Returns class name that the generated Serializer should have.
+ */
+public ClassName serializerClassName() {
+return ClassName.get(packageName(), simpleName() + "Serializer");
+}
+
 /**
  * Returns name of the factory method that should be used by the message 
factories.
  *
diff --git 
a/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java
 
b/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java
index a90eef9500..3c17b3806a 100644
--- 
a/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java
+++ 
b/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java
@@ -56,6 +56,7 @@ import 
org.apache.ignite.internal.network.processor.MessageClass;
 import org.apache.ignite.internal.network.processor.MessageGroupWrapper;
 import org.apache.ignite.internal.network.processor.ProcessingException;
 import org.apache.ignite.internal.network.processor.TypeUtils;
+import org.apache.ignite.internal.network.serialization.MessageSerializer;
 import org.apache.ignite.internal.tostring.IgniteToStringExclude;
 import org.apache.ignite.internal.tostring.IgniteToStringInclude;
 import org.apache.ignite.internal.tostring.S;
@@ -205,6 +206,22 @@ public class MessageImplGenerator {
 .addMethods(methodImpls)
 .addMethod(constructor(fields, notNullFieldNames, 
marshallableFieldNames));
 
+if (message.isAutoSerializable()) {
+messageImpl.addMethod(MethodSpec.methodBuilder("serializer")
+.returns(MessageSerializer.class)
+.addModifiers(Modifier.PUBLIC)
+.addAnnotation(Override.class)
+.addCode("return $T.INSTANCE;", 
message.serializerClassName())
+.build());
+} else {
+messageImpl.addMethod(MethodSpec.methodBuilder("serializer")
+.returns(MessageSerializer.class)
+.addModifiers(Modifier.PUBLIC)
+.addAnnotation(Override.class)
+.addCode("return null;")
+.build());
+}
+
 // group type constant and getter
 FieldSpec groupTypeField = FieldSpec.builder(short.class, "GROUP_TYPE")
 .addModifiers(Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL)
diff --git 
a/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/serialization/MessageSerializerGenerator.java
 
b/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/serializati

(ignite-3) branch main updated: IGNITE-21661 Add test that reset partition can use data from a node outside of stable assignments (#3945)

2024-06-21 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 d34486b099 IGNITE-21661 Add test that reset partition can use data 
from a node outside of stable assignments (#3945)
d34486b099 is described below

commit d34486b099d8df0d17416e153ec71cdb087e3aed
Author: Ivan Bessonov 
AuthorDate: Fri Jun 21 12:23:39 2024 +0300

IGNITE-21661 Add test that reset partition can use data from a node outside 
of stable assignments (#3945)
---
 .../ignite/internal/affinity/Assignments.java  |  20 ++
 .../java/org/apache/ignite/lang/ErrorGroups.java   |   3 +
 .../distributionzones/rebalance/RebalanceUtil.java | 145 +-
 ...istributionZoneManagerScaleUpScaleDownTest.java |   5 +-
 .../DistributionZonesTestUtil.java |   2 +-
 .../impl/ItIdempotentCommandCacheTest.java |   2 +-
 .../internal/network/DefaultMessagingService.java  |   2 +-
 modules/platforms/cpp/ignite/common/error_codes.h  |   3 +-
 modules/platforms/cpp/ignite/odbc/common_types.cpp |   1 +
 .../platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs |   3 +
 .../org/apache/ignite/internal/app/IgniteImpl.java |   2 +-
 .../ItDisasterRecoveryReconfigurationTest.java | 211 +++-
 .../internal/table/distributed/TableManager.java   |   1 -
 .../disaster/DisasterRecoveryManager.java  |  29 +--
 .../distributed/disaster/GlobalPartitionState.java |  12 ++
 .../distributed/disaster/LocalPartitionState.java  |  11 +
 .../disaster/LocalPartitionStateByNode.java|   9 +-
 .../disaster/LocalPartitionStateMessageByNode.java |   5 +
 .../disaster/ManualGroupUpdateRequest.java | 221 -
 .../exceptions/DisasterRecoveryException.java  |   6 +-
 20 files changed, 521 insertions(+), 172 deletions(-)

diff --git 
a/modules/affinity/src/main/java/org/apache/ignite/internal/affinity/Assignments.java
 
b/modules/affinity/src/main/java/org/apache/ignite/internal/affinity/Assignments.java
index 2f0d7fcbee..6115122561 100644
--- 
a/modules/affinity/src/main/java/org/apache/ignite/internal/affinity/Assignments.java
+++ 
b/modules/affinity/src/main/java/org/apache/ignite/internal/affinity/Assignments.java
@@ -153,6 +153,26 @@ public class Assignments implements Serializable {
 return S.toString(this);
 }
 
+@Override
+public boolean equals(Object o) {
+if (this == o) {
+return true;
+}
+if (o == null || getClass() != o.getClass()) {
+return false;
+}
+
+Assignments that = (Assignments) o;
+return force == that.force && nodes.equals(that.nodes);
+}
+
+@Override
+public int hashCode() {
+int result = nodes.hashCode();
+result = 31 * result + Boolean.hashCode(force);
+return result;
+}
+
 /**
  * Creates a string representation of the given assignments list for 
logging usage purpose mostly.
  *
diff --git a/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java 
b/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
index 960f6e7821..232c8121db 100755
--- a/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
+++ b/modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java
@@ -623,5 +623,8 @@ public class ErrorGroups {
 
 /** Error while returning partition states. */
 public static final int PARTITION_STATE_ERR = 
RECOVERY_ERR_GROUP.registerErrorCode((short) 3);
+
+/** Error while returning partition states. */
+public static final int CLUSTER_NOT_IDLE_ERR = 
RECOVERY_ERR_GROUP.registerErrorCode((short) 4);
 }
 }
diff --git 
a/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java
 
b/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java
index edaef4609a..bc40b6caa3 100644
--- 
a/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java
+++ 
b/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java
@@ -58,10 +58,8 @@ import org.apache.ignite.internal.metastorage.Entry;
 import org.apache.ignite.internal.metastorage.MetaStorageManager;
 import org.apache.ignite.internal.metastorage.dsl.Condition;
 import org.apache.ignite.internal.metastorage.dsl.Iif;
-import org.apache.ignite.internal.metastorage.dsl.StatementResult;
 import org.apache.ignite.internal.replicator.TablePartitionId;
 import org.apache.ignite.internal.replicator.ZonePartitionId;
-import org.apache.ignite.internal.util.CollectionUtils;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -74,8 +72,7 @@ public class RebalanceUtil {
 
 /**
  * Status values for meth

(ignite-3) branch main updated: IGNITE-22502 Decrease default delay duration to 500 milliseconds (#3952)

2024-06-19 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 3cbc2d4677 IGNITE-22502 Decrease default delay duration to 500 
milliseconds (#3952)
3cbc2d4677 is described below

commit 3cbc2d4677858b9242de7bc953e01a439ea6e181
Author: Ivan Bessonov 
AuthorDate: Wed Jun 19 13:06:24 2024 +0300

IGNITE-22502 Decrease default delay duration to 500 milliseconds (#3952)
---
 .../configuration/SchemaSynchronizationConfigurationSchema.java| 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java
index f41d67a5c1..4e5c286eb5 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal.catalog.configuration;
 
-import java.util.concurrent.TimeUnit;
 import org.apache.ignite.configuration.annotation.ConfigurationRoot;
 import org.apache.ignite.configuration.annotation.ConfigurationType;
 import org.apache.ignite.configuration.annotation.Value;
@@ -35,7 +34,7 @@ public class SchemaSynchronizationConfigurationSchema {
 @Value(hasDefault = true)
 @Range(min = 1)
 @Immutable
-public long delayDuration = TimeUnit.SECONDS.toMillis(1);
+public long delayDuration = 500;
 
 /**
  * Max physical clock skew (ms) that is tolerated by the cluster. If 
difference between physical clocks of 2 nodes of a cluster



(ignite-3) branch main updated (9137608449 -> 143ba93fb5)

2024-06-11 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from 9137608449 IGNITE-21243 Bump calcite version to 1.37 (#3878)
 add 143ba93fb5 IGNITE-22443 Fix sporadic configuration tests failures 
(#3895)

No new revisions were added by this update.

Summary of changes:
 modules/configuration/build.gradle   | 1 +
 .../ignite/internal/configuration/ConfigurationChangerTest.java  | 8 +---
 .../ignite/internal/configuration/TestConfigurationChanger.java  | 9 +
 .../configuration/storage/LocalFileConfigurationStorageTest.java | 5 -
 4 files changed, 11 insertions(+), 12 deletions(-)



(ignite-3) branch main updated: IGNITE-22395 Remove assertions for paranoid leak detection property (#3864)

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

ibessonov 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 41007ff42d IGNITE-22395 Remove assertions for paranoid leak detection 
property (#3864)
41007ff42d is described below

commit 41007ff42df58e9651aeb3f9e0e520a27d5ff093
Author: Phillippko 
AuthorDate: Mon Jun 3 17:05:50 2024 +0400

IGNITE-22395 Remove assertions for paranoid leak detection property (#3864)
---
 .../cli/ParanoidLeakDetectionLevelTest.java| 33 --
 .../ParanoidLeakDetectionLevelPropertyTest.java| 31 
 .../network/ParanoidLeakDetectionLevelTest.java| 33 --
 .../ignite/internal/IgniteIntegrationTest.java |  8 --
 4 files changed, 105 deletions(-)

diff --git 
a/modules/cli/src/test/java/org/apache/ignite/internal/cli/ParanoidLeakDetectionLevelTest.java
 
b/modules/cli/src/test/java/org/apache/ignite/internal/cli/ParanoidLeakDetectionLevelTest.java
deleted file mode 100644
index 68770a9db0..00
--- 
a/modules/cli/src/test/java/org/apache/ignite/internal/cli/ParanoidLeakDetectionLevelTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.cli;
-
-import static io.netty.util.ResourceLeakDetector.Level.PARANOID;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-
-import io.netty.util.ResourceLeakDetector;
-import org.junit.jupiter.api.Test;
-
-/** Test checking that leak detection level is set to PARANOID for CLI unit 
tests. */
-public class ParanoidLeakDetectionLevelTest {
-@Test
-public void testParanoidLeakDetectionLevel() {
-assertThat(ResourceLeakDetector.getLevel(), is(PARANOID));
-}
-}
diff --git 
a/modules/jdbc/src/test/java/org/apache/ignite/internal/jdbc/ParanoidLeakDetectionLevelPropertyTest.java
 
b/modules/jdbc/src/test/java/org/apache/ignite/internal/jdbc/ParanoidLeakDetectionLevelPropertyTest.java
deleted file mode 100644
index 1abab7214e..00
--- 
a/modules/jdbc/src/test/java/org/apache/ignite/internal/jdbc/ParanoidLeakDetectionLevelPropertyTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.jdbc;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-
-import org.junit.jupiter.api.Test;
-
-/** Test checking that leak detection level property is set to PARANOID for 
JDBC unit tests. */
-public class ParanoidLeakDetectionLevelPropertyTest {
-@Test
-public void testParanoidLeakDetectionLevelProperty() {
-assertThat(System.getProperty("io.netty.leakDetectionLevel"), 
is("paranoid"));
-}
-}
diff --git 
a/modules/network/src/test/java/org/apache/ignite/internal/network/ParanoidLeakDetectionLevelTest.java
 
b/modules/network/src/test/java/org/apache/ignite/internal/network/ParanoidLeakDetectionLevelTest.java
deleted file mode 100644
index 3f7d1046c1..00
--- 
a/modules/network/src/test/java/org/apache/ignite/internal/network/ParanoidLeakDetectionLevelTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license ag

(ignite-3) branch main updated (7152f2c7ac -> 81db1d025a)

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

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


from 7152f2c7ac IGNITE-22355 TableManagerTest's static mocks from 
#mockManagersAndCreateTableWithDelay don't work properly (#3843)
 add 81db1d025a IGNITE-22058 Use paranoid leak detection in tests (#3826)

No new revisions were added by this update.

Summary of changes:
 buildscripts/java-integration-test.gradle |  3 ++-
 modules/cli/build.gradle  |  4 
 .../ignite/internal/cli/ParanoidLeakDetectionLevelTest.java}  | 11 +++
 .../java/org/apache/ignite/client/AbstractClientTest.java |  7 ---
 .../java/org/apache/ignite/client/PartitionAwarenessTest.java |  3 ---
 .../ignite/internal/testframework/BaseIgniteAbstractTest.java |  9 +
 modules/jdbc/build.gradle |  4 
 .../jdbc/ParanoidLeakDetectionLevelPropertyTest.java} |  9 +
 modules/network/build.gradle  |  4 
 ...iltInTypeTest.java => ParanoidLeakDetectionLevelTest.java} | 11 +++
 .../org/apache/ignite/internal/IgniteIntegrationTest.java |  8 
 11 files changed, 50 insertions(+), 23 deletions(-)
 copy 
modules/{network/src/test/java/org/apache/ignite/internal/network/serialization/BuiltInTypeTest.java
 => 
cli/src/test/java/org/apache/ignite/internal/cli/ParanoidLeakDetectionLevelTest.java}
 (70%)
 copy 
modules/{network/src/test/java/org/apache/ignite/internal/network/serialization/BuiltInTypeTest.java
 => 
jdbc/src/test/java/org/apache/ignite/internal/jdbc/ParanoidLeakDetectionLevelPropertyTest.java}
 (73%)
 copy 
modules/network/src/test/java/org/apache/ignite/internal/network/{serialization/BuiltInTypeTest.java
 => ParanoidLeakDetectionLevelTest.java} (70%)



(ignite-3) branch main updated (308cefb453 -> bb1bd8d2ed)

2024-05-31 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from 308cefb453 IGNITE-21965: Extend test coverage for SQL E071-02(Basic 
query expressions. UNION ALL table operator) (#3844)
 add bb1bd8d2ed IGNITE-22386 Fix revision serialization where it is 
required to be properly comparable (#3852)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/ignite/internal/util/ByteUtils.java | 44 ++
 .../apache/ignite/internal/util/ByteUtilsTest.java | 53 ++
 .../distributionzones/DistributionZoneManager.java | 10 ++--
 .../distributionzones/DistributionZonesUtil.java   | 21 +
 .../CausalityDataNodesEngine.java  |  8 ++--
 .../RebalanceRaftGroupEventsListener.java  |  9 ++--
 .../distributionzones/rebalance/RebalanceUtil.java | 10 ++--
 ...butionZoneManagerLogicalTopologyEventsTest.java | 10 ++--
 ...istributionZoneManagerScaleUpScaleDownTest.java | 15 +++---
 .../DistributionZonesTestUtil.java |  4 +-
 .../ignite/internal/utils/RebalanceUtilEx.java |  4 +-
 11 files changed, 145 insertions(+), 43 deletions(-)



(ignite-3) branch main updated (0978749e4e -> 7ac3f5ba1b)

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

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


from 0978749e4e IGNITE-22062 RO transaction does not close cursor when 
exception is thrown (#3620)
 add 7ac3f5ba1b IGNITE-21257 Introduce REST API for viewing partition 
states (#3614)

No new revisions were added by this update.

Summary of changes:
 .../DisasterRecoveryApi.java}  |  76 
 .../GlobalPartitionStateResponse.java} |  42 ++--
 .../GlobalPartitionStatesResponse.java}|  27 ++-
 .../LocalPartitionStateResponse.java}  |  50 +++--
 .../LocalPartitionStatesResponse.java} |  27 ++-
 .../handler/IgniteInternalExceptionHandler.java|  10 +
 modules/rest/build.gradle  |   2 +
 .../recovery/ItDisasterRecoveryControllerTest.java | 156 +++
 .../rest/recovery/DisasterRecoveryController.java  | 114 +++
 .../DisasterRecoveryFactory.java}  |  20 +-
 .../org/apache/ignite/internal/app/IgniteImpl.java |   5 +-
 .../ItDisasterRecoveryReconfigurationTest.java |   4 +-
 .../table/distributed/TableMessageGroup.java   |   4 +-
 .../disaster/DisasterRecoveryManager.java  | 217 -
 .../disaster/GlobalPartitionState.java}|  19 +-
 .../disaster/GlobalPartitionStateEnum.java}|  21 +-
 .../distributed/disaster/LocalPartitionState.java} |  34 ++--
 ...nState.java => LocalPartitionStateMessage.java} |   2 +-
 .../messages/LocalPartitionStatesResponse.java |   2 +-
 19 files changed, 625 insertions(+), 207 deletions(-)
 copy 
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/{metric/NodeMetricApi.java
 => recovery/DisasterRecoveryApi.java} (51%)
 copy 
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/{node/NodeState.java
 => recovery/GlobalPartitionStateResponse.java} (58%)
 copy 
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/{compute/UpdateJobPriorityBody.java
 => recovery/GlobalPartitionStatesResponse.java} (64%)
 copy 
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/{node/NodeState.java
 => recovery/LocalPartitionStateResponse.java} (52%)
 copy 
modules/rest-api/src/main/java/org/apache/ignite/internal/rest/api/{compute/UpdateJobPriorityBody.java
 => recovery/LocalPartitionStatesResponse.java} (64%)
 create mode 100644 
modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/recovery/ItDisasterRecoveryControllerTest.java
 create mode 100644 
modules/rest/src/main/java/org/apache/ignite/internal/rest/recovery/DisasterRecoveryController.java
 copy 
modules/rest/src/main/java/org/apache/ignite/internal/rest/{metrics/MetricRestFactory.java
 => recovery/DisasterRecoveryFactory.java} (64%)
 copy 
modules/{network/src/test/resources/org/apache/ignite/internal/network/processor/SecondGroup.java
 => 
table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GlobalPartitionState.java}
 (67%)
 copy 
modules/{sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/IgniteSqlStartTransactionMode.java
 => 
table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GlobalPartitionStateEnum.java}
 (67%)
 copy modules/{api/src/main/java/org/apache/ignite/table/criteria/Operator.java 
=> 
table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/LocalPartitionState.java}
 (65%)
 rename 
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/messages/{LocalPartitionState.java
 => LocalPartitionStateMessage.java} (96%)



(ignite-3) branch main updated: IGNITE-22041 Correct inline size calculation for indexes (#3622)

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

ibessonov 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 958b4a06fc IGNITE-22041 Correct inline size calculation for indexes 
(#3622)
958b4a06fc is described below

commit 958b4a06fc83c797194de84b7b21c64867351827
Author: Ivan Bessonov 
AuthorDate: Wed Apr 17 17:22:24 2024 +0300

IGNITE-22041 Correct inline size calculation for indexes (#3622)
---
 .../apache/ignite/internal/storage/pagememory/index/InlineUtils.java  | 2 ++
 .../internal/storage/pagememory/index/hash/io/HashIndexTreeIo.java| 2 +-
 .../storage/pagememory/index/sorted/io/SortedIndexTreeIo.java | 2 +-
 .../ignite/internal/storage/pagememory/index/InlineUtilsTest.java | 4 ++--
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/InlineUtils.java
 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/InlineUtils.java
index e6eb2f5e6e..515c1071ff 100644
--- 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/InlineUtils.java
+++ 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/InlineUtils.java
@@ -83,6 +83,8 @@ public class InlineUtils {
 return Math.min(MAX_VARLEN_INLINE_SIZE, ((VarlenNativeType) 
nativeType).length());
 
 case DECIMAL:
+return Short.BYTES + BIG_NUMBER_INLINE_SIZE;
+
 case NUMBER:
 return BIG_NUMBER_INLINE_SIZE;
 
diff --git 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/io/HashIndexTreeIo.java
 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/io/HashIndexTreeIo.java
index a6fe0fffb5..afba7d74f4 100644
--- 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/io/HashIndexTreeIo.java
+++ 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/hash/io/HashIndexTreeIo.java
@@ -64,7 +64,7 @@ import 
org.apache.ignite.internal.storage.pagememory.index.hash.HashIndexRowKey;
 public interface HashIndexTreeIo {
 /** Item size without index columns in bytes. */
 int ITEM_SIZE_WITHOUT_COLUMNS = Integer.BYTES // Index columns hash.
-+ Short.SIZE // Inlined index columns size.
++ Short.BYTES // Inlined index columns size.
 + PARTITIONLESS_LINK_SIZE_BYTES // Index columns link.
 + 2 * Long.BYTES; // Row ID.
 
diff --git 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/io/SortedIndexTreeIo.java
 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/io/SortedIndexTreeIo.java
index 89bcbd92a8..f677d8aeb7 100644
--- 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/io/SortedIndexTreeIo.java
+++ 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/sorted/io/SortedIndexTreeIo.java
@@ -56,7 +56,7 @@ import 
org.apache.ignite.internal.storage.pagememory.index.sorted.SortedIndexRow
  */
 public interface SortedIndexTreeIo {
 /** Item size without index columns in bytes. */
-int ITEM_SIZE_WITHOUT_COLUMNS = Short.SIZE // Inlined index columns size.
+int ITEM_SIZE_WITHOUT_COLUMNS = Short.BYTES // Inlined index columns size.
 + PARTITIONLESS_LINK_SIZE_BYTES // Index columns link.
 + 2 * Long.BYTES; // Row ID.
 
diff --git 
a/modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/index/InlineUtilsTest.java
 
b/modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/index/InlineUtilsTest.java
index ee9215584e..08060da9be 100644
--- 
a/modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/index/InlineUtilsTest.java
+++ 
b/modules/storage-page-memory/src/test/java/org/apache/ignite/internal/storage/pagememory/index/InlineUtilsTest.java
@@ -99,10 +99,10 @@ public class InlineUtilsTest extends BaseIgniteAbstractTest 
{
 
 // Variable length type checking.
 
-assertEquals(BIG_NUMBER_INLINE_SIZE, inlineSize(nativeType = 
NativeTypes.decimalOf(1, 1)));
+assertEquals(2 + BIG_NUMBER_INLINE_SIZE, inlineSize(nativeType = 
NativeTypes.decimalOf(1, 1)));
 nativeTypeSpecs.remove(nativeType.spec());
 
-assertEquals(BIG_NUMBER_INLINE_SIZE, inlineSize(nativeType = 
NativeTypes.decimalOf(100, 1)));
+assertEquals(2 + BIG_NUMBER_INLINE_SIZE, inlineSize(nativeType = 
NativeTypes.decimalOf(100, 1)));
 nativeTypeSpecs.remove

(ignite-3) branch main updated (e18c0a005f -> ad69dfd808)

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

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


from e18c0a005f IGNITE-22027 Disable destruction_does_not_update_data 
(#3617)
 add ad69dfd808 IGNITE-22055 Shut destruction executor down before closing 
volatile regions (#3616)

No new revisions were added by this update.

Summary of changes:
 .../internal/storage/pagememory/VolatilePageMemoryStorageEngine.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(ignite-3) branch main updated: IGNITE-22047 Ignore index destruction attempt if table storage is closed/destroyed (#3609)

2024-04-16 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 7306b533c0 IGNITE-22047 Ignore index destruction attempt if table 
storage is closed/destroyed (#3609)
7306b533c0 is described below

commit 7306b533c013cae1b5af517424e6a2cccef68d8d
Author: Roman Puchkovskiy 
AuthorDate: Tue Apr 16 16:16:03 2024 +0400

IGNITE-22047 Ignore index destruction attempt if table storage is 
closed/destroyed (#3609)
---
 .../internal/storage/engine/MvTableStorage.java|  2 +-
 .../storage/AbstractMvTableStorageTest.java| 27 ++
 .../pagememory/AbstractPageMemoryTableStorage.java | 10 ++--
 .../storage/rocksdb/RocksDbTableStorage.java   | 26 -
 4 files changed, 51 insertions(+), 14 deletions(-)

diff --git 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/engine/MvTableStorage.java
 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/engine/MvTableStorage.java
index 3601a6fe3e..bcb4f58b3a 100644
--- 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/engine/MvTableStorage.java
+++ 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/engine/MvTableStorage.java
@@ -118,7 +118,7 @@ public interface MvTableStorage extends ManuallyCloseable {
 /**
  * Destroys the index with the given ID and all data in it.
  *
- * This method is a no-op if the index with the given ID does not exist.
+ * This method is a no-op if the index with the given ID does not exist 
or if the table storage is closed or under destruction.
  *
  * @param indexId Index ID.
  */
diff --git 
a/modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java
 
b/modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java
index a443ba8740..93eb0fd0b6 100644
--- 
a/modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java
+++ 
b/modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java
@@ -324,6 +324,33 @@ public abstract class AbstractMvTableStorageTest extends 
BaseMvStoragesTest {
 assertThat(tableStorage.getIndex(PARTITION_ID, hashIdx.id()), 
is(nullValue()));
 }
 
+/**
+ * Tests that an attempt to destroy an index in a table storage that is 
already destroyed does not
+ * cause an exception.
+ */
+@ParameterizedTest
+@ValueSource(booleans = {false, true})
+public void indexDestructionDoesNotFailIfTableStorageIsDestroyed(boolean 
waitForDestroyFuture) throws Exception {
+MvPartitionStorage partitionStorage = 
getOrCreateMvPartition(PARTITION_ID);
+
+SortedIndexStorage sortedIndexStorage = 
tableStorage.getOrCreateSortedIndex(PARTITION_ID, sortedIdx);
+assertThat(sortedIndexStorage, is(notNullValue()));
+
+HashIndexStorage hashIndexStorage = 
tableStorage.getOrCreateHashIndex(PARTITION_ID, hashIdx);
+assertThat(hashIndexStorage, is(notNullValue()));
+
+assertThat(partitionStorage.flush(), willCompleteSuccessfully());
+
+CompletableFuture destroyTableStorageFuture = 
tableStorage.destroy();
+
+if (waitForDestroyFuture) {
+assertThat(destroyTableStorageFuture, willCompleteSuccessfully());
+}
+
+assertDoesNotThrow(() -> 
tableStorage.destroyIndex(sortedIdx.id()).get(10, SECONDS));
+assertDoesNotThrow(() -> 
tableStorage.destroyIndex(hashIdx.id()).get(10, SECONDS));
+}
+
 /**
  * Tests that removing one Sorted Index does not affect the data in the 
other.
  */
diff --git 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java
 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java
index 8260a927d3..6a492da3a9 100644
--- 
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java
+++ 
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java
@@ -180,7 +180,11 @@ public abstract class AbstractPageMemoryTableStorage 
implements MvTableStorage {
 
 @Override
 public CompletableFuture destroyIndex(int indexId) {
-return busy(() -> {
+if (!busyLock.enterBusy()) {
+return nullCompletedFuture();
+}
+
+try {
 List storages = 
mvPartitionStorages.getAll();
 
 var destroyFutures = new CompletableFuture[storages.size()];
@@ -192,7 +196,9 @@ public abstract class AbstractPageMemoryTableStorage 
implements MvTab

(ignite-3) branch main updated: IGNITE-21902 Add an option to configure log storage path (#3605)

2024-04-15 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 79d5bc824d IGNITE-21902 Add an option to configure log storage path 
(#3605)
79d5bc824d is described below

commit 79d5bc824d001f97f09e9b06ec9f5a5a094fb15e
Author: Phillippko 
AuthorDate: Mon Apr 15 19:02:28 2024 +0400

IGNITE-21902 Add an option to configure log storage path (#3605)
---
 .../server/raft/ItMetaStorageRaftGroupTest.java|  24 -
 .../configuration/RaftConfigurationSchema.java |   4 +
 .../ignite/raft/server/ItJraftHlcServerTest.java   |  12 +--
 .../raft/server/ItJraftServerLogPathTest.java  | 113 +
 .../raft/server/ItSimpleCounterServerTest.java |   7 +-
 .../ignite/raft/server/JraftAbstractTest.java  |  17 +---
 .../ignite/raft/server/RaftServerAbstractTest.java |  34 +++
 .../java/org/apache/ignite/internal/raft/Loza.java |   2 +-
 .../internal/raft/server/impl/JraftServerImpl.java |  41 ++--
 .../storage/impl/DefaultLogStorageFactory.java |  21 ++--
 .../raft/storage/logit/LogitLogStorageFactory.java |  17 ++--
 .../ignite/raft/jraft/option/NodeOptions.java  |   1 -
 .../jraft/storage/impl/LogStorageBenchmark.java|   2 +-
 .../jraft/storage/logit/LogitLogStorageTest.java   |   3 +-
 .../service/ItAbstractListenerSnapshotTest.java|   2 +-
 .../AbstractTopologyAwareGroupServiceTest.java |   1 +
 16 files changed, 233 insertions(+), 68 deletions(-)

diff --git 
a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/server/raft/ItMetaStorageRaftGroupTest.java
 
b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/server/raft/ItMetaStorageRaftGroupTest.java
index fc29e48c7f..e3e6907dbc 100644
--- 
a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/server/raft/ItMetaStorageRaftGroupTest.java
+++ 
b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/server/raft/ItMetaStorageRaftGroupTest.java
@@ -365,11 +365,29 @@ public class ItMetaStorageRaftGroupTest extends 
IgniteAbstractTest {
 List.of(new 
UserReplicatorStateListener(replicatorStartedCounter, 
replicatorStoppedCounter)));
 opt3.setCommandsMarshaller(commandsMarshaller);
 
-metaStorageRaftSrv1 = new JraftServerImpl(cluster.get(0), 
workDir.resolve("node1"), opt1, new RaftGroupEventsClientListener());
+metaStorageRaftSrv1 = new JraftServerImpl(
+cluster.get(0),
+workDir.resolve("node1"),
+raftConfiguration,
+opt1,
+new RaftGroupEventsClientListener()
+);
 
-metaStorageRaftSrv2 = new JraftServerImpl(cluster.get(1), 
workDir.resolve("node2"), opt2, new RaftGroupEventsClientListener());
+metaStorageRaftSrv2 = new JraftServerImpl(
+cluster.get(1),
+workDir.resolve("node2"),
+raftConfiguration,
+opt2,
+new RaftGroupEventsClientListener()
+);
 
-metaStorageRaftSrv3 = new JraftServerImpl(cluster.get(2), 
workDir.resolve("node3"), opt3, new RaftGroupEventsClientListener());
+metaStorageRaftSrv3 = new JraftServerImpl(
+cluster.get(2),
+workDir.resolve("node3"),
+raftConfiguration,
+opt3,
+new RaftGroupEventsClientListener()
+);
 
 metaStorageRaftSrv1.start();
 
diff --git 
a/modules/raft-api/src/main/java/org/apache/ignite/internal/raft/configuration/RaftConfigurationSchema.java
 
b/modules/raft-api/src/main/java/org/apache/ignite/internal/raft/configuration/RaftConfigurationSchema.java
index ff888b4425..b31714a049 100644
--- 
a/modules/raft-api/src/main/java/org/apache/ignite/internal/raft/configuration/RaftConfigurationSchema.java
+++ 
b/modules/raft-api/src/main/java/org/apache/ignite/internal/raft/configuration/RaftConfigurationSchema.java
@@ -83,4 +83,8 @@ public class RaftConfigurationSchema {
  */
 @Value(hasDefault = true)
 public boolean logYieldStrategy = false;
+
+/** Directory where log is stored. By default "log" subfolder of data 
storage path is used. */
+@Value(hasDefault = true)
+public String logPath = "";
 }
diff --git 
a/modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItJraftHlcServerTest.java
 
b/modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItJraftHlcServerTest.java
index 5c70787eb7..8ff1d94fdc 100644
--- 
a/modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItJraftHlcServerTest.java
+++ 
b/modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItJraftHlcServerTest

(ignite-3) branch main updated: IGNITE-21987 Optimize RO scan in sorted indexes (#3566)

2024-04-11 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 34354d2a59 IGNITE-21987 Optimize RO scan in sorted indexes (#3566)
34354d2a59 is described below

commit 34354d2a59caddafdc287a81848c4dde68bbcde0
Author: Phillippko 
AuthorDate: Thu Apr 11 16:34:39 2024 +0400

IGNITE-21987 Optimize RO scan in sorted indexes (#3566)
---
 .../processor/messages/MessageImplGenerator.java   |   1 -
 .../internal/storage/index/SortedIndexStorage.java |  23 ++-
 .../index/ThreadAssertingSortedIndexStorage.java   |   7 +
 .../storage/index/TestSortedIndexStorageTest.java  |   5 +
 .../index/AbstractSortedIndexStorageTest.java  | 187 +++--
 .../index/sorted/PageMemorySortedIndexStorage.java |  22 +++
 .../rocksdb/index/RocksDbSortedIndexStorage.java   | 117 ++---
 .../replicator/PartitionReplicaListener.java   |   2 +-
 8 files changed, 287 insertions(+), 77 deletions(-)

diff --git 
a/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java
 
b/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java
index c9c81509f7..a90eef9500 100644
--- 
a/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java
+++ 
b/modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java
@@ -222,7 +222,6 @@ public class MessageImplGenerator {
 
 messageImpl.addMethod(groupTypeMethod);
 
-// TODO: https://issues.apache.org/jira/browse/IGNITE-17591
 MethodSpec toStringMethod = MethodSpec.methodBuilder("toString")
 .addAnnotation(Override.class)
 .addModifiers(Modifier.PUBLIC)
diff --git 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/SortedIndexStorage.java
 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/SortedIndexStorage.java
index d3dd0bf90f..16abcc684e 100644
--- 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/SortedIndexStorage.java
+++ 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/SortedIndexStorage.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.storage.index;
 
 import org.apache.ignite.internal.schema.BinaryTuplePrefix;
 import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.util.Cursor;
 import org.intellij.lang.annotations.MagicConstant;
 import org.jetbrains.annotations.Nullable;
 
@@ -47,7 +48,7 @@ public interface SortedIndexStorage extends IndexStorage {
 StorageSortedIndexDescriptor indexDescriptor();
 
 /**
- * Returns a range of index values between the lower bound and the upper 
bound.
+ * Returns a range of updatable index values between the lower bound and 
the upper bound, supporting read-write transactions.
  *
  * @param lowerBound Lower bound. Exclusivity is controlled by a {@link 
#GREATER_OR_EQUAL} or {@link #GREATER} flag.
  *  {@code null} means unbounded.
@@ -63,4 +64,24 @@ public interface SortedIndexStorage extends IndexStorage {
 @Nullable BinaryTuplePrefix upperBound,
 @MagicConstant(flagsFromClass = SortedIndexStorage.class) int flags
 );
+
+/**
+ * Returns a range of index values between the lower bound and the upper 
bound, use in read-only transactions.
+ *
+ * @param lowerBound Lower bound. Exclusivity is controlled by a {@link 
#GREATER_OR_EQUAL} or {@link #GREATER} flag.
+ *  {@code null} means unbounded.
+ * @param upperBound Upper bound. Exclusivity is controlled by a {@link 
#LESS} or {@link #LESS_OR_EQUAL} flag.
+ *  {@code null} means unbounded.
+ * @param flags Control flags. {@link #GREATER} | {@link #LESS} by 
default. Other available values
+ *  are {@link #GREATER_OR_EQUAL}, {@link #LESS_OR_EQUAL}.
+ * @return Cursor with fetched index rows.
+ * @throws IllegalArgumentException If backwards flag is passed and 
backwards iteration is not supported by the storage.
+ */
+default Cursor readOnlyScan(
+@Nullable BinaryTuplePrefix lowerBound,
+@Nullable BinaryTuplePrefix upperBound,
+@MagicConstant(flagsFromClass = SortedIndexStorage.class) int flags
+) {
+return scan(lowerBound, upperBound, flags);
+}
 }
diff --git 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/ThreadAssertingSortedIndexStorage.java
 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/ThreadAssertingSortedIndexStorage.java
index 0b61260cfc..7b202b6f36 100644
--- 
a/modul

(ignite-3) branch main updated: IGNITE-21933 Fix TxStateStorage#leaseStartTime possible inconsistency with partition storage (#3551)

2024-04-11 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 94b064ab89 IGNITE-21933 Fix TxStateStorage#leaseStartTime possible 
inconsistency with partition storage (#3551)
94b064ab89 is described below

commit 94b064ab89faf6b4d5e933ae37b8093f6673023e
Author: Denis Chudov 
AuthorDate: Thu Apr 11 13:41:28 2024 +0300

IGNITE-21933 Fix TxStateStorage#leaseStartTime possible inconsistency with 
partition storage (#3551)
---
 check-rules/spotbugs-excludes.xml  |  1 +
 .../pagememory/persistence/PartitionMeta.java  | 47 ++-
 .../pagememory/persistence/io/PartitionMetaIo.java | 27 +
 .../persistence/PartitionMetaManagerTest.java  |  7 ++-
 .../pagememory/persistence/PartitionMetaTest.java  |  2 +-
 .../persistence/checkpoint/CheckpointerTest.java   |  2 +-
 .../internal/storage/MvPartitionStorage.java   | 14 +
 .../storage/ThreadAssertingMvPartitionStorage.java | 12 
 .../storage/AbstractMvPartitionStorageTest.java| 23 
 .../storage/impl/TestMvPartitionStorage.java   | 22 +++
 .../mv/PersistentPageMemoryMvPartitionStorage.java | 20 +++
 .../mv/VolatilePageMemoryMvPartitionStorage.java   | 28 +
 .../storage/rocksdb/RocksDbMetaStorage.java|  5 ++
 .../storage/rocksdb/RocksDbMvPartitionStorage.java | 52 +++-
 .../rocksdb/instance/SharedRocksDbInstance.java|  2 +
 .../distributed/raft/PartitionDataStorage.java | 14 +
 .../table/distributed/raft/PartitionListener.java  | 20 +--
 .../SnapshotAwarePartitionDataStorage.java | 10 
 .../distributed/TestPartitionDataStorage.java  | 10 
 .../state/ThreadAssertingTxStateStorage.java   | 14 -
 .../internal/tx/storage/state/TxStateStorage.java  | 16 -
 .../state/rocksdb/TxStateRocksDbStorage.java   | 69 --
 .../storage/state/AbstractTxStateStorageTest.java  | 33 ---
 .../tx/storage/state/test/TestTxStateStorage.java  | 22 ---
 24 files changed, 306 insertions(+), 166 deletions(-)

diff --git a/check-rules/spotbugs-excludes.xml 
b/check-rules/spotbugs-excludes.xml
index a25c91874a..acf0541bb5 100644
--- a/check-rules/spotbugs-excludes.xml
+++ b/check-rules/spotbugs-excludes.xml
@@ -214,6 +214,7 @@
   
   
   
+  
 
   
   
diff --git 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PartitionMeta.java
 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PartitionMeta.java
index 85e9c8424e..e752116834 100644
--- 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PartitionMeta.java
+++ 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PartitionMeta.java
@@ -50,6 +50,8 @@ public class PartitionMeta {
 
 private volatile long lastAppliedTerm;
 
+private volatile long leaseStartTime;
+
 private volatile long lastReplicationProtocolGroupConfigFirstPageId;
 
 private volatile long rowVersionFreeListRootPageId;
@@ -93,7 +95,8 @@ public class PartitionMeta {
 long versionChainTreeRootPageId,
 long indexTreeMetaPageId,
 long gcQueueMetaPageId,
-int pageCount
+int pageCount,
+long leaseStartTime
 ) {
 this.lastAppliedIndex = lastAppliedIndex;
 this.lastAppliedTerm = lastAppliedTerm;
@@ -104,6 +107,7 @@ public class PartitionMeta {
 this.indexTreeMetaPageId = indexTreeMetaPageId;
 this.gcQueueMetaPageId = gcQueueMetaPageId;
 this.pageCount = pageCount;
+this.leaseStartTime = leaseStartTime;
 
 metaSnapshot = new PartitionMetaSnapshot(checkpointId, this);
 }
@@ -126,7 +130,8 @@ public class PartitionMeta {
 metaIo.getVersionChainTreeRootPageId(pageAddr),
 metaIo.getIndexTreeMetaPageId(pageAddr),
 metaIo.getGcQueueMetaPageId(pageAddr),
-metaIo.getPageCount(pageAddr)
+metaIo.getPageCount(pageAddr),
+metaIo.getLeaseStartTime(pageAddr)
 );
 }
 
@@ -318,6 +323,31 @@ public class PartitionMeta {
 return S.toString(PartitionMeta.class, this);
 }
 
+/**
+ * Updates the current lease start time in the storage.
+ *
+ * @param checkpointId Checkpoint ID.
+ * @param leaseStartTime Lease start time.
+ */
+public void updateLease(@Nullable UUID checkpointId, long leaseStartTime) {
+updateSnapshot(checkpointId);
+
+if (leaseStartTime <= this.leaseStartTime) {
+return;
+}
+
+this.leaseStartTime = leaseStartTime;
+}
+
+/**
+ * Return the start time of the known lease for this replication gr

(ignite-3) branch main updated: IGNITE-21995 Do not disable thread assertions in tests (#3565)

2024-04-09 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 77bbc39bff IGNITE-21995 Do not disable thread assertions in tests 
(#3565)
77bbc39bff is described below

commit 77bbc39bff10605e7a3c36359fe88d9c39ffe7a5
Author: Roman Puchkovskiy 
AuthorDate: Tue Apr 9 18:53:44 2024 +0400

IGNITE-21995 Do not disable thread assertions in tests (#3565)
---
 .../apache/ignite/internal/wrapper/Wrappers.java   |  22 -
 ...IndexNodeFinishedRwTransactionsCheckerTest.java |  10 +-
 .../ItPrimaryReplicaChoiceTest.java| 110 +
 .../ignite/internal/table/ItTableScanTest.java |  17 ++--
 .../storage/ThreadAssertingMvPartitionStorage.java |   8 +-
 .../storage/index/ThreadAssertingIndexStorage.java |   8 +-
 6 files changed, 120 insertions(+), 55 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/wrapper/Wrappers.java 
b/modules/core/src/main/java/org/apache/ignite/internal/wrapper/Wrappers.java
index d67e8d6322..3120229e91 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/wrapper/Wrappers.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/wrapper/Wrappers.java
@@ -17,21 +17,41 @@
 
 package org.apache.ignite.internal.wrapper;
 
+import org.jetbrains.annotations.Nullable;
+
 /**
  * Utils for unwrapping {@link Wrapper} instances.
  */
 public class Wrappers {
 /**
- * Unwraps an object. Either invokes {@link Wrapper#unwrap(Class)} if it's 
a Wrapper, or tries to cast directly otherwise.
+ * Unwraps an object (that is not {@code null}). Either invokes {@link 
Wrapper#unwrap(Class)} if it's a Wrapper, or tries to cast
+ * directly otherwise.
  *
  * @param object Object to unwrap.
  * @param classToUnwrap Class which is to be unwrapped.
  */
 public static  T unwrap(Object object, Class classToUnwrap) {
+assert object != null : "Object to unwrap is null";
+
 if (object instanceof Wrapper) {
 return ((Wrapper) object).unwrap(classToUnwrap);
 }
 
 return classToUnwrap.cast(object);
 }
+
+/**
+ * Unwraps an object or returns {@code null} if it's {@code null}.
+ *
+ * @param object Object to unwrap.
+ * @param classToUnwrap Class which is to be unwrapped.
+ * @see #unwrap(Object, Class)
+ */
+public static @Nullable  T unwrapNullable(@Nullable Object object, 
Class classToUnwrap) {
+if (object == null) {
+return null;
+}
+
+return unwrap(object, classToUnwrap);
+}
 }
diff --git 
a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexNodeFinishedRwTransactionsCheckerTest.java
 
b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexNodeFinishedRwTransactionsCheckerTest.java
index d6c9a40d68..8120d9b4a3 100644
--- 
a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexNodeFinishedRwTransactionsCheckerTest.java
+++ 
b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItIndexNodeFinishedRwTransactionsCheckerTest.java
@@ -36,15 +36,15 @@ import 
org.apache.ignite.internal.ClusterPerClassIntegrationTest;
 import org.apache.ignite.internal.app.IgniteImpl;
 import org.apache.ignite.internal.index.message.IndexMessagesFactory;
 import 
org.apache.ignite.internal.index.message.IsNodeFinishedRwTransactionsStartedBeforeResponse;
-import org.apache.ignite.internal.lang.IgniteSystemProperties;
 import org.apache.ignite.internal.network.NetworkMessage;
 import org.apache.ignite.internal.storage.MvPartitionStorage;
 import org.apache.ignite.internal.storage.engine.MvTableStorage;
+import org.apache.ignite.internal.storage.impl.TestMvPartitionStorage;
 import 
org.apache.ignite.internal.storage.impl.schema.TestProfileConfigurationSchema;
 import org.apache.ignite.internal.table.InternalTable;
 import org.apache.ignite.internal.table.TableImpl;
 import org.apache.ignite.internal.testframework.IgniteTestUtils;
-import org.apache.ignite.internal.testframework.WithSystemProperty;
+import org.apache.ignite.internal.wrapper.Wrappers;
 import org.apache.ignite.table.Table;
 import org.apache.ignite.table.Tuple;
 import org.apache.ignite.tx.Transaction;
@@ -56,7 +56,6 @@ import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 
 /** For testing {@link IndexNodeFinishedRwTransactionsChecker}. */
-@WithSystemProperty(key = IgniteSystemProperties.THREAD_ASSERTIONS_ENABLED, 
value = "false")
 public class ItIndexNodeFinishedRwTransactionsCheckerTest extends 
ClusterPerClassIntegrationTest {
 private static final IndexMessagesFactory FACTORY = new 
IndexMessagesFactory();
 
@@ -282,7 +281,10 @@ public class ItIndexNodeFinishedRwTra

(ignite-3) branch main updated: IGNITE-21301 Sync raft log before flush in all storage engines (#3535)

2024-04-04 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 5180c53f7d IGNITE-21301 Sync raft log before flush in all storage 
engines (#3535)
5180c53f7d is described below

commit 5180c53f7dad7923efa98604b5690dc7b3b5b3a5
Author: Phillippko 
AuthorDate: Thu Apr 4 18:03:58 2024 +0400

IGNITE-21301 Sync raft log before flush in all storage engines (#3535)
---
 .../ignite/internal/components/LogSyncer.java} | 29 +-
 .../persistence/checkpoint/CheckpointManager.java  |  5 +++-
 .../persistence/checkpoint/Checkpointer.java   | 16 +++-
 .../PersistentPageMemoryNoLoadTest.java|  2 ++
 .../checkpoint/CheckpointManagerTest.java  |  3 +++
 .../persistence/checkpoint/CheckpointerTest.java   | 28 +++--
 .../apache/ignite/internal/raft/RaftManager.java   |  4 +++
 .../raft/ItTruncateSuffixAndRestartTest.java   |  4 +++
 .../java/org/apache/ignite/internal/raft/Loza.java |  6 +
 .../internal/raft/server/impl/JraftServerImpl.java |  6 +
 .../internal/raft/storage/LogStorageFactory.java   |  3 ++-
 .../storage/impl/DefaultLogStorageFactory.java |  6 +
 .../raft/storage/impl/LocalLogStorageFactory.java  |  5 
 .../storage/impl/VolatileLogStorageFactory.java|  5 
 .../raft/storage/logit/LogitLogStorageFactory.java |  6 +
 .../rocksdb/flush/RocksDbFlushListener.java| 19 +-
 .../internal/rocksdb/flush/RocksDbFlusher.java |  9 ---
 .../runner/app/ItIgniteNodeRestartTest.java|  3 ++-
 .../org/apache/ignite/internal/app/IgniteImpl.java |  6 -
 .../ignite/internal/storage/DataStorageModule.java |  5 +++-
 .../internal/storage/DataStorageModules.java   | 14 ---
 .../internal/storage/DataStorageManagerTest.java   |  9 +--
 .../internal/storage/DataStorageModulesTest.java   |  6 +++--
 .../storage/engine/AbstractStorageEngineTest.java  | 21 
 .../storage/impl/TestDataStorageModule.java|  4 ++-
 .../PersistentPageMemoryDataStorageModule.java |  7 --
 .../PersistentPageMemoryStorageEngine.java |  9 ++-
 .../VolatilePageMemoryDataStorageModule.java   |  4 ++-
 .../PersistentPageMemoryMvTableStorageTest.java| 11 +++-
 .../PersistentPageMemoryStorageEngineTest.java |  3 ++-
 .../PersistentPageMemoryHashIndexStorageTest.java  | 11 +++-
 ...PersistentPageMemorySortedIndexStorageTest.java |  5 +++-
 ...ageMemoryMvPartitionStorageConcurrencyTest.java | 11 +++-
 ...rsistentPageMemoryMvPartitionStorageGcTest.java | 11 +++-
 ...PersistentPageMemoryMvPartitionStorageTest.java | 11 +++-
 .../storage/rocksdb/RocksDbDataStorageModule.java  |  6 +++--
 .../storage/rocksdb/RocksDbStorageEngine.java  | 11 +++-
 .../instance/SharedRocksDbInstanceCreator.java |  1 +
 .../RocksDbMvPartitionStorageConcurrencyTest.java  |  3 ++-
 .../rocksdb/RocksDbMvPartitionStorageGcTest.java   |  3 ++-
 .../rocksdb/RocksDbMvPartitionStorageTest.java |  3 ++-
 .../storage/rocksdb/RocksDbMvTableStorageTest.java |  4 ++-
 .../storage/rocksdb/RocksDbStorageEngineTest.java  |  3 ++-
 .../rocksdb/engine/RocksDbStorageEngineTest.java   |  3 ++-
 .../rocksdb/index/RocksDbHashIndexStorageTest.java |  3 ++-
 .../index/RocksDbSortedIndexStorageTest.java   |  3 ++-
 .../instance/SharedRocksDbInstanceTest.java|  4 ++-
 .../rebalance/ItRebalanceDistributedTest.java  |  3 ++-
 .../internal/table/distributed/TableManager.java   |  1 +
 .../distributed/TableManagerRecoveryTest.java  | 22 +---
 .../table/distributed/TableManagerTest.java| 10 +++-
 .../PersistentPageMemoryGcUpdateHandlerTest.java   |  4 ++-
 .../distributed/gc/RocksDbGcUpdateHandlerTest.java |  3 ++-
 .../state/rocksdb/TxStateRocksDbSharedStorage.java |  8 ++
 .../state/rocksdb/RocksDbTxStateStorageTest.java   |  4 ++-
 .../storage/state/AbstractTxStateStorageTest.java  |  3 ++-
 56 files changed, 331 insertions(+), 81 deletions(-)

diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/LogStorageFactory.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/components/LogSyncer.java
similarity index 55%
copy from 
modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/LogStorageFactory.java
copy to 
modules/core/src/main/java/org/apache/ignite/internal/components/LogSyncer.java
index 75f1bcff02..612e6244b2 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/LogStorageFactory.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/components/LogSyncer.java
@@ -15,31 +15,14 @@
  * limitations under the License.
  */
 
-package org.apache.ignite.internal.raft.storage;
-
-import org.apache.ignite.internal.close.ManuallyCloseable;
-import

(ignite-3) branch main updated: IGNITE-21890 Fix BinaryTupleComparator for decimal values (#3527)

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

ibessonov 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 e896751ac6 IGNITE-21890 Fix BinaryTupleComparator for decimal values 
(#3527)
e896751ac6 is described below

commit e896751ac6e5478944364f38b3c5aeb5ba432479
Author: Alexander Polovtcev 
AuthorDate: Tue Apr 2 10:42:24 2024 +0300

IGNITE-21890 Fix BinaryTupleComparator for decimal values (#3527)
---
 .../internal/binarytuple/BinaryTupleReader.java|  7 ++-
 .../apache/ignite/internal/lang/InternalTuple.java |  3 +-
 .../storage/index/BinaryTupleComparator.java   |  6 +--
 .../storage/index/BinaryTupleComparatorTest.java   |  4 +-
 .../index/AbstractSortedIndexStorageTest.java  | 27 +++
 .../internal/storage/index/impl/TestIndexRow.java  | 55 ++
 6 files changed, 77 insertions(+), 25 deletions(-)

diff --git 
a/modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleReader.java
 
b/modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleReader.java
index 050d26d9be..26cda8b375 100644
--- 
a/modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleReader.java
+++ 
b/modules/binary-tuple/src/main/java/org/apache/ignite/internal/binarytuple/BinaryTupleReader.java
@@ -255,7 +255,8 @@ public class BinaryTupleReader extends BinaryTupleParser 
implements BinaryTupleP
  * Reads value of specified element.
  *
  * @param index Element index.
- * @param scale Decimal scale.
+ * @param scale Decimal scale. If equal to {@link Integer#MIN_VALUE}, then 
the value will be returned with whatever scale it is
+ * stored in.
  * @return Element value.
  */
 public @Nullable BigDecimal decimalValue(int index, int scale) {
@@ -266,7 +267,9 @@ public class BinaryTupleReader extends BinaryTupleParser 
implements BinaryTupleP
 
 short valScale = shortValue(begin, begin + 2);
 
-return new BigDecimal(numberValue(begin + 2, end), 
valScale).setScale(scale, RoundingMode.UNNECESSARY);
+BigDecimal decimalValue = new BigDecimal(numberValue(begin + 2, end), 
valScale);
+
+return scale < 0 ? decimalValue : decimalValue.setScale(scale, 
RoundingMode.UNNECESSARY);
 }
 
 /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/lang/InternalTuple.java 
b/modules/core/src/main/java/org/apache/ignite/internal/lang/InternalTuple.java
index 596e3a3a18..55e5a0866a 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/lang/InternalTuple.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/lang/InternalTuple.java
@@ -160,7 +160,8 @@ public interface InternalTuple {
  * Reads value from specified column.
  *
  * @param col Column index.
- * @param decimalScale Decimal scale.
+ * @param decimalScale Decimal scale. If equal to {@link 
Integer#MIN_VALUE}, then the value will be returned with whatever scale
+ * it is stored in.
  * @return Column value.
  */
 BigDecimal decimalValue(int col, int decimalScale);
diff --git 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/BinaryTupleComparator.java
 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/BinaryTupleComparator.java
index de6f03bd0a..243492bb20 100644
--- 
a/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/BinaryTupleComparator.java
+++ 
b/modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/BinaryTupleComparator.java
@@ -141,11 +141,11 @@ public class BinaryTupleComparator implements 
Comparator {
 return 
tuple1.stringValue(index).compareTo(tuple2.stringValue(index));
 
 case NUMBER:
-case DECIMAL:
-// Floating point position is irrelevant during comparison.
-// The only real requirement is that it matches in both 
arguments, and it does.
 return 
tuple1.numberValue(index).compareTo(tuple2.numberValue(index));
 
+case DECIMAL:
+return tuple1.decimalValue(index, 
Integer.MIN_VALUE).compareTo(tuple2.decimalValue(index, Integer.MIN_VALUE));
+
 case TIMESTAMP:
 return 
tuple1.timestampValue(index).compareTo(tuple2.timestampValue(index));
 
diff --git 
a/modules/storage-api/src/test/java/org/apache/ignite/internal/storage/index/BinaryTupleComparatorTest.java
 
b/modules/storage-api/src/test/java/org/apache/ignite/internal/storage/index/BinaryTupleComparatorTest.java
index 0c66f72b2c..73c0a7ab14 100644
--- 
a/modules/storage-api/src/test/java/org/apache/ignite/internal/storage/index/BinaryTupleComparatorTest.java
+++ 
b/modules/storage-api/src/test/java/org/apache/ignite/internal/storage/in

(ignite-3) branch main updated: IGNITE-21898 Remove reactive methods from AntiHijackingIgniteSql (#3534)

2024-04-01 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 78e446b9a7 IGNITE-21898 Remove reactive methods from 
AntiHijackingIgniteSql (#3534)
78e446b9a7 is described below

commit 78e446b9a7851f9cc3cc0ecb529c44ac449c7456
Author: Roman Puchkovskiy 
AuthorDate: Mon Apr 1 18:52:25 2024 +0400

IGNITE-21898 Remove reactive methods from AntiHijackingIgniteSql (#3534)
---
 .../internal/sql/api/AntiHijackIgniteSql.java  | 22 --
 1 file changed, 22 deletions(-)

diff --git 
a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AntiHijackIgniteSql.java
 
b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AntiHijackIgniteSql.java
index 24e29c55d4..e8bd5261de 100644
--- 
a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AntiHijackIgniteSql.java
+++ 
b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AntiHijackIgniteSql.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.sql.api;
 
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.Executor;
-import java.util.concurrent.Flow.Publisher;
 import org.apache.ignite.internal.thread.PublicApiThreading;
 import org.apache.ignite.internal.wrapper.Wrapper;
 import org.apache.ignite.sql.BatchedArguments;
@@ -29,7 +28,6 @@ import org.apache.ignite.sql.SqlRow;
 import org.apache.ignite.sql.Statement;
 import org.apache.ignite.sql.Statement.StatementBuilder;
 import org.apache.ignite.sql.async.AsyncResultSet;
-import org.apache.ignite.sql.reactive.ReactiveResultSet;
 import org.apache.ignite.table.mapper.Mapper;
 import org.apache.ignite.tx.Transaction;
 import org.jetbrains.annotations.Nullable;
@@ -124,16 +122,6 @@ public class AntiHijackIgniteSql implements IgniteSql, 
Wrapper {
 return preventThreadHijackForResultSet(sql.executeAsync(transaction, 
mapper, statement, arguments));
 }
 
-@Override
-public ReactiveResultSet executeReactive(@Nullable Transaction 
transaction, String query, @Nullable Object... arguments) {
-return sql.executeReactive(transaction, query, arguments);
-}
-
-@Override
-public ReactiveResultSet executeReactive(@Nullable Transaction 
transaction, Statement statement, @Nullable Object... arguments) {
-return sql.executeReactive(transaction, statement, arguments);
-}
-
 @Override
 public long[] executeBatch(@Nullable Transaction transaction, String 
dmlQuery, BatchedArguments batch) {
 return sql.executeBatch(transaction, dmlQuery, batch);
@@ -154,16 +142,6 @@ public class AntiHijackIgniteSql implements IgniteSql, 
Wrapper {
 return preventThreadHijack(sql.executeBatchAsync(transaction, 
statement, batch));
 }
 
-@Override
-public Publisher executeBatchReactive(@Nullable Transaction 
transaction, String query, BatchedArguments batch) {
-return sql.executeBatchReactive(transaction, query, batch);
-}
-
-@Override
-public Publisher executeBatchReactive(@Nullable Transaction 
transaction, Statement statement, BatchedArguments batch) {
-return sql.executeBatchReactive(transaction, statement, batch);
-}
-
 @Override
 public void executeScript(String query, @Nullable Object... arguments) {
 sql.executeScript(query, arguments);



(ignite-3) branch main updated: IGNITE-21869 Prevent thread hijacking via IgniteSql (#3512)

2024-04-01 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 655cf0fbb5 IGNITE-21869 Prevent thread hijacking via IgniteSql (#3512)
655cf0fbb5 is described below

commit 655cf0fbb53a8f160bcd2891ae24b68335d57532
Author: Roman Puchkovskiy 
AuthorDate: Mon Apr 1 17:03:10 2024 +0400

IGNITE-21869 Prevent thread hijacking via IgniteSql (#3512)
---
 .../org/apache/ignite/internal/app/IgniteImpl.java |  11 +-
 .../sql/threading/ItSqlApiThreadingTest.java   | 237 +
 .../internal/sql/api/AntiHijackAsyncResultSet.java |  74 +++
 .../internal/sql/api/AntiHijackIgniteSql.java  | 190 +
 .../ignite/internal/sql/api/IgniteSqlImpl.java |   1 +
 5 files changed, 510 insertions(+), 3 deletions(-)

diff --git 
a/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java 
b/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
index 91adcae0cb..b4ca5bf0b2 100644
--- 
a/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
+++ 
b/modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
@@ -173,6 +173,7 @@ import 
org.apache.ignite.internal.schema.configuration.StorageUpdateConfiguratio
 import 
org.apache.ignite.internal.security.authentication.AuthenticationManager;
 import 
org.apache.ignite.internal.security.authentication.AuthenticationManagerImpl;
 import org.apache.ignite.internal.security.configuration.SecurityConfiguration;
+import org.apache.ignite.internal.sql.api.AntiHijackIgniteSql;
 import org.apache.ignite.internal.sql.api.IgniteSqlImpl;
 import 
org.apache.ignite.internal.sql.configuration.distributed.SqlDistributedConfiguration;
 import 
org.apache.ignite.internal.sql.configuration.local.SqlLocalConfiguration;
@@ -758,7 +759,7 @@ public class IgniteImpl implements Ignite {
 catalogManager,
 observableTimestampTracker,
 placementDriverMgr.placementDriver(),
-this::sql,
+this::bareSql,
 resourcesRegistry,
 rebalanceScheduler,
 lowWatermark,
@@ -1213,10 +1214,14 @@ public class IgniteImpl implements Ignite {
 return new AntiHijackIgniteTransactions(transactions, 
asyncContinuationExecutor);
 }
 
+private IgniteSql bareSql() {
+return sql;
+}
+
 /** {@inheritDoc} */
 @Override
 public IgniteSql sql() {
-return sql;
+return new AntiHijackIgniteSql(sql, asyncContinuationExecutor);
 }
 
 /** {@inheritDoc} */
@@ -1251,7 +1256,7 @@ public class IgniteImpl implements Ignite {
 
 @Override
 public IgniteCatalog catalog(Options options) {
-return new IgniteCatalogSqlImpl(sql(), options);
+return new IgniteCatalogSqlImpl(sql, options);
 }
 
 /**
diff --git 
a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/threading/ItSqlApiThreadingTest.java
 
b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/threading/ItSqlApiThreadingTest.java
new file mode 100644
index 00..ff6f5b841b
--- /dev/null
+++ 
b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/threading/ItSqlApiThreadingTest.java
@@ -0,0 +1,237 @@
+/*
+ * 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.sql.threading;
+
+import static java.lang.Thread.currentThread;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static java.util.function.Function.identity;
+import static java.util.stream.Collectors.toMap;
+import static 
org.apache.ignite.internal.PublicApiThreadingTests.anIgniteThread;
+import static 
org.apache.ignite.internal.PublicApiThreadingTests.asyncContinuationPool;
+import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.either;
+import static org.hamcrest.Matchers.is;
+
+import ja

(ignite-3) branch main updated (a927dd3db4 -> dee0f1b0f4)

2024-03-29 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from a927dd3db4 IGNITE-21288 C++: Implement job execution interface (#3516)
 add dee0f1b0f4 IGNITE-21818 Support broadcasting null-returning jobs 
(#3520)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/ignite/compute/IgniteCompute.java   | 27 ++
 .../internal/compute/ItComputeTestEmbedded.java| 42 ++
 2 files changed, 62 insertions(+), 7 deletions(-)



(ignite-3) branch main updated (7e6ca8f927 -> 3733fa400b)

2024-03-29 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from 7e6ca8f927 IGNITE-21287 Sql. LogicalOrToUnionRule may hang (#3505)
 add 3733fa400b IGNITE-21256 Add internal API for getting partition states 
from all nodes in the cluster. (#3379)

No new revisions were added by this update.

Summary of changes:
 .../distributionzones/DistributionZoneManager.java |  23 --
 .../disaster/DisasterRecoveryManager.java  | 172 -
 .../RebalanceRaftGroupEventsListener.java  |  13 +-
 .../distributionzones/rebalance/RebalanceUtil.java |  14 +-
 .../java/org/apache/ignite/internal/raft/Loza.java |  11 +
 .../internal/raft/server/impl/JraftServerImpl.java |  11 +
 .../java/org/apache/ignite/raft/jraft/Node.java|  10 +
 .../apache/ignite/raft/jraft/core/NodeImpl.java|  22 ++
 .../org/apache/ignite/internal/app/IgniteImpl.java |  18 +
 .../ItDisasterRecoveryReconfigurationTest.java |  49 ++-
 .../internal/table/distributed/TableManager.java   |  14 +-
 .../table/distributed/TableMessageGroup.java   |  18 +
 .../disaster/DisasterRecoveryManager.java  | 392 +
 .../disaster/DisasterRecoveryRequest.java  |   7 +-
 .../disaster/LocalPartitionStateEnum.java} |  33 +-
 .../disaster/ManualGroupUpdateRequest.java |  10 +-
 .../messages/LocalPartitionState.java} |  27 +-
 .../messages/LocalPartitionStatesRequest.java} |  15 +-
 .../messages/LocalPartitionStatesResponse.java}|  17 +-
 19 files changed, 598 insertions(+), 278 deletions(-)
 delete mode 100644 
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/disaster/DisasterRecoveryManager.java
 create mode 100644 
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/DisasterRecoveryManager.java
 rename 
modules/{distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones
 => 
table/src/main/java/org/apache/ignite/internal/table/distributed}/disaster/DisasterRecoveryRequest.java
 (86%)
 copy modules/{platforms/dotnet/Apache.Ignite/Internal/Network/SslInfo.cs => 
table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/LocalPartitionStateEnum.java}
 (54%)
 rename 
modules/{distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones
 => 
table/src/main/java/org/apache/ignite/internal/table/distributed}/disaster/ManualGroupUpdateRequest.java
 (92%)
 copy 
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/{raft/snapshot/message/SnapshotTxDataResponse.java
 => disaster/messages/LocalPartitionState.java} (60%)
 copy 
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/{message/HasDataResponse.java
 => disaster/messages/LocalPartitionStatesRequest.java} (74%)
 copy 
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/{message/HasDataRequest.java
 => disaster/messages/LocalPartitionStatesResponse.java} (73%)



(ignite-3) branch main updated (c662f45bbe -> bcde60c53d)

2024-03-29 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from c662f45bbe IGNITE-21768 Java thin: Fix column serialization order in 
ClientKeyValueView (#3509)
 add bcde60c53d IGNITE-21853 Prevent thread hijacking via 
IgniteTransactions (#3506)

No new revisions were added by this update.

Summary of changes:
 .../ItPrimaryReplicaChoiceTest.java|   3 +-
 .../org/apache/ignite/internal/app/IgniteImpl.java |   4 +-
 .../ignite/internal}/PublicApiThreadingTests.java  |  28 +++-
 .../org/apache/ignite/internal/TestWrappers.java   |  11 ++
 .../threading/ItKvRecordApiThreadingTest.java  |   5 +-
 .../threading/ItTablesApiThreadingTest.java|   9 +-
 .../table/distributed/AntiHijackIgniteTables.java  |  14 +-
 .../tx/ItTransactionsApiThreadingTest.java | 165 +
 .../tx/impl/AntiHijackIgniteTransactions.java  |  61 
 .../internal/tx/impl/AntiHijackTransaction.java| 126 
 10 files changed, 406 insertions(+), 20 deletions(-)
 rename 
modules/{table/src/integrationTest/java/org/apache/ignite/internal/threading => 
runner/src/testFixtures/java/org/apache/ignite/internal}/PublicApiThreadingTests.java
 (65%)
 create mode 100644 
modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/ItTransactionsApiThreadingTest.java
 create mode 100644 
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/AntiHijackIgniteTransactions.java
 create mode 100644 
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/AntiHijackTransaction.java



(ignite-3) branch main updated: IGNITE-21677 Fix NPE in ActiveActorTest (#3359)

2024-03-05 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 5f492e901c IGNITE-21677 Fix NPE in ActiveActorTest (#3359)
5f492e901c is described below

commit 5f492e901c19287baae4ab3b3ff1f3ccb35fa2f9
Author: Roman Puchkovskiy 
AuthorDate: Wed Mar 6 11:01:18 2024 +0400

IGNITE-21677 Fix NPE in ActiveActorTest (#3359)
---
 .../src/main/java/org/apache/ignite/configuration/RootKey.java| 2 ++
 .../org/apache/ignite/internal/placementdriver/ActiveActorTest.java   | 2 ++
 .../apache/ignite/internal/placementdriver/AssignmentsTracker.java| 4 
 3 files changed, 8 insertions(+)

diff --git 
a/modules/configuration-api/src/main/java/org/apache/ignite/configuration/RootKey.java
 
b/modules/configuration-api/src/main/java/org/apache/ignite/configuration/RootKey.java
index 2d009a5976..c079c6b02c 100644
--- 
a/modules/configuration-api/src/main/java/org/apache/ignite/configuration/RootKey.java
+++ 
b/modules/configuration-api/src/main/java/org/apache/ignite/configuration/RootKey.java
@@ -56,6 +56,8 @@ public class RootKey, 
VIEWT> {
 this.rootName = rootAnnotation.rootName();
 this.storageType = rootAnnotation.type();
 
+assert rootName != null;
+
 ConfigurationExtension extension = 
schemaClass.getAnnotation(ConfigurationExtension.class);
 internal = extension != null && extension.internal();
 }
diff --git 
a/modules/placement-driver/src/integrationTest/java/org/apache/ignite/internal/placementdriver/ActiveActorTest.java
 
b/modules/placement-driver/src/integrationTest/java/org/apache/ignite/internal/placementdriver/ActiveActorTest.java
index 0522f21fd8..8b8eb6751e 100644
--- 
a/modules/placement-driver/src/integrationTest/java/org/apache/ignite/internal/placementdriver/ActiveActorTest.java
+++ 
b/modules/placement-driver/src/integrationTest/java/org/apache/ignite/internal/placementdriver/ActiveActorTest.java
@@ -45,6 +45,7 @@ import org.apache.ignite.internal.raft.Peer;
 import org.apache.ignite.internal.raft.PeersAndLearners;
 import 
org.apache.ignite.internal.raft.client.AbstractTopologyAwareGroupServiceTest;
 import 
org.apache.ignite.internal.raft.client.TopologyAwareRaftGroupServiceFactory;
+import org.apache.ignite.internal.util.Cursor;
 import org.apache.ignite.raft.jraft.rpc.impl.RaftGroupEventsClientListener;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
@@ -70,6 +71,7 @@ public class ActiveActorTest extends 
AbstractTopologyAwareGroupServiceTest {
 when(msm.recoveryFinishedFuture()).thenReturn(completedFuture(0L));
 when(msm.invoke(any(), any(Operation.class), 
any(Operation.class))).thenReturn(trueCompletedFuture());
 when(msm.getLocally(any(), anyLong())).then(invocation -> 
emptyMetastoreEntry());
+when(msm.getLocally(any(), any(), anyLong())).then(invocation -> 
Cursor.fromIterable(List.of()));
 }
 
 @AfterEach
diff --git 
a/modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/AssignmentsTracker.java
 
b/modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/AssignmentsTracker.java
index 7c9192a719..9783715fab 100644
--- 
a/modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/AssignmentsTracker.java
+++ 
b/modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/AssignmentsTracker.java
@@ -102,6 +102,10 @@ public class AssignmentsTracker {
 groupAssignments.put(grpId, assignments);
 }
 }
+}).whenComplete((res, ex) -> {
+if (ex != null) {
+LOG.error("Cannot do recovery", ex);
+}
 });
 
 LOG.info("Assignment cache initialized for placement driver 
[groupAssignments={}]", groupAssignments);



(ignite-3) branch main updated (fc652f46ae -> 126cbad547)

2024-03-05 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from fc652f46ae IGNITE-21635 Fix NPE in IndexUpdateHandler (#3341)
 add 126cbad547 IGNITE-21284 Implement the "resetPartitions" operation for 
distribution zones (#3261)

No new revisions were added by this update.

Summary of changes:
 .../ignite/internal/affinity/Assignments.java  |  47 ++-
 .../internal/testframework/IgniteTestUtils.java|   4 +
 .../distributionzones/DistributionZoneManager.java |  24 +-
 .../disaster/DisasterRecoveryManager.java  | 172 +++
 .../disaster/DisasterRecoveryRequest.java  |  52 
 .../disaster/ManualGroupUpdateRequest.java | 106 +++
 .../distributionzones/rebalance/RebalanceUtil.java | 226 +++
 .../ignite/internal/metastorage/dsl/Condition.java |  22 +-
 .../java/org/apache/ignite/internal/raft/Loza.java |  28 +-
 .../internal/raft/server/impl/JraftServerImpl.java |  16 ++
 .../raft/client/TopologyAwareRaftGroupService.java | 139 +++--
 .../ReplicationConfigurationSchema.java|   5 +-
 .../ItDisasterRecoveryReconfigurationTest.java | 319 +
 .../internal/table/distributed/TableManager.java   |  92 --
 .../distributed/storage/TableRaftServiceImpl.java  |   2 +-
 15 files changed, 1135 insertions(+), 119 deletions(-)
 create mode 100644 
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/disaster/DisasterRecoveryManager.java
 create mode 100644 
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/disaster/DisasterRecoveryRequest.java
 create mode 100644 
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/disaster/ManualGroupUpdateRequest.java
 create mode 100644 
modules/table/src/integrationTest/java/org/apache/ignite/internal/disaster/ItDisasterRecoveryReconfigurationTest.java



(ignite-3) branch main updated: IGNITE-21523 Send a probe message to server when channel opens at client side (#3345)

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

ibessonov 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 45102b5209 IGNITE-21523 Send a probe message to server when channel 
opens at client side (#3345)
45102b5209 is described below

commit 45102b52093d4c8a458c556d1065101d72ad9783
Author: Roman Puchkovskiy 
AuthorDate: Tue Mar 5 11:55:48 2024 +0400

IGNITE-21523 Send a probe message to server when channel opens at client 
side (#3345)
---
 .../internal/network/NetworkMessageTypes.java  |  6 
 .../internal/network/netty/HandshakeHandler.java   | 15 +-
 .../internal/network/netty/MessageHandler.java |  7 -
 .../recovery/RecoveryClientHandshakeManager.java   | 30 +--
 .../recovery/RecoveryServerHandshakeManager.java   |  6 
 .../network/recovery/message/ProbeMessage.java | 34 ++
 .../network/netty/RecoveryHandshakeTest.java   | 12 
 .../apache/ignite/raft/jraft/core/ItNodeTest.java  |  3 +-
 .../ignite/internal/replicator/ReplicaManager.java | 15 --
 .../incoming/IncomingSnapshotCopierTest.java   |  3 --
 10 files changed, 112 insertions(+), 19 deletions(-)

diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/NetworkMessageTypes.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/NetworkMessageTypes.java
index 1d9f3f349f..5ef73fe44b 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/NetworkMessageTypes.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/NetworkMessageTypes.java
@@ -30,6 +30,7 @@ import 
org.apache.ignite.internal.network.recovery.message.HandshakeFinishMessag
 import 
org.apache.ignite.internal.network.recovery.message.HandshakeRejectedMessage;
 import 
org.apache.ignite.internal.network.recovery.message.HandshakeStartMessage;
 import 
org.apache.ignite.internal.network.recovery.message.HandshakeStartResponseMessage;
+import org.apache.ignite.internal.network.recovery.message.ProbeMessage;
 
 /**
  * Message types for the network module.
@@ -95,4 +96,9 @@ public class NetworkMessageTypes {
  * Type for {@link ClusterNodeMessage}.
  */
 public static final short CLUSTER_NODE_MESSAGE = 11;
+
+/**
+ * Type for {@link ProbeMessage}.
+ */
+public static final short PROBE_MESSAGE = 12;
 }
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/HandshakeHandler.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/HandshakeHandler.java
index 38c564d64a..1aba0e80d6 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/HandshakeHandler.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/HandshakeHandler.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.network.netty;
 
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.handler.codec.DecoderException;
 import java.util.function.Consumer;
 import org.apache.ignite.internal.logger.IgniteLogger;
 import org.apache.ignite.internal.logger.Loggers;
@@ -78,7 +79,11 @@ public class HandshakeHandler extends 
ChannelInboundHandlerAdapter {
 
 manager.localHandshakeFuture().whenComplete((unused, throwable) -> {
 if (throwable != null) {
-LOG.debug("Error when performing handshake", throwable);
+if (unexpectedException(throwable)) {
+LOG.error("Error when performing handshake", throwable);
+} else {
+LOG.debug("Error when performing handshake", throwable);
+}
 
 ctx.close();
 }
@@ -87,6 +92,14 @@ public class HandshakeHandler extends 
ChannelInboundHandlerAdapter {
 ctx.fireChannelActive();
 }
 
+private static boolean unexpectedException(Throwable ex) {
+return ex instanceof Error
+|| ex instanceof DecoderException
+|| ex instanceof NullPointerException
+|| ex instanceof IllegalArgumentException
+|| ex instanceof IllegalStateException;
+}
+
 /** {@inheritDoc} */
 @Override
 public void channelRead(ChannelHandlerContext ctx, Object msg) {
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/MessageHandler.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/MessageHandler.java
index 762232eca1..c6c3c3a8dd 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/MessageHandler.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/MessageHandler.java
@@ -22,6 +22,7 @@ import io.netty.channel.Chan

(ignite-3) branch main updated: IGNITE-21617 Update to Gradle 8.6 (#3306)

2024-03-01 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 319bd98938 IGNITE-21617 Update to Gradle 8.6 (#3306)
319bd98938 is described below

commit 319bd98938d91b3edf4a3edc381c88dd641e13ab
Author: Roman Puchkovskiy 
AuthorDate: Fri Mar 1 14:19:40 2024 +0400

IGNITE-21617 Update to Gradle 8.6 (#3306)

Gradle 8.5+ brings full support for Java 21
---
 buildscripts/sql-parser-generator.gradle | 4 
 gradle/libs.versions.toml| 4 ++--
 gradle/wrapper/gradle-wrapper.properties | 2 +-
 packaging/db/build.gradle| 3 +--
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/buildscripts/sql-parser-generator.gradle 
b/buildscripts/sql-parser-generator.gradle
index 93d0146883..40064a46cb 100644
--- a/buildscripts/sql-parser-generator.gradle
+++ b/buildscripts/sql-parser-generator.gradle
@@ -47,6 +47,10 @@ task extractParserTemplate(type: Copy) {
 include 'codegen/default_config.fmpp'
 }
 into("${buildDir}")
+
+// TODO: IGNITE-21638 - remove this.
+if (System.getProperty("os.name").toLowerCase().contains("windows"))
+doNotTrackState("IGNITE-21638 - do not track state in 
extractParserTemplate on Windows")
 }
 
 task generateFmppSources() {
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 72f2f6082e..9e866c7ac2 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -90,8 +90,8 @@ javacc = "com.intershop.gradle.javacc:4.1.3"
 shadow = "com.github.johnrengelman.shadow:7.1.2"
 cmake = "net.freudasoft.gradle-cmake-plugin:0.0.4"
 modernizer = "com.github.andygoossens.modernizer:1.6.2"
-nebula = "nebula.ospackage:9.1.1"
-docker = "com.palantir.docker:0.34.0"
+nebula = "com.netflix.nebula.ospackage:11.8.1"
+docker = "com.palantir.docker:0.35.0"
 checksum = "org.gradle.crypto.checksum:1.4.0"
 setupbuilder = "de.inetsoftware.setupbuilder:7.2.13"
 aggregateJavadoc = "io.freefair.aggregate-javadoc:6.5.1"
diff --git a/gradle/wrapper/gradle-wrapper.properties 
b/gradle/wrapper/gradle-wrapper.properties
index 740908bf52..510e4efae0 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/packaging/db/build.gradle b/packaging/db/build.gradle
index 2492e14594..72f625cfe1 100644
--- a/packaging/db/build.gradle
+++ b/packaging/db/build.gradle
@@ -34,7 +34,7 @@ import org.gradle.crypto.checksum.Checksum
 
 configurations {
 dbArtifacts
-defaultsGenerator
+defaultsGenerator.extendsFrom(dbArtifacts)
 dbZip {
 canBeConsumed = true
 canBeResolved = false
@@ -52,7 +52,6 @@ configurations {
 dependencies {
 dbArtifacts project(':ignite-runner')
 
-defaultsGenerator configurations.dbArtifacts
 defaultsGenerator project(path: ':ignite-runner', configuration: 
'defaultsGenerator')
 }
 



(ignite-3) branch main updated: IGNITE-21601 Avoid watch thread hijack due to schema sync in KV/record views (#3289)

2024-02-26 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 7ec254b334 IGNITE-21601 Avoid watch thread hijack due to schema sync 
in KV/record views (#3289)
7ec254b334 is described below

commit 7ec254b33424b9b82286c907c9c2ba27c248f0d3
Author: Roman Puchkovskiy 
AuthorDate: Mon Feb 26 18:37:17 2024 +0400

IGNITE-21601 Avoid watch thread hijack due to schema sync in KV/record 
views (#3289)
---
 .../internal/table/distributed/TableManager.java   | 25 +++---
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
index 87ca634c69..2a5a7b4c72 100644
--- 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
+++ 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
@@ -322,7 +322,7 @@ public class TableManager implements IgniteTablesInternal, 
IgniteComponent {
 
 private final DistributionZoneManager distributionZoneManager;
 
-private final SchemaSyncService schemaSyncService;
+private final SchemaSyncService executorInclinedSchemaSyncService;
 
 private final CatalogService catalogService;
 
@@ -350,7 +350,7 @@ public class TableManager implements IgniteTablesInternal, 
IgniteComponent {
 private final HybridTimestampTracker observableTimestampTracker;
 
 /** Placement driver. */
-private final PlacementDriver placementDriver;
+private final PlacementDriver executorInclinedPlacementDriver;
 
 /** A supplier function that returns {@link IgniteSql}. */
 private final Supplier sql;
@@ -454,14 +454,15 @@ public class TableManager implements 
IgniteTablesInternal, IgniteComponent {
 this.outgoingSnapshotsManager = outgoingSnapshotsManager;
 this.raftGroupServiceFactory = raftGroupServiceFactory;
 this.distributionZoneManager = distributionZoneManager;
-this.schemaSyncService = new 
ExecutorInclinedSchemaSyncService(schemaSyncService, 
partitionOperationsExecutor);
 this.catalogService = catalogService;
 this.observableTimestampTracker = observableTimestampTracker;
-this.placementDriver = new 
ExecutorInclinedPlacementDriver(placementDriver, partitionOperationsExecutor);
 this.sql = sql;
 this.storageUpdateConfig = storageUpdateConfig;
 this.remotelyTriggeredResourceRegistry = 
remotelyTriggeredResourceRegistry;
 
+this.executorInclinedSchemaSyncService = new 
ExecutorInclinedSchemaSyncService(schemaSyncService, 
partitionOperationsExecutor);
+this.executorInclinedPlacementDriver = new 
ExecutorInclinedPlacementDriver(placementDriver, partitionOperationsExecutor);
+
 TopologyService topologyService = clusterService.topologyService();
 
 TxMessageSender txMessageSender = new 
TxMessageSender(clusterService.messagingService(), replicaSvc, clock);
@@ -471,11 +472,11 @@ public class TableManager implements 
IgniteTablesInternal, IgniteComponent {
 clock,
 topologyService,
 clusterService.messagingService(),
-placementDriver,
+executorInclinedPlacementDriver,
 txMessageSender
 );
 
-schemaVersions = new SchemaVersionsImpl(schemaSyncService, 
catalogService, clock);
+schemaVersions = new 
SchemaVersionsImpl(executorInclinedSchemaSyncService, catalogService, clock);
 
 tablesByIdVv = new IncrementalVersionedValue<>(registry, HashMap::new);
 
@@ -992,9 +993,9 @@ public class TableManager implements IgniteTablesInternal, 
IgniteComponent {
 partitionUpdateHandlers.storageUpdateHandler,
 new CatalogValidationSchemasSource(catalogService, 
schemaManager),
 localNode(),
-schemaSyncService,
+executorInclinedSchemaSyncService,
 catalogService,
-placementDriver,
+executorInclinedPlacementDriver,
 clusterService.topologyService(),
 remotelyTriggeredResourceRegistry
 );
@@ -1238,7 +1239,7 @@ public class TableManager implements 
IgniteTablesInternal, IgniteComponent {
 replicaSvc,
 clock,
 observableTimestampTracker,
-placementDriver,
+executorInclinedPlacementDriver,
 tableRaftService
 );
 
@@ -1468,7 +1469,7 @@ public class TableManager implements 
IgniteTablesInternal, IgniteComponent {
 private CompletableFuture> tablesAsyncInternalBusy() {
 HybridTimestamp now = clock.now();
 
- 

(ignite-3) branch main updated (bba18a5f99 -> dd8a43f046)

2024-02-20 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from bba18a5f99 IGNITE-21390 Inconsistent behavior of Compute APIs when 
target node does not exist (#3191)
 add dd8a43f046 IGNITE-21548 Encapsulate sets of assignments before storing 
them to meta-storage (#3226)

No new revisions were added by this update.

Summary of changes:
 .../ignite/internal/affinity/Assignments.java  | 109 +++
 .../ItDistributionZonesFilterTest.java |  13 +--
 .../distributionzones/rebalance/RebalanceUtil.java |  49 +
 .../DistributionZoneRebalanceEngineTest.java   |  14 ++-
 .../RebalanceUtilUpdateAssignmentsTest.java|  10 +-
 .../placementdriver/BasePlacementDriverTest.java   |   4 +-
 .../PlacementDriverManagerTest.java|   8 +-
 .../placementdriver/AssignmentsTracker.java|   7 +-
 .../internal/placementdriver/LeaseUpdaterTest.java |   4 +-
 .../runner/app/ItIgniteNodeRestartTest.java|   9 +-
 .../rebalance/ItRebalanceDistributedTest.java  |  15 ++-
 .../rebalance/ItRebalanceTriggersRecoveryTest.java |   4 +-
 .../internal/table/distributed/TableManager.java   | 116 +++--
 .../raft/RebalanceRaftGroupEventsListener.java |  30 +++---
 14 files changed, 259 insertions(+), 133 deletions(-)
 create mode 100644 
modules/affinity/src/main/java/org/apache/ignite/internal/affinity/Assignments.java



(ignite-3) branch main updated: IGNITE-21439 Enable thread assertions in tests (#3231)

2024-02-19 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 c708811d87 IGNITE-21439 Enable thread assertions in tests (#3231)
c708811d87 is described below

commit c708811d87cabd2f3dd716ed651f58afceaae131
Author: Roman Puchkovskiy 
AuthorDate: Mon Feb 19 19:58:03 2024 +0400

IGNITE-21439 Enable thread assertions in tests (#3231)
---
 .../apache/ignite/internal/testframework/BaseIgniteAbstractTest.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
index 52d2273703..c59aef5263 100644
--- 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
+++ 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
@@ -39,7 +39,7 @@ import org.mockito.Mockito;
  * Ignite base test class.
  */
 @ExtendWith(SystemPropertiesExtension.class)
-@WithSystemProperty(key = IgniteSystemProperties.THREAD_ASSERTIONS_ENABLED, 
value = "false")
+@WithSystemProperty(key = IgniteSystemProperties.THREAD_ASSERTIONS_ENABLED, 
value = "true")
 public abstract class BaseIgniteAbstractTest {
 /** Logger. */
 protected final IgniteLogger log = Loggers.forClass(getClass());



(ignite-3) branch main updated (405db0c3d8 -> 61137a04df)

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

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


from 405db0c3d8 IGNITE-21506 Refactoring of tuple marshaller (#3195)
 add 61137a04df IGNITE-21515 Enable assertions for idea test runner (#3205)

No new revisions were added by this update.

Summary of changes:
 build.gradle | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



(ignite-3) branch main updated: IGNITE-21493 Apply ack silencer when the channel is open (#3196)

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

ibessonov 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 4b3e9bf163 IGNITE-21493 Apply ack silencer when the channel is open 
(#3196)
4b3e9bf163 is described below

commit 4b3e9bf16316cfeca40cf83a4e748202c26a6382
Author: Roman Puchkovskiy 
AuthorDate: Fri Feb 9 19:02:26 2024 +0400

IGNITE-21493 Apply ack silencer when the channel is open (#3196)
---
 .../network/netty/ItConnectionManagerTest.java   |  2 ++
 .../scalecube/ItScaleCubeNetworkMessagingTest.java   | 20 +++-
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git 
a/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java
 
b/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java
index 0b5254c7fb..c4cd4f751c 100644
--- 
a/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java
+++ 
b/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java
@@ -427,6 +427,7 @@ public class ItConnectionManagerTest extends 
BaseIgniteAbstractTest {
 ConnectionManagerWrapper manager2 = startManager(4001)
 ) {
 NettySender sender = 
manager1.openChannelTo(manager2).toCompletableFuture().get(10, 
TimeUnit.SECONDS);
+waitTillChannelAppearsInMapOnAcceptor(sender, manager1, manager2);
 
 OutgoingAcknowledgementSilencer ackSilencer = 
dropAcksFrom(manager2);
 
@@ -453,6 +454,7 @@ public class ItConnectionManagerTest extends 
BaseIgniteAbstractTest {
 ConnectionManagerWrapper manager2 = startManager(4001)
 ) {
 NettySender sender = 
manager1.openChannelTo(manager2).toCompletableFuture().get(10, 
TimeUnit.SECONDS);
+waitTillChannelAppearsInMapOnAcceptor(sender, manager1, manager2);
 
 dropAcksFrom(manager2);
 
diff --git 
a/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/scalecube/ItScaleCubeNetworkMessagingTest.java
 
b/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/scalecube/ItScaleCubeNetworkMessagingTest.java
index cd6ff9ca76..df80f7e3ce 100644
--- 
a/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/scalecube/ItScaleCubeNetworkMessagingTest.java
+++ 
b/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/scalecube/ItScaleCubeNetworkMessagingTest.java
@@ -959,7 +959,7 @@ class ItScaleCubeNetworkMessagingTest {
 
 // Open a channel to allow a silencer to be installed on it.
 openDefaultChannelBetween(sender, receiver);
-OutgoingAcknowledgementSilencer ackSilencer = dropAcksFrom(receiver);
+OutgoingAcknowledgementSilencer ackSilencer = 
dropAcksWhenDefaultChannelOpens(receiver);
 
 CompletableFuture sendFuture = operation.send(
 sender.messagingService(),
@@ -996,10 +996,20 @@ class ItScaleCubeNetworkMessagingTest {
 return send(messageFactory.testMessage().build(), sender, receiver);
 }
 
-private static OutgoingAcknowledgementSilencer dropAcksFrom(ClusterService 
clusterService) throws InterruptedException {
+private static OutgoingAcknowledgementSilencer 
dropAcksWhenDefaultChannelOpens(ClusterService clusterService)
+throws InterruptedException {
 DefaultMessagingService messagingService = (DefaultMessagingService) 
clusterService.messagingService();
 
-return 
OutgoingAcknowledgementSilencer.installOn(messagingService.connectionManager().channels().values());
+ConnectionManager connectionManager = 
messagingService.connectionManager();
+assertTrue(
+waitForCondition(
+() -> 
connectionManager.channels().keySet().stream().anyMatch(key -> key.type() == 
ChannelType.DEFAULT),
+SECONDS.toMillis(10)
+),
+"Did not see a default channel to be opened on the connection 
manager"
+);
+
+return 
OutgoingAcknowledgementSilencer.installOn(connectionManager.channels().values());
 }
 
 private void provokeAckFor(ClusterService sideToGetAck, ClusterService 
sideToSendAck) {
@@ -1019,7 +1029,7 @@ class ItScaleCubeNetworkMessagingTest {
 echoMessagesBackAt(outcast);
 
 openDefaultChannelBetween(notOutcast, outcast);
-dropAcksFrom(outcast);
+dropAcksWhenDefaultChannelOpens(outcast);
 
 CompletableFuture sendFuture = operation.send(
 notOutcast.messagingService(),
@@ -1045,7 +1055,7 @@ class ItScaleCubeNetworkMessagingTest {
 echoMessagesBackAt(receiver);
 
 openDefaultChannelBetween(

(ignite-3) branch main updated: IGNITE-21488 Disable thread assertions by default (#3182)

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

ibessonov 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 a46b779688 IGNITE-21488 Disable thread assertions by default (#3182)
a46b779688 is described below

commit a46b77968844d589d163ac2d06e32d8c00f41b13
Author: Roman Puchkovskiy 
AuthorDate: Wed Feb 7 20:38:25 2024 +0400

IGNITE-21488 Disable thread assertions by default (#3182)
---
 .../main/java/org/apache/ignite/internal/worker/ThreadAssertions.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/modules/workers/src/main/java/org/apache/ignite/internal/worker/ThreadAssertions.java
 
b/modules/workers/src/main/java/org/apache/ignite/internal/worker/ThreadAssertions.java
index 64b54c2c35..2b66c4a99f 100644
--- 
a/modules/workers/src/main/java/org/apache/ignite/internal/worker/ThreadAssertions.java
+++ 
b/modules/workers/src/main/java/org/apache/ignite/internal/worker/ThreadAssertions.java
@@ -30,7 +30,7 @@ public class ThreadAssertions {
 
 private static final IgniteLogger LOG = 
Loggers.forClass(ThreadAssertions.class);
 
-private static final boolean ENABLED = 
Boolean.parseBoolean(System.getProperty(ENABLED_PROPERTY, "true"));
+private static final boolean ENABLED = 
Boolean.parseBoolean(System.getProperty(ENABLED_PROPERTY, "false"));
 
 /**
  * Returns {@code true} if thread assertions are enabled.



(ignite-3) branch main updated: IGNITE-21438 Add thread assertions to MV partition and index storages (#3149)

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

ibessonov 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 4550e073d9 IGNITE-21438 Add thread assertions to MV partition and 
index storages (#3149)
4550e073d9 is described below

commit 4550e073d96a30c0adce0785440734f271d1c10e
Author: Roman Puchkovskiy 
AuthorDate: Wed Feb 7 13:36:04 2024 +0400

IGNITE-21438 Add thread assertions to MV partition and index storages 
(#3149)
---
 .../ignite/internal/thread/IgniteThread.java   |  25 +++-
 .../ignite/internal/thread/ThreadAttributes.java   |  40 +
 .../ignite/internal/thread/ThreadOperation.java|  30 
 .../network/netty/NamedNioEventLoopGroup.java  |  14 +-
 .../org/apache/ignite/internal/app/IgniteImpl.java |  33 -
 modules/storage-api/build.gradle   |   1 +
 .../internal/storage/ThreadAssertingCursor.java|  56 +++
 .../storage/ThreadAssertingMvPartitionStorage.java | 164 +
 .../ThreadAssertingPartitionTimestampCursor.java   |  48 ++
 .../engine/ThreadAssertingMvTableStorage.java  | 162 
 .../engine/ThreadAssertingStorageEngine.java   |  62 
 .../index/ThreadAssertingHashIndexStorage.java |  51 +++
 .../storage/index/ThreadAssertingIndexStorage.java |  76 ++
 .../storage/index/ThreadAssertingPeekCursor.java   |  47 ++
 .../index/ThreadAssertingSortedIndexStorage.java   |  52 +++
 .../ignite/internal/worker/ThreadAssertions.java   |  75 ++
 16 files changed, 924 insertions(+), 12 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/thread/IgniteThread.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/thread/IgniteThread.java
index 53f2fbf5f3..1801aef277 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/thread/IgniteThread.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/thread/IgniteThread.java
@@ -17,6 +17,11 @@
 
 package org.apache.ignite.internal.thread;
 
+import static java.util.Collections.unmodifiableSet;
+
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 import org.apache.ignite.internal.tostring.S;
 import org.apache.ignite.internal.util.worker.IgniteWorker;
@@ -24,18 +29,20 @@ import org.apache.ignite.internal.util.worker.IgniteWorker;
 /**
  * This class adds some necessary plumbing on top of the {@link Thread} class. 
Specifically, it adds:
  * 
- *  Consistent naming of threads;
- *  Name of the ignite node this thread belongs to.
+ *  Consistent naming of threads;
+ *  Name of the ignite node this thread belongs to.
  * 
  * Note: this class is intended for internal use only.
  */
-public class IgniteThread extends Thread {
+public class IgniteThread extends Thread implements ThreadAttributes {
 /** Number of all ignite threads in the system. */
 private static final AtomicLong THREAD_COUNTER = new AtomicLong();
 
 /** The name of the Ignite instance this thread belongs to. */
 protected final String igniteInstanceName;
 
+private final Set allowedOperations;
+
 /**
  * Creates thread with given worker.
  *
@@ -61,11 +68,16 @@ public class IgniteThread extends Thread {
  * @param nodeName   Name of the Ignite instance this thread is created 
for.
  * @param threadName Name of thread.
  * @param r  Runnable to execute.
+ * @param allowedOperations Operations which this thread allows to execute.
  */
-public IgniteThread(String nodeName, String threadName, Runnable r) {
+public IgniteThread(String nodeName, String threadName, Runnable r, 
ThreadOperation... allowedOperations) {
 super(r, createName(THREAD_COUNTER.incrementAndGet(), threadName, 
nodeName));
 
 this.igniteInstanceName = nodeName;
+
+Set operations = 
EnumSet.noneOf(ThreadOperation.class);
+Collections.addAll(operations, allowedOperations);
+this.allowedOperations = unmodifiableSet(operations);
 }
 
 /**
@@ -113,4 +125,9 @@ public class IgniteThread extends Thread {
 public String toString() {
 return S.toString(IgniteThread.class, this, "name", getName());
 }
+
+@Override
+public Set allowedOperations() {
+return allowedOperations;
+}
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/thread/ThreadAttributes.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/thread/ThreadAttributes.java
new file mode 100644
index 00..230095c38b
--- /dev/null
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/thread/ThreadAttributes.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file d

(ignite-3) branch main updated: IGNITE-21471 Change approach in sendMessagesTwoChannels in DefaultMessagingServiceTest (#3165)

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

ibessonov 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 1d1313634c IGNITE-21471 Change approach in sendMessagesTwoChannels in 
DefaultMessagingServiceTest (#3165)
1d1313634c is described below

commit 1d1313634c91551770629b5c1158bd74af4465da
Author: Roman Puchkovskiy 
AuthorDate: Wed Feb 7 12:01:52 2024 +0400

IGNITE-21471 Change approach in sendMessagesTwoChannels in 
DefaultMessagingServiceTest (#3165)
---
 .../network/DefaultMessagingServiceTest.java   | 118 ++---
 1 file changed, 8 insertions(+), 110 deletions(-)

diff --git 
a/modules/network/src/test/java/org/apache/ignite/internal/network/DefaultMessagingServiceTest.java
 
b/modules/network/src/test/java/org/apache/ignite/internal/network/DefaultMessagingServiceTest.java
index 2c8f624944..bcd638a0ee 100644
--- 
a/modules/network/src/test/java/org/apache/ignite/internal/network/DefaultMessagingServiceTest.java
+++ 
b/modules/network/src/test/java/org/apache/ignite/internal/network/DefaultMessagingServiceTest.java
@@ -22,8 +22,8 @@ import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.waitForCo
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureExceptionMatcher.willThrow;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
-import static org.awaitility.Awaitility.await;
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.anEmptyMap;
 import static org.hamcrest.Matchers.contains;
 import static org.hamcrest.Matchers.is;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -42,7 +42,6 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -54,7 +53,6 @@ import 
org.apache.ignite.internal.network.messages.InstantContainer;
 import org.apache.ignite.internal.network.messages.MessageWithInstant;
 import org.apache.ignite.internal.network.messages.TestMessage;
 import org.apache.ignite.internal.network.messages.TestMessageImpl;
-import 
org.apache.ignite.internal.network.messages.TestMessageSerializationFactory;
 import org.apache.ignite.internal.network.messages.TestMessageTypes;
 import org.apache.ignite.internal.network.messages.TestMessagesFactory;
 import org.apache.ignite.internal.network.netty.ConnectionManager;
@@ -65,10 +63,7 @@ import 
org.apache.ignite.internal.network.recovery.RecoveryDescriptorProvider;
 import org.apache.ignite.internal.network.recovery.StaleIdDetector;
 import org.apache.ignite.internal.network.serialization.ClassDescriptorFactory;
 import 
org.apache.ignite.internal.network.serialization.ClassDescriptorRegistry;
-import org.apache.ignite.internal.network.serialization.MessageDeserializer;
-import 
org.apache.ignite.internal.network.serialization.MessageSerializationFactory;
 import 
org.apache.ignite.internal.network.serialization.MessageSerializationRegistry;
-import org.apache.ignite.internal.network.serialization.MessageSerializer;
 import org.apache.ignite.internal.network.serialization.SerializationService;
 import 
org.apache.ignite.internal.network.serialization.UserObjectSerializationContext;
 import 
org.apache.ignite.internal.network.serialization.marshal.DefaultUserObjectMarshaller;
@@ -168,75 +163,17 @@ class DefaultMessagingServiceTest extends 
BaseIgniteAbstractTest {
 }
 }
 
-@Test
-public void sendMessagesOneChannel() throws Exception {
-AtomicBoolean release = new AtomicBoolean(false);
-MessageSerializer serializer = new 
TestMessageSerializationFactory(
-new TestMessagesFactory()).createSerializer();
-Serializer longWaitSerializer = new 
Serializer(TestMessageImpl.GROUP_TYPE, TestMessageImpl.TYPE,
-(message, writer) -> release.get()
-&& serializer.writeMessage((TestMessage) message, 
writer));
-
-try (Services senderServices = createMessagingService(
-senderNode,
-senderNetworkConfig,
-() -> {},
-mockSerializationRegistry(longWaitSerializer));
-Services receiverServices = 
createMessagingService(receiverNode, receiverNetworkConfig)
-) {
-try {
-CountDownLatch latch = new CountDownLatch(2);
-receiverServices.messagingService.addMessageHandler(
-TestMess

(ignite-3) branch main updated: IGNITE-21470 Wait for sender to appear before applying an ack silencer (#3163)

2024-02-06 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 c0f92249c2 IGNITE-21470 Wait for sender to appear before applying an 
ack silencer (#3163)
c0f92249c2 is described below

commit c0f92249c2d5ac235710520b13bfbb2412c27928
Author: Roman Puchkovskiy 
AuthorDate: Tue Feb 6 19:44:29 2024 +0400

IGNITE-21470 Wait for sender to appear before applying an ack silencer 
(#3163)
---
 .../internal/network/netty/ItConnectionManagerTest.java | 17 +
 .../network/netty/OutgoingAcknowledgementSilencer.java  |  5 +
 .../ignite/internal/network/netty/NettySender.java  |  8 
 3 files changed, 30 insertions(+)

diff --git 
a/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java
 
b/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java
index 65122b0481..a921dadfd0 100644
--- 
a/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java
+++ 
b/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java
@@ -388,6 +388,7 @@ public class ItConnectionManagerTest extends 
BaseIgniteAbstractTest {
 ConnectionManagerWrapper manager2 = startManager(4001)
 ) {
 NettySender sender = 
manager1.openChannelTo(manager2).toCompletableFuture().get(10, 
TimeUnit.SECONDS);
+waitTillChannelAppearsInMapOnAcceptor(sender, manager1, manager2);
 
 OutgoingAcknowledgementSilencer ackSilencer = 
dropAcksFrom(manager2);
 
@@ -402,6 +403,22 @@ public class ItConnectionManagerTest extends 
BaseIgniteAbstractTest {
 }
 }
 
+private static void waitTillChannelAppearsInMapOnAcceptor(
+NettySender senderFromOpener,
+ConnectionManagerWrapper opener,
+ConnectionManagerWrapper acceptor
+) throws InterruptedException {
+assertTrue(
+waitForCondition(
+() -> 
acceptor.channels().values().stream().anyMatch(acceptorSender
+-> 
acceptorSender.consistentId().equals(opener.connectionManager.consistentId())
+&& acceptorSender.channelId() == 
senderFromOpener.channelId()),
+TimeUnit.SECONDS.toMillis(10)
+),
+"Did not observe the sender appearing in the acceptor's sender 
map in time"
+);
+}
+
 @Test
 public void sendFuturesCompleteInSendOrder() throws Exception {
 try (
diff --git 
a/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/OutgoingAcknowledgementSilencer.java
 
b/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/OutgoingAcknowledgementSilencer.java
index 160a16263e..e18f8458ee 100644
--- 
a/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/OutgoingAcknowledgementSilencer.java
+++ 
b/modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/OutgoingAcknowledgementSilencer.java
@@ -17,6 +17,9 @@
 
 package org.apache.ignite.internal.network.netty;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.not;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import io.netty.channel.ChannelHandler.Sharable;
@@ -50,6 +53,8 @@ public class OutgoingAcknowledgementSilencer extends 
ChannelOutboundHandlerAdapt
  */
 public static OutgoingAcknowledgementSilencer 
installOn(Collection senders)
 throws InterruptedException {
+assertThat(senders, not(empty()));
+
 OutgoingAcknowledgementSilencer ackSilencer = new 
OutgoingAcknowledgementSilencer(senders.size());
 
 for (NettySender sender : senders) {
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/NettySender.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/NettySender.java
index 82c570d8d3..7bff673b6e 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/NettySender.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/NettySender.java
@@ -30,6 +30,8 @@ import 
org.apache.ignite.internal.network.NettyBootstrapFactory;
 import org.apache.ignite.internal.network.OutNetworkObject;
 import org.apache.ignite.internal.network.direct.DirectMessageWriter;
 import org.apache.ignite.internal.network.recovery.RecoveryDescriptor;
+import org.apache.ignite.internal.tostring.IgniteToStringExclude;
+import org.apache.ignite.internal.tostring.S;
 import org.jetbra

(ignite-3) branch main updated: IGNITE-21111 Add mechanism to wait for completion of in-flight operations of RW transactions started before index appearance (#3160)

2024-02-06 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 164eb449dc IGNITE-2 Add mechanism to wait for completion of 
in-flight operations of RW transactions started before index appearance (#3160)
164eb449dc is described below

commit 164eb449dcb367afe5f8dd3f227862f77afcc567
Author: Kirill Tkalenko 
AuthorDate: Tue Feb 6 17:14:26 2024 +0300

IGNITE-2 Add mechanism to wait for completion of in-flight operations 
of RW transactions started before index appearance (#3160)
---
 .../internal/index/IndexBuildController.java   |   3 +-
 .../ignite/internal/index/IndexBuildTask.java  |  25 +++-
 .../apache/ignite/internal/index/IndexBuilder.java |   7 +-
 .../index/IndexAvailabilityControllerTest.java |  18 ++-
 .../internal/index/IndexBuildControllerTest.java   |  23 +++-
 .../ignite/internal/index/IndexBuilderTest.java|  26 +++-
 .../ignite/internal/replicator/ReplicaService.java |   8 +-
 .../request/BuildIndexReplicaRequest.java  |   3 +
 .../replicator/PartitionReplicaListener.java   |   7 +-
 .../replication/PartitionReplicaListenerTest.java  | 143 -
 10 files changed, 206 insertions(+), 57 deletions(-)

diff --git 
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
 
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
index cb1e9c461e..436bfa67ea 100644
--- 
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
+++ 
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
@@ -311,7 +311,8 @@ class IndexBuildController implements ManuallyCloseable {
 indexStorage,
 mvPartition,
 localNode(),
-enlistmentConsistencyToken
+enlistmentConsistencyToken,
+indexDescriptor.creationCatalogVersion()
 );
 }
 
diff --git 
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildTask.java
 
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildTask.java
index 135af9378e..bd4c523b69 100644
--- 
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildTask.java
+++ 
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildTask.java
@@ -35,11 +35,13 @@ import org.apache.ignite.internal.logger.Loggers;
 import org.apache.ignite.internal.replicator.ReplicaService;
 import org.apache.ignite.internal.replicator.TablePartitionId;
 import 
org.apache.ignite.internal.replicator.exception.PrimaryReplicaMissException;
+import 
org.apache.ignite.internal.replicator.exception.ReplicationTimeoutException;
 import org.apache.ignite.internal.storage.MvPartitionStorage;
 import org.apache.ignite.internal.storage.RowId;
 import org.apache.ignite.internal.storage.index.IndexStorage;
 import org.apache.ignite.internal.table.distributed.TableMessagesFactory;
 import 
org.apache.ignite.internal.table.distributed.replication.request.BuildIndexReplicaRequest;
+import org.apache.ignite.internal.util.CompletableFutures;
 import org.apache.ignite.internal.util.IgniteSpinBusyLock;
 import org.apache.ignite.network.ClusterNode;
 
@@ -69,6 +71,8 @@ class IndexBuildTask {
 
 private final long enlistmentConsistencyToken;
 
+private final int creationCatalogVersion;
+
 private final IgniteSpinBusyLock taskBusyLock = new IgniteSpinBusyLock();
 
 private final AtomicBoolean taskStopGuard = new AtomicBoolean();
@@ -85,7 +89,8 @@ class IndexBuildTask {
 int batchSize,
 ClusterNode node,
 List listeners,
-long enlistmentConsistencyToken
+long enlistmentConsistencyToken,
+int creationCatalogVersion
 ) {
 this.taskId = taskId;
 this.indexStorage = indexStorage;
@@ -98,6 +103,7 @@ class IndexBuildTask {
 // We do not intentionally make a copy of the list, we want to see 
changes in the passed list.
 this.listeners = listeners;
 this.enlistmentConsistencyToken = enlistmentConsistencyToken;
+this.creationCatalogVersion = creationCatalogVersion;
 }
 
 /** Starts building the index. */
@@ -158,8 +164,15 @@ class IndexBuildTask {
 List batchRowIds = createBatchRowIds();
 
 return replicaService.invoke(node, 
createBuildIndexReplicaRequest(batchRowIds))
-.thenComposeAsync(unused -> {
-if (indexStorage.getNextRowIdToBuild() == null) {
+.handleAsync((unused, throwable) -> {
+if (throwable != null) {
+Throwable cause = unwrapCause(throwable);
+
+// Read-write transaction operations have n

(ignite-3) branch main updated: IGNITE-21446 Add IDEA JUnit run configuration settings to build.gradle (#3151)

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

ibessonov 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 e0f4758e85 IGNITE-21446 Add IDEA JUnit run configuration settings to 
build.gradle (#3151)
e0f4758e85 is described below

commit e0f4758e8561aa8643c61702f6f2fb603353d7bf
Author: Ivan Bessonov 
AuthorDate: Mon Feb 5 13:58:51 2024 +0300

IGNITE-21446 Add IDEA JUnit run configuration settings to build.gradle 
(#3151)
---
 build.gradle | 35 ++-
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/build.gradle b/build.gradle
index d47ba84edc..45103b1576 100644
--- a/build.gradle
+++ b/build.gradle
@@ -38,6 +38,22 @@ repositories {
 }
 }
 
+def jvmArgs = [
+"--add-opens=java.base/java.lang=ALL-UNNAMED",
+"--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED",
+"--add-opens=java.base/java.io=ALL-UNNAMED",
+"--add-opens=java.base/java.nio=ALL-UNNAMED",
+"--add-opens=java.base/java.math=ALL-UNNAMED",
+"--add-opens=java.base/java.util=ALL-UNNAMED",
+"--add-opens=java.base/java.time=ALL-UNNAMED",
+"--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
+"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
+"--add-opens=java.base/sun.security.x509=ALL-UNNAMED",
+"-Dio.netty.tryReflectionSetAccessible=true",
+"-XX:+HeapDumpOnOutOfMemoryError"
+]
+
 ext {
 repos = [
 'apache-release'   : "https://repo.maven.apache.org/maven2/;,
@@ -45,19 +61,7 @@ ext {
 'apache-staging'   : 
'https://repository.apache.org/service/local/staging/deploy/maven2'
 ]
 
-defaultJvmArgs = ["--add-opens=java.base/java.lang=ALL-UNNAMED",
-  "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
-  "--add-opens=java.base/java.lang.reflect=ALL-UNNAMED",
-  "--add-opens=java.base/java.io=ALL-UNNAMED",
-  "--add-opens=java.base/java.nio=ALL-UNNAMED",
-  "--add-opens=java.base/java.math=ALL-UNNAMED",
-  "--add-opens=java.base/java.util=ALL-UNNAMED",
-  "--add-opens=java.base/java.time=ALL-UNNAMED",
-  "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
-  "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
-  "--add-opens=java.base/sun.security.x509=ALL-UNNAMED",
-  "-Dio.netty.tryReflectionSetAccessible=true",
-  "-XX:+HeapDumpOnOutOfMemoryError"]
+defaultJvmArgs = jvmArgs
 }
 
 def compilerArgs = [
@@ -142,4 +146,9 @@ idea.project.settings {
 // Workaround on https://youtrack.jetbrains.com/issue/IDEA-154038.
 javacAdditionalOptions = compilerArgs.join(' ')
 }
+runConfigurations {
+defaults(org.jetbrains.gradle.ext.JUnit) {
+vmParameters = jvmArgs.join(' ')
+}
+}
 }



(ignite-3) branch main updated: IGNITE-21423 Improve toString() implementations for classes representing Catalog objects (#3142)

2024-02-01 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 7209a59f5a IGNITE-21423 Improve toString() implementations for classes 
representing Catalog objects (#3142)
7209a59f5a is described below

commit 7209a59f5ae86f0c13f6013e666f3186c923170a
Author: Roman Puchkovskiy 
AuthorDate: Fri Feb 2 11:22:39 2024 +0400

IGNITE-21423 Improve toString() implementations for classes representing 
Catalog objects (#3142)
---
 .../descriptors/CatalogHashIndexDescriptor.java|  2 +-
 .../descriptors/CatalogIndexDescriptor.java|  2 +-
 .../descriptors/CatalogObjectDescriptor.java   |  2 +-
 .../descriptors/CatalogSchemaDescriptor.java   |  2 +-
 .../descriptors/CatalogSortedIndexDescriptor.java  |  2 +-
 .../descriptors/CatalogSystemViewDescriptor.java   |  8 +++-
 .../descriptors/CatalogTableDescriptor.java|  3 +-
 .../catalog/descriptors/CatalogZoneDescriptor.java |  2 +-
 .../CatalogDataStorageDescriptorTest.java  | 37 +++
 .../CatalogHashIndexDescriptorTest.java| 40 
 .../descriptors/CatalogSchemaDescriptorTest.java   | 44 ++
 .../CatalogSortedIndexDescriptorTest.java  | 40 
 .../CatalogSystemViewDescriptorTest.java   | 45 ++
 .../descriptors/CatalogTableDescriptorTest.java| 53 +
 .../descriptors/CatalogZoneDescriptorTest.java | 54 ++
 15 files changed, 328 insertions(+), 8 deletions(-)

diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogHashIndexDescriptor.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogHashIndexDescriptor.java
index 8e7b0c6b45..dc189e4c0b 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogHashIndexDescriptor.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogHashIndexDescriptor.java
@@ -77,6 +77,6 @@ public class CatalogHashIndexDescriptor extends 
CatalogIndexDescriptor {
 
 @Override
 public String toString() {
-return S.toString(this);
+return S.toString(CatalogHashIndexDescriptor.class, this, 
super.toString());
 }
 }
diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogIndexDescriptor.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogIndexDescriptor.java
index 4434ef0af5..eff8ad4dd7 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogIndexDescriptor.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogIndexDescriptor.java
@@ -68,6 +68,6 @@ public abstract class CatalogIndexDescriptor extends 
CatalogObjectDescriptor {
 
 @Override
 public String toString() {
-return S.toString(this);
+return S.toString(CatalogIndexDescriptor.class, this, 
super.toString());
 }
 }
diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogObjectDescriptor.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogObjectDescriptor.java
index ead38f600e..26acb1d5cb 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogObjectDescriptor.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogObjectDescriptor.java
@@ -85,7 +85,7 @@ public abstract class CatalogObjectDescriptor implements 
Serializable {
 
 @Override
 public String toString() {
-return S.toString(this);
+return S.toString(CatalogObjectDescriptor.class, this);
 }
 
 /** Catalog object type. */
diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogSchemaDescriptor.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogSchemaDescriptor.java
index 3134dfa5ae..884d059141 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogSchemaDescriptor.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogSchemaDescriptor.java
@@ -103,6 +103,6 @@ public class CatalogSchemaDescriptor extends 
CatalogObjectDescriptor {
 
 @Override
 public String toString() {
-return S.toString(this);
+return S.toString(CatalogSchemaDescriptor.class, this, 
super.toString());
 }
 }
diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogSortedIndexDescriptor.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogSortedIndexDescriptor.java

(ignite-3) branch main updated: IGNITE-20067 Optimize "StorageUpdateHandler#handleUpdateAll" (#3087)

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

ibessonov 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 55f7a8cf47 IGNITE-20067 Optimize 
"StorageUpdateHandler#handleUpdateAll" (#3087)
55f7a8cf47 is described below

commit 55f7a8cf477682921fe943e6dfa1ebc98c3168c7
Author: Phillippko 
AuthorDate: Tue Jan 30 11:44:31 2024 +0300

IGNITE-20067 Optimize "StorageUpdateHandler#handleUpdateAll" (#3087)
---
 .../runner/app/ItIgniteNodeRestartTest.java|   5 +
 .../org/apache/ignite/internal/app/IgniteImpl.java |   4 +
 .../SchemaDistributedConfigurationModule.java  |   2 +-
 .../StorageUpdateConfigurationSchema.java  |  37 
 .../internal/storage/BaseMvStoragesTest.java   |   3 +
 .../storage/impl/TestMvPartitionStorage.java   |   8 +-
 .../PersistentPageMemoryMvTableStorageTest.java|   3 +-
 .../VolatilePageMemoryMvTableStorageTest.java  |   3 -
 .../PersistentPageMemoryStorageEngineTest.java |   2 -
 ...ageMemoryMvPartitionStorageConcurrencyTest.java |   2 -
 ...rsistentPageMemoryMvPartitionStorageGcTest.java |   2 -
 ...PersistentPageMemoryMvPartitionStorageTest.java |   2 -
 ...ageMemoryMvPartitionStorageConcurrencyTest.java |   3 -
 ...VolatilePageMemoryMvPartitionStorageGcTest.java |   3 -
 .../VolatilePageMemoryMvPartitionStorageTest.java  |   3 -
 .../RocksDbMvPartitionStorageConcurrencyTest.java  |   2 -
 .../rocksdb/RocksDbMvPartitionStorageGcTest.java   |   2 -
 .../rocksdb/RocksDbMvPartitionStorageTest.java |   2 -
 .../storage/rocksdb/RocksDbMvTableStorageTest.java |   2 -
 .../rocksdb/engine/RocksDbStorageEngineTest.java   |   2 -
 .../ItAbstractInternalTableScanTest.java   |   7 +-
 .../ItInternalTableReadOnlyOperationsTest.java |   6 +-
 .../apache/ignite/distributed/ItLockTableTest.java |   5 +
 .../ItTxDistributedCleanupRecoveryTest.java|   1 +
 .../distributed/ItTxDistributedTestSingleNode.java |   5 +
 ...xDistributedTestSingleNodeNoCleanupMessage.java |   1 +
 .../ignite/distributed/ItTxStateLocalMapTest.java  |   9 +-
 .../rebalance/ItRebalanceDistributedTest.java  |   4 +
 .../table/distributed/StorageUpdateHandler.java| 191 ++--
 .../internal/table/distributed/TableManager.java   |  16 +-
 .../internal/table/InteropOperationsTest.java  |   7 +-
 .../internal/table/TableKvOperationsTestBase.java  |   6 +-
 .../internal/table/distributed/IndexBaseTest.java  |   8 +-
 .../table/distributed/StorageCleanupTest.java  |   9 +-
 ...BaseTest.java => StorageUpdateHandlerTest.java} | 193 -
 .../table/distributed/TableManagerTest.java|   6 +
 .../PersistentPageMemoryGcUpdateHandlerTest.java   |   2 -
 .../distributed/gc/RocksDbGcUpdateHandlerTest.java |   2 -
 .../gc/VolatilePageMemoryGcUpdateHandlerTest.java  |   3 -
 .../raft/PartitionCommandListenerTest.java |  13 +-
 .../PartitionReplicaListenerIndexLockingTest.java  |  11 +-
 .../replication/PartitionReplicaListenerTest.java  |  10 +-
 .../apache/ignite/distributed/ItTxTestCluster.java |   8 +-
 .../table/impl/DummyInternalTableImpl.java |  34 +++-
 44 files changed, 403 insertions(+), 246 deletions(-)

diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
index 833de95484..8099a903bf 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
@@ -140,6 +140,7 @@ import org.apache.ignite.internal.replicator.ReplicaService;
 import org.apache.ignite.internal.replicator.TablePartitionId;
 import org.apache.ignite.internal.schema.SchemaManager;
 import org.apache.ignite.internal.schema.configuration.GcConfiguration;
+import 
org.apache.ignite.internal.schema.configuration.StorageUpdateConfiguration;
 import org.apache.ignite.internal.sql.api.IgniteSqlImpl;
 import 
org.apache.ignite.internal.sql.configuration.distributed.SqlDistributedConfiguration;
 import 
org.apache.ignite.internal.sql.configuration.local.SqlLocalConfiguration;
@@ -226,6 +227,9 @@ public class ItIgniteNodeRestartTest extends 
BaseIgniteRestartTest {
 @InjectConfiguration
 private static TransactionConfiguration txConfiguration;
 
+@InjectConfiguration
+private static StorageUpdateConfiguration storageUpdateConfiguration;
+
 @InjectConfiguration
 private CriticalWorkersConfiguration workersConfiguration;
 
@@ -493,6 +497,7 @@ public class ItIgniteNodeRestartTest extends 
BaseIgniteRestartTest {
 name,
 registry,
 gcConfig,
+sto

(ignite-3) branch main updated: IGNITE-21359 Cleanup RebalanceUtil code duplication. (#3098)

2024-01-26 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 96f420de59 IGNITE-21359 Cleanup RebalanceUtil code duplication. (#3098)
96f420de59 is described below

commit 96f420de59c634e8edea07203fd43c0e01d51e66
Author: Ivan Bessonov 
AuthorDate: Fri Jan 26 17:17:11 2024 +0300

IGNITE-21359 Cleanup RebalanceUtil code duplication. (#3098)
---
 .../ItDistributionZonesFilterTest.java |   4 +-
 .../distributionzones/rebalance/RebalanceUtil.java |   9 +-
 .../placementdriver/BasePlacementDriverTest.java   |   2 +-
 .../PlacementDriverManagerTest.java|   2 +-
 .../placementdriver/AssignmentsTracker.java|   2 +-
 .../internal/placementdriver/LeaseUpdaterTest.java |   2 +-
 .../rebalance/ItRebalanceDistributedTest.java  |   6 +-
 .../internal/table/distributed/PartitionMover.java |   2 +-
 .../PartitionReplicatorNodeRecovery.java   |   4 +-
 .../internal/table/distributed/TableManager.java   |  19 +--
 .../raft/RebalanceRaftGroupEventsListener.java |  12 +-
 .../{RebalanceUtil.java => RebalanceUtilEx.java}   | 148 +
 12 files changed, 38 insertions(+), 174 deletions(-)

diff --git 
a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFilterTest.java
 
b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFilterTest.java
index 20c9188570..52d4e0257c 100644
--- 
a/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFilterTest.java
+++ 
b/modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFilterTest.java
@@ -22,12 +22,12 @@ import static 
org.apache.ignite.internal.catalog.commands.CatalogUtils.DEFAULT_F
 import static 
org.apache.ignite.internal.catalog.commands.CatalogUtils.IMMEDIATE_TIMER_VALUE;
 import static 
org.apache.ignite.internal.distributionzones.DistributionZonesTestUtil.assertValueInStorage;
 import static 
org.apache.ignite.internal.distributionzones.DistributionZonesUtil.zoneDataNodesKey;
+import static 
org.apache.ignite.internal.distributionzones.rebalance.RebalanceUtil.pendingPartAssignmentsKey;
+import static 
org.apache.ignite.internal.distributionzones.rebalance.RebalanceUtil.stablePartAssignmentsKey;
 import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.waitForCondition;
 import static org.apache.ignite.internal.util.ByteUtils.fromBytes;
 import static org.apache.ignite.internal.util.ByteUtils.toBytes;
 import static 
org.apache.ignite.internal.util.CompletableFutures.falseCompletedFuture;
-import static 
org.apache.ignite.internal.utils.RebalanceUtil.pendingPartAssignmentsKey;
-import static 
org.apache.ignite.internal.utils.RebalanceUtil.stablePartAssignmentsKey;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Map;
diff --git 
a/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java
 
b/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java
index 3db7459342..7eca1804ec 100644
--- 
a/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java
+++ 
b/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtil.java
@@ -37,7 +37,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.UUID;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
@@ -133,7 +132,7 @@ public class RebalanceUtil {
 //if empty(partition.change.trigger.revision) || 
partition.change.trigger.revision < event.revision:
 //if empty(partition.assignments.pending)
 //  && ((isNewAssignments && 
empty(partition.assignments.stable))
-//  || (partition.assignments.stable != 
calcPartAssighments() && !empty(partition.assignments.stable))):
+//  || (partition.assignments.stable != 
calcPartAssignments() && !empty(partition.assignments.stable))):
 //partition.assignments.pending = calcPartAssignments()
 //partition.change.trigger.revision = event.revision
 //else:
@@ -371,7 +370,7 @@ public class RebalanceUtil {
  * @param key Key.
  * @return Table id.
  */
-public static UUID extractTableId(byte[] key) {
+public static int extractTableId(byte[] key) {
 return extractTableId(key, "");
 }
 

(ignite-3) branch main updated: IGNITE-21347 Fix license header extra whitespaces in ErrorCodeGroup annotation processor (#3091)

2024-01-25 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 302e77902d IGNITE-21347 Fix license header extra whitespaces in 
ErrorCodeGroup annotation processor (#3091)
302e77902d is described below

commit 302e77902d2bdff429122e72101e573bcc138558
Author: Dmitriy Zabotlin 
AuthorDate: Thu Jan 25 11:54:12 2024 +0200

IGNITE-21347 Fix license header extra whitespaces in ErrorCodeGroup 
annotation processor (#3091)
---
 .../error/code/generators/GenericGenerator.java| 32 +++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/modules/error-code-annotation-processor/src/main/java/org/apache/ignite/internal/error/code/generators/GenericGenerator.java
 
b/modules/error-code-annotation-processor/src/main/java/org/apache/ignite/internal/error/code/generators/GenericGenerator.java
index 31761364df..9768b9eec6 100644
--- 
a/modules/error-code-annotation-processor/src/main/java/org/apache/ignite/internal/error/code/generators/GenericGenerator.java
+++ 
b/modules/error-code-annotation-processor/src/main/java/org/apache/ignite/internal/error/code/generators/GenericGenerator.java
@@ -54,22 +54,22 @@ public abstract class GenericGenerator implements 
AbstractCodeGenerator {
 }
 
 void generateLicense() throws IOException {
-line("/*   
   ");
-line(" * Licensed to the Apache Software Foundation (ASF) under one or 
more   ");
-line(" * contributor license agreements. See the NOTICE file 
distributed with ");
-line(" * this work for additional information regarding copyright 
ownership.  ");
-line(" * The ASF licenses this file to You under the Apache License, 
Version 2.0  ");
-line(" * (the \"License\"); you may not use this file except in 
compliance with   ");
-line(" * the License. You may obtain a copy of the License at  
   ");
-line(" *   
   ");
-line(" *  http://www.apache.org/licenses/LICENSE-2.0   
   ");
-line(" *   
   ");
-line(" * Unless required by applicable law or agreed to in writing, 
software  ");
-line(" * distributed under the License is distributed on an \"AS IS\" 
BASIS,  ");
-line(" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 
or implied. ");
-line(" * See the License for the specific language governing 
permissions and  ");
-line(" * limitations under the License.
   ");
-line(" */  
   ");
+line("/*");
+line(" * Licensed to the Apache Software Foundation (ASF) under one or 
more");
+line(" * contributor license agreements. See the NOTICE file 
distributed with");
+line(" * this work for additional information regarding copyright 
ownership.");
+line(" * The ASF licenses this file to You under the Apache License, 
Version 2.0");
+line(" * (the \"License\"); you may not use this file except in 
compliance with");
+line(" * the License. You may obtain a copy of the License at");
+line(" *");
+line(" *  http://www.apache.org/licenses/LICENSE-2.0;);
+line(" *");
+line(" * Unless required by applicable law or agreed to in writing, 
software");
+line(" * distributed under the License is distributed on an \"AS IS\" 
BASIS,");
+line(" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 
or implied.");
+line(" * See the License for the specific language governing 
permissions and");
+line(" * limitations under the License.");
+line(" */");
 line();
 }
 



(ignite-3) branch main updated: IGNITE-21328 Fix logging in LowWatermark#start when there is no low watermark in vault (#3073)

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

ibessonov 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 5bddcef87f IGNITE-21328 Fix logging in LowWatermark#start when there 
is no low watermark in vault (#3073)
5bddcef87f is described below

commit 5bddcef87f3bb8f6fb636d999f7993d6950f8c53
Author: Phillippko 
AuthorDate: Mon Jan 22 17:37:27 2024 +0300

IGNITE-21328 Fix logging in LowWatermark#start when there is no low 
watermark in vault (#3073)
---
 .../ignite/internal/table/distributed/LowWatermark.java| 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/LowWatermark.java
 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/LowWatermark.java
index 38003303f9..f6322251e5 100644
--- 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/LowWatermark.java
+++ 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/LowWatermark.java
@@ -138,10 +138,16 @@ public class LowWatermark implements ManuallyCloseable {
 inBusyLock(busyLock, 
this::scheduleUpdateLowWatermarkBusy);
 }
 } else {
-LOG.info(
-"Low watermark has been successfully got 
from the vault and is scheduled to be updated: {}",
-lowWatermark
-);
+if (lowWatermark == null) {
+LOG.info(
+"Previous value of the low watermark 
was not found, will schedule to update it"
+);
+} else {
+LOG.info(
+"Low watermark has been successfully 
got from the vault and is scheduled to be updated: {}",
+lowWatermark
+);
+}
 }
 });
 });



(ignite-3) branch main updated: IGNITE-21309 Avoid potential memory leaks in direct message writer (#3065)

2024-01-19 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 a9ab2acc04 IGNITE-21309 Avoid potential memory leaks in direct message 
writer (#3065)
a9ab2acc04 is described below

commit a9ab2acc04b21fc51fad6cfddedfb75ac23e2e78
Author: Ivan Bessonov 
AuthorDate: Fri Jan 19 12:58:20 2024 +0300

IGNITE-21309 Avoid potential memory leaks in direct message writer (#3065)
---
 .../ignite/internal/network/direct/DirectMessageWriter.java  |  7 +++
 .../network/direct/stream/DirectByteBufferStreamImplV1.java  | 12 +---
 .../ignite/internal/raft/util/OptimizedMarshaller.java   |  8 +++-
 3 files changed, 11 insertions(+), 16 deletions(-)

diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/direct/DirectMessageWriter.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/direct/DirectMessageWriter.java
index 79bfd620e8..88725cafe3 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/direct/DirectMessageWriter.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/direct/DirectMessageWriter.java
@@ -29,6 +29,7 @@ import 
org.apache.ignite.internal.network.direct.state.DirectMessageState;
 import org.apache.ignite.internal.network.direct.state.DirectMessageStateItem;
 import org.apache.ignite.internal.network.direct.stream.DirectByteBufferStream;
 import 
org.apache.ignite.internal.network.direct.stream.DirectByteBufferStreamImplV1;
+import org.apache.ignite.internal.util.ArrayUtils;
 import org.apache.ignite.network.NetworkMessage;
 import org.apache.ignite.network.serialization.MessageSerializationRegistry;
 import org.apache.ignite.network.serialization.MessageWriter;
@@ -39,6 +40,9 @@ import org.jetbrains.annotations.Nullable;
  * Message writer implementation.
  */
 public class DirectMessageWriter implements MessageWriter {
+/** Empty array-based byte buffer. Not read-only. */
+public static final ByteBuffer EMPTY_BYTE_BUFFER = 
ByteBuffer.wrap(ArrayUtils.BYTE_EMPTY_ARRAY);
+
 /** State. */
 private final DirectMessageState state;
 
@@ -480,6 +484,9 @@ public class DirectMessageWriter implements MessageWriter {
 /** {@inheritDoc} */
 @Override
 public void afterInnerMessageWrite(boolean finished) {
+// Prevent memory leaks.
+setBuffer(EMPTY_BYTE_BUFFER);
+
 state.backward(finished);
 }
 
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/direct/stream/DirectByteBufferStreamImplV1.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/direct/stream/DirectByteBufferStreamImplV1.java
index 1014c85241..768909ff26 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/direct/stream/DirectByteBufferStreamImplV1.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/direct/stream/DirectByteBufferStreamImplV1.java
@@ -2050,17 +2050,7 @@ public class DirectByteBufferStreamImplV1 implements 
DirectByteBufferStream {
 break;
 
 case MSG:
-try {
-if (val != null) {
-writer.beforeInnerMessageWrite();
-}
-
-writeMessage((NetworkMessage) val, writer);
-} finally {
-if (val != null) {
-writer.afterInnerMessageWrite(lastFinished);
-}
-}
+writeMessage((NetworkMessage) val, writer);
 
 break;
 
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/util/OptimizedMarshaller.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/util/OptimizedMarshaller.java
index f555679de8..4686d6e01c 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/util/OptimizedMarshaller.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/util/OptimizedMarshaller.java
@@ -17,6 +17,8 @@
 
 package org.apache.ignite.internal.raft.util;
 
+import static 
org.apache.ignite.internal.network.direct.DirectMessageWriter.EMPTY_BYTE_BUFFER;
+
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.Arrays;
@@ -25,7 +27,6 @@ import 
org.apache.ignite.internal.network.direct.DirectMessageWriter;
 import org.apache.ignite.internal.network.direct.stream.DirectByteBufferStream;
 import 
org.apache.ignite.internal.network.direct.stream.DirectByteBufferStreamImplV1;
 import org.apache.ignite.internal.raft.Marshaller;
-import org.apache.ignite.internal.util.ArrayUtils;
 import org.apache.ignite.network.NetworkMessage;
 import org.apache.ignite.network.serialization.MessageReader;
 import org.apache.ignite.network.serialization.MessageSerializationRegistry;
@@ -68,9 +69,6 @@ public class

(ignite-3) branch main updated: IGNITE-21234 Introduce a more flexible way of triggering "too many dirty pages" checkpoints (#3033)

2024-01-16 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 ca21384f85 IGNITE-21234 Introduce a more flexible way of triggering 
"too many dirty pages" checkpoints (#3033)
ca21384f85 is described below

commit ca21384f85e8c779258cb3b21f54b6c30a7071e4
Author: Ivan Bessonov 
AuthorDate: Tue Jan 16 14:26:30 2024 +0300

IGNITE-21234 Introduce a more flexible way of triggering "too many dirty 
pages" checkpoints (#3033)
---
 .../pagememory/persistence/CheckpointUrgency.java  | 41 +++
 .../persistence/PersistentPageMemory.java  | 47 ++
 .../persistence/checkpoint/CheckpointManager.java  | 27 +
 .../checkpoint/CheckpointTimeoutLock.java  | 28 -
 .../PersistentPageMemoryNoLoadTest.java| 32 ++-
 .../checkpoint/CheckpointManagerTest.java  | 44 ++--
 .../checkpoint/CheckpointTimeoutLockTest.java  | 33 ---
 .../checkpoint/CheckpointTestUtils.java|  3 +-
 8 files changed, 175 insertions(+), 80 deletions(-)

diff --git 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/CheckpointUrgency.java
 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/CheckpointUrgency.java
new file mode 100644
index 00..913f513a0d
--- /dev/null
+++ 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/CheckpointUrgency.java
@@ -0,0 +1,41 @@
+/*
+ * 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.pagememory.persistence;
+
+/**
+ * Checkpoint urgency status enum.
+ */
+public enum CheckpointUrgency {
+/**
+ * Signifies that there's enough free space in page memory to allow taking 
checkpoint read locks, and there's no need to trigger
+ * checkpoint.
+ */
+NOT_REQUIRED,
+
+/**
+ * Signifies that there's still enough free space in page memory to allow 
taking checkpoint read locks, but it's more limited and we're
+ * at the point where we should schedule a checkpoint.
+ */
+SHOULD_TRIGGER,
+
+/**
+ * Signifies that there might not be enough free space in page memory to 
allow taking checkpoint read locks, and we should wait until
+ * scheduled checkpoint is started and collection of dirty pages is empty 
once again.
+ */
+MUST_TRIGGER
+}
diff --git 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
index 6543970f40..0a17bf563b 100644
--- 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
+++ 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
@@ -27,6 +27,9 @@ import static 
org.apache.ignite.internal.pagememory.io.PageIo.getPageId;
 import static org.apache.ignite.internal.pagememory.io.PageIo.getType;
 import static org.apache.ignite.internal.pagememory.io.PageIo.getVersion;
 import static org.apache.ignite.internal.pagememory.io.PageIo.setPageId;
+import static 
org.apache.ignite.internal.pagememory.persistence.CheckpointUrgency.MUST_TRIGGER;
+import static 
org.apache.ignite.internal.pagememory.persistence.CheckpointUrgency.NOT_REQUIRED;
+import static 
org.apache.ignite.internal.pagememory.persistence.CheckpointUrgency.SHOULD_TRIGGER;
 import static 
org.apache.ignite.internal.pagememory.persistence.PageHeader.dirty;
 import static 
org.apache.ignite.internal.pagememory.persistence.PageHeader.fullPageId;
 import static 
org.apache.ignite.internal.pagememory.persistence.PageHeader.isAcquired;
@@ -71,6 +74,7 @@ import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
 import java.ut

(ignite-3) branch main updated: IGNITE-21245 Remove APPLIED_REV_KEY from metastorage manager (#3042)

2024-01-15 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 c40b788b50 IGNITE-21245 Remove APPLIED_REV_KEY from metastorage 
manager (#3042)
c40b788b50 is described below

commit c40b788b5051b33c4ae1777e0b3e65cf90c03819
Author: Ivan Bessonov 
AuthorDate: Mon Jan 15 16:26:24 2024 +0300

IGNITE-21245 Remove APPLIED_REV_KEY from metastorage manager (#3042)
---
 .../catalog/CatalogManagerRecoveryTest.java|  8 +--
 .../catalog/storage/UpdateLogImplTest.java | 14 +
 .../internal/catalog/BaseCatalogManagerTest.java   | 10 +---
 .../ignite/internal/catalog/CatalogTestUtils.java  |  9 +--
 .../metastore/DeploymentUnitStoreImplTest.java |  8 +--
 ...niteDistributionZoneManagerNodeRestartTest.java |  2 -
 .../distributionzones/DistributionZoneManager.java |  3 -
 .../BaseDistributionZoneManagerTest.java   | 11 +---
 .../DistributionZoneRebalanceEngineTest.java   | 11 +---
 .../IndexAvailabilityControllerRestorerTest.java   | 13 ++---
 .../index/IndexAvailabilityControllerTest.java | 11 +---
 .../ignite/internal/index/IndexManagerTest.java| 14 ++---
 .../impl/ItMetaStorageManagerImplTest.java | 11 +---
 .../ItMetaStorageMultipleNodesAbstractTest.java|  1 -
 ...MetaStorageSafeTimePropagationAbstractTest.java |  5 +-
 .../metastorage/impl/ItMetaStorageWatchTest.java   |  1 -
 .../metastorage/impl/MetaStorageManagerImpl.java   | 67 --
 .../server/OnRevisionAppliedCallback.java  |  7 +--
 .../metastorage/server/WatchProcessor.java | 46 ++-
 .../MetaStorageDeployWatchesCorrectnessTest.java   | 24 +---
 .../impl/MetaStorageManagerRecoveryTest.java   |  4 --
 .../metastorage/impl/MetaStorageRangeTest.java | 13 +
 .../server/BasicOperationsKeyValueStorageTest.java | 13 ++---
 .../metastorage/server/WatchProcessorTest.java | 21 ++-
 .../impl/StandaloneMetaStorageManager.java | 18 ++
 .../MultiActorPlacementDriverTest.java |  6 +-
 .../ignite/internal/placementdriver/Node.java  |  8 +--
 .../PlacementDriverManagerTest.java| 11 +---
 .../placementdriver/PlacementDriverTest.java   | 12 +---
 .../ItDistributedConfigurationPropertiesTest.java  |  1 -
 .../ItDistributedConfigurationStorageTest.java |  1 -
 .../runner/app/ItIgniteNodeRestartTest.java|  2 -
 .../org/apache/ignite/internal/app/IgniteImpl.java |  2 -
 .../ignite/internal/schema/SchemaManagerTest.java  | 10 +---
 .../rebalance/ItRebalanceDistributedTest.java  |  2 -
 .../table/distributed/TableManagerTest.java|  9 +--
 36 files changed, 85 insertions(+), 324 deletions(-)

diff --git 
a/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerRecoveryTest.java
 
b/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerRecoveryTest.java
index e8d3f3ce14..f5e6abf7cd 100644
--- 
a/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerRecoveryTest.java
+++ 
b/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerRecoveryTest.java
@@ -41,8 +41,6 @@ import 
org.apache.ignite.internal.testframework.BaseIgniteAbstractTest;
 import org.apache.ignite.internal.testframework.WorkDirectory;
 import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
 import org.apache.ignite.internal.util.IgniteUtils;
-import org.apache.ignite.internal.vault.VaultManager;
-import org.apache.ignite.internal.vault.inmemory.InMemoryVaultService;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
@@ -57,15 +55,13 @@ public class CatalogManagerRecoveryTest extends 
BaseIgniteAbstractTest {
 
 private final HybridClock clock = new HybridClockImpl();
 
-private final VaultManager vaultManager = new VaultManager(new 
InMemoryVaultService());
-
 private MetaStorageManager metaStorageManager;
 
 private CatalogManager catalogManager;
 
 @AfterEach
 void tearDown() throws Exception {
-IgniteUtils.stopAll(catalogManager, metaStorageManager, vaultManager);
+IgniteUtils.stopAll(catalogManager, metaStorageManager);
 }
 
 @Test
@@ -113,7 +109,7 @@ public class CatalogManagerRecoveryTest extends 
BaseIgniteAbstractTest {
 private void createComponents() {
 KeyValueStorage keyValueStorage = new 
TestRocksDbKeyValueStorage(NODE_NAME, workDir);
 
-metaStorageManager = StandaloneMetaStorageManager.create(vaultManager, 
keyValueStorage);
+metaStorageManager = 
StandaloneMetaStorageManager.create(keyValueStorage);
 
 catalogManager = CatalogTestUtils.createTestCatalogManager(NODE_NAME, 
clock, metaStorageManager);
 }
diff --git 
a/modules/catalog/src/test/java/org

(ignite-3) branch main updated: IGNITE-21205 Get rid of metastorage in schema manager (#3013)

2024-01-09 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 09116a30f7 IGNITE-21205 Get rid of metastorage in schema manager 
(#3013)
09116a30f7 is described below

commit 09116a30f7b5c92e50375d5b588821d4ec1b705a
Author: Ivan Bessonov 
AuthorDate: Wed Jan 10 09:44:10 2024 +0300

IGNITE-21205 Get rid of metastorage in schema manager (#3013)
---
 .../catalog/commands/CreateTableCommand.java   |   6 +-
 .../descriptors/CatalogTableDescriptor.java|  63 +-
 .../descriptors/CatalogTableSchemaVersions.java|  99 +
 .../internal/catalog/storage/AlterColumnEntry.java |  14 +-
 .../internal/catalog/storage/DropColumnsEntry.java |  11 +-
 .../internal/catalog/storage/NewColumnsEntry.java  |  11 +-
 .../MakeIndexAvailableCommandValidationTest.java   |   6 +-
 .../handler/requests/jdbc/JdbcMetadataCatalog.java |   2 +-
 .../ignite/client/handler/FakeCatalogService.java  |   2 +-
 .../RebalanceUtilUpdateAssignmentsTest.java|   6 +-
 .../ignite/internal/schema/SchemaManager.java  | 154 --
 .../apache/ignite/internal/schema/SchemaUtils.java |   2 +-
 .../CatalogToSchemaDescriptorConverter.java|  14 +-
 .../ignite/internal/schema/SchemaManagerTest.java  | 225 +
 .../CatalogToSchemaDescriptorConverterTest.java|   8 +-
 .../storage/AbstractMvTableStorageTest.java|   6 +-
 .../storage/index/AbstractIndexStorageTest.java|   6 +-
 .../replication/PartitionReplicaListenerTest.java  |   7 +-
 .../schema/CatalogValidationSchemasSourceTest.java |  12 +-
 19 files changed, 244 insertions(+), 410 deletions(-)

diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java
index f423f11578..22e8c90b61 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.catalog.commands;
 
 import static java.util.Objects.requireNonNullElse;
 import static java.util.stream.Collectors.toList;
-import static 
org.apache.ignite.internal.catalog.CatalogManagerImpl.INITIAL_CAUSALITY_TOKEN;
 import static 
org.apache.ignite.internal.catalog.CatalogParamsValidationUtils.ensureNoTableIndexOrSysViewExistsWithGivenName;
 import static 
org.apache.ignite.internal.catalog.commands.CatalogUtils.pkIndexName;
 import static 
org.apache.ignite.internal.catalog.commands.CatalogUtils.schemaOrThrow;
@@ -111,12 +110,9 @@ public class CreateTableCommand extends 
AbstractTableCommand {
 pkIndexId,
 tableName,
 zone.id(),
-CatalogTableDescriptor.INITIAL_TABLE_VERSION,
 
columns.stream().map(CatalogUtils::fromParams).collect(toList()),
 primaryKeyColumns,
-colocationColumns,
-INITIAL_CAUSALITY_TOKEN,
-INITIAL_CAUSALITY_TOKEN
+colocationColumns
 );
 
 String indexName = pkIndexName(tableName);
diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogTableDescriptor.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogTableDescriptor.java
index 89edf8bb98..b9157c2650 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogTableDescriptor.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/descriptors/CatalogTableDescriptor.java
@@ -27,6 +27,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
+import 
org.apache.ignite.internal.catalog.descriptors.CatalogTableSchemaVersions.TableVersion;
 import org.apache.ignite.internal.tostring.IgniteToStringExclude;
 import org.apache.ignite.internal.tostring.S;
 import org.jetbrains.annotations.Nullable;
@@ -45,7 +46,7 @@ public class CatalogTableDescriptor extends 
CatalogObjectDescriptor {
 
 private final int pkIndexId;
 
-private final int tableVersion;
+private final CatalogTableSchemaVersions schemaVersions;
 
 private final List columns;
 private final List primaryKeyColumns;
@@ -57,28 +58,51 @@ public class CatalogTableDescriptor extends 
CatalogObjectDescriptor {
 private long creationToken;
 
 /**
- * Constructor.
+ * Constructor for new table.
+ *
+ * @param id Table id.
+ * @param pkIndexId Primary key index id.
+ * @param name Table name.
+ * @param zoneId Distribution zone ID.
+ * @param columns Table column descriptors

(ignite-3) branch main updated: IGNITE-21196 Optimize primary replica events processing (#3007)

2024-01-04 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 47c9e2776e IGNITE-21196 Optimize primary replica events processing 
(#3007)
47c9e2776e is described below

commit 47c9e2776ef76c7bfd7ffe013370a58fe434605b
Author: Ivan Bessonov 
AuthorDate: Thu Jan 4 12:29:47 2024 +0300

IGNITE-21196 Optimize primary replica events processing (#3007)
---
 .../apache/ignite/internal/replicator/Replica.java |  7 +++
 .../ignite/internal/replicator/ReplicaManager.java | 51 ++
 .../replicator/listener/ReplicaListener.java   | 18 
 .../replicator/PartitionReplicaListener.java   | 26 +++
 .../PartitionReplicaListenerDurableUnlockTest.java |  5 +--
 5 files changed, 96 insertions(+), 11 deletions(-)

diff --git 
a/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java
 
b/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java
index 3a4c53b2b8..5945cd8672 100644
--- 
a/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java
+++ 
b/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java
@@ -123,6 +123,13 @@ public class Replica {
 raftClient.subscribeLeader(this::onLeaderElected);
 }
 
+/**
+ * Returns an instance of replica listener, associated with current 
replica.
+ */
+ReplicaListener replicaListener() {
+return listener;
+}
+
 /**
  * Processes a replication request on the replica.
  *
diff --git 
a/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java
 
b/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java
index 84bcd9da3d..2b045b162f 100644
--- 
a/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java
+++ 
b/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaManager.java
@@ -21,6 +21,7 @@ import static 
java.util.concurrent.CompletableFuture.completedFuture;
 import static java.util.stream.Collectors.toSet;
 import static 
org.apache.ignite.internal.replicator.LocalReplicaEvent.AFTER_REPLICA_STARTED;
 import static 
org.apache.ignite.internal.replicator.LocalReplicaEvent.BEFORE_REPLICA_STOPPED;
+import static 
org.apache.ignite.internal.util.CompletableFutures.falseCompletedFuture;
 import static org.apache.ignite.internal.util.ExceptionUtils.unwrapCause;
 import static org.apache.ignite.internal.util.IgniteUtils.inBusyLock;
 import static 
org.apache.ignite.internal.util.IgniteUtils.shutdownAndAwaitTermination;
@@ -50,6 +51,8 @@ import org.apache.ignite.internal.logger.IgniteLogger;
 import org.apache.ignite.internal.logger.Loggers;
 import org.apache.ignite.internal.manager.IgniteComponent;
 import org.apache.ignite.internal.placementdriver.PlacementDriver;
+import org.apache.ignite.internal.placementdriver.event.PrimaryReplicaEvent;
+import 
org.apache.ignite.internal.placementdriver.event.PrimaryReplicaEventParameters;
 import 
org.apache.ignite.internal.placementdriver.message.PlacementDriverMessageGroup;
 import 
org.apache.ignite.internal.placementdriver.message.PlacementDriverMessagesFactory;
 import 
org.apache.ignite.internal.placementdriver.message.PlacementDriverReplicaMessage;
@@ -227,6 +230,9 @@ public class ReplicaManager extends 
AbstractEventProducer(),
 NamedThreadFactory.create(nodeName, "replica", LOG)
 );
+
+placementDriver.listen(PrimaryReplicaEvent.PRIMARY_REPLICA_ELECTED, 
this::onPrimaryReplicaElected);
+placementDriver.listen(PrimaryReplicaEvent.PRIMARY_REPLICA_EXPIRED, 
this::onPrimaryReplicaExpired);
 }
 
 private void onReplicaMessageReceived(NetworkMessage message, String 
senderConsistentId, @Nullable Long correlationId) {
@@ -744,6 +750,51 @@ public class ReplicaManager extends 
AbstractEventProducer onPrimaryReplicaElected(
+PrimaryReplicaEventParameters primaryReplicaEventParameters,
+Throwable throwable
+) {
+CompletableFuture replica = 
replicas.get(primaryReplicaEventParameters.groupId());
+
+if (replica == null) {
+return falseCompletedFuture();
+}
+
+if (replica.isDone() && !replica.isCompletedExceptionally()) {
+return 
replica.join().replicaListener().onPrimaryElected(primaryReplicaEventParameters,
 throwable);
+} else {
+return replica.thenCompose(r -> 
r.replicaListener().onPrimaryElected(primaryReplicaEventParameters, throwable));
+}
+}
+
+/**
+ * Event handler for {@link PrimaryReplicaEvent#PRIMARY_REPLICA_EXPIRED}. 
Propagates execution to the
+ *  {@link 
ReplicaListener#onPrimaryExpired(PrimaryReplicaEventParameters, Throwa

(ignite-3) branch main updated: IGNITE-21198 Optimize memory usage in AbstractEventProducer#fireEvent (#3008)

2024-01-04 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 2706b6719e IGNITE-21198 Optimize memory usage in 
AbstractEventProducer#fireEvent (#3008)
2706b6719e is described below

commit 2706b6719e1212af3516c4cbe047791b5ef08e72
Author: Ivan Bessonov 
AuthorDate: Thu Jan 4 12:18:15 2024 +0300

IGNITE-21198 Optimize memory usage in AbstractEventProducer#fireEvent 
(#3008)
---
 .../internal/event/AbstractEventProducer.java  | 28 +++---
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/event/AbstractEventProducer.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/event/AbstractEventProducer.java
index 155a7692dc..4a722e5dca 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/event/AbstractEventProducer.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/event/AbstractEventProducer.java
@@ -81,20 +81,32 @@ public abstract class AbstractEventProducer[] futures = new 
CompletableFuture[listeners.size()];
+// Lazy init.
+List> futures = null;
 
 for (int i = 0; i < listeners.size(); i++) {
 EventListener listener = listeners.get(i);
 
-futures[i] = listener.notify(params, err)
-.thenAccept(remove -> {
-if (remove) {
-removeListener(evt, listener);
-}
-});
+CompletableFuture future = listener.notify(params, err);
+
+if (future.isDone() && !future.isCompletedExceptionally()) {
+if (future.join()) {
+removeListener(evt, listener);
+}
+} else {
+if (futures == null) {
+futures = new ArrayList<>();
+}
+
+futures.add(future.thenAccept(remove -> {
+if (remove) {
+removeListener(evt, listener);
+}
+}));
+}
 }
 
-return allOf(futures);
+return futures == null ? nullCompletedFuture() : 
allOf(futures.toArray(CompletableFuture[]::new));
 }
 
 /**



(ignite-3) branch main updated: IGNITE-21187 Enable type changing-related test in ItSchemaForwardCompatibilityTest (#3004)

2024-01-03 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 db66e70454 IGNITE-21187 Enable type changing-related test in 
ItSchemaForwardCompatibilityTest (#3004)
db66e70454 is described below

commit db66e704547d9008ad08a6aa60200965098f
Author: Roman Puchkovskiy 
AuthorDate: Wed Jan 3 13:18:47 2024 +0400

IGNITE-21187 Enable type changing-related test in 
ItSchemaForwardCompatibilityTest (#3004)
---
 .../ignite/internal/schemasync/ItSchemaForwardCompatibilityTest.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaForwardCompatibilityTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaForwardCompatibilityTest.java
index 563b97b375..9ed055436d 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaForwardCompatibilityTest.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/schemasync/ItSchemaForwardCompatibilityTest.java
@@ -135,9 +135,8 @@ class ItSchemaForwardCompatibilityTest extends 
ClusterPerTestIntegrationTest {
 ADD_COLUMN_WITH_DEFAULT("ALTER TABLE " + TABLE_NAME + " ADD COLUMN 
new_col INT NOT NULL DEFAULT 42"),
 // TODO: IGNITE-19485, IGNITE-20315 - Uncomment this after column 
rename support gets aded.
 //RENAME_COLUMN("ALTER TABLE " + TABLE_NAME + " RENAME COLUMN 
not_null_int to new_col"),
-DROP_NOT_NULL("ALTER TABLE " + TABLE_NAME + " ALTER COLUMN 
not_null_int DROP NOT NULL");
-// TODO: Uncomment after 
https://issues.apache.org/jira/browse/IGNITE-20906 is fixed.
-//WIDEN_COLUMN_TYPE("ALTER TABLE " + TABLE_NAME + " ALTER COLUMN 
not_null_int SET DATA TYPE BIGINT"),
+DROP_NOT_NULL("ALTER TABLE " + TABLE_NAME + " ALTER COLUMN 
not_null_int DROP NOT NULL"),
+WIDEN_COLUMN_TYPE("ALTER TABLE " + TABLE_NAME + " ALTER COLUMN 
not_null_int SET DATA TYPE BIGINT");
 
 private final String ddl;
 



(ignite-3) branch main updated: IGNITE-20978 Send ScaleCube messages in a separate channel (#2986)

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

ibessonov 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 d8cc264aca IGNITE-20978 Send ScaleCube messages in a separate channel 
(#2986)
d8cc264aca is described below

commit d8cc264aca0553971b1e28d7a99d77fa032eae76
Author: Roman Puchkovskiy 
AuthorDate: Mon Dec 25 17:44:26 2023 +0400

IGNITE-20978 Send ScaleCube messages in a separate channel (#2986)
---
 .../deployunit/DeployMessagingService.java |   2 +-
 .../ignite/internal/network/file/Channel.java  |   2 +-
 .../scalecube/ItScaleCubeNetworkMessagingTest.java | 149 ++-
 .../internal/network/netty/HandshakeHandler.java   |   5 +-
 .../internal/network/netty/InNetworkObject.java|  12 +-
 .../internal/network/netty/MessageHandler.java |   9 +-
 .../recovery/RecoveryClientHandshakeManager.java   |   2 +-
 .../recovery/RecoveryServerHandshakeManager.java   |   2 +-
 .../ignite/network/DefaultMessagingService.java|  37 ++--
 .../apache/ignite/network/LazyStripedExecutor.java | 110 +++
 .../ScaleCubeDirectMarshallerTransport.java|   5 +-
 .../network/DefaultMessagingServiceTest.java   | 212 +++--
 12 files changed, 502 insertions(+), 45 deletions(-)

diff --git 
a/modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/DeployMessagingService.java
 
b/modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/DeployMessagingService.java
index 397a8f8907..01ddea90c7 100644
--- 
a/modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/DeployMessagingService.java
+++ 
b/modules/code-deployment/src/main/java/org/apache/ignite/internal/deployunit/DeployMessagingService.java
@@ -42,7 +42,7 @@ import org.apache.ignite.network.ClusterService;
 public class DeployMessagingService {
 private static final IgniteLogger LOG = 
Loggers.forClass(DeployMessagingService.class);
 
-private static final ChannelType DEPLOYMENT_CHANNEL = 
ChannelType.register((short) 1, "DeploymentUnits");
+private static final ChannelType DEPLOYMENT_CHANNEL = 
ChannelType.register((short) 2, "DeploymentUnits");
 
 /**
  * Cluster service.
diff --git 
a/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/Channel.java
 
b/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/Channel.java
index 119cf651bc..64357a369f 100644
--- 
a/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/Channel.java
+++ 
b/modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/Channel.java
@@ -26,7 +26,7 @@ final class Channel {
 /**
  * File transfer channel.
  */
-static final ChannelType FILE_TRANSFER_CHANNEL = 
ChannelType.register((short) 2, "FileTransfer");
+static final ChannelType FILE_TRANSFER_CHANNEL = 
ChannelType.register((short) 3, "FileTransfer");
 
 private Channel() {
 // No-op.
diff --git 
a/modules/network/src/integrationTest/java/org/apache/ignite/network/scalecube/ItScaleCubeNetworkMessagingTest.java
 
b/modules/network/src/integrationTest/java/org/apache/ignite/network/scalecube/ItScaleCubeNetworkMessagingTest.java
index 0893738955..529169a5a6 100644
--- 
a/modules/network/src/integrationTest/java/org/apache/ignite/network/scalecube/ItScaleCubeNetworkMessagingTest.java
+++ 
b/modules/network/src/integrationTest/java/org/apache/ignite/network/scalecube/ItScaleCubeNetworkMessagingTest.java
@@ -242,7 +242,43 @@ class ItScaleCubeNetworkMessagingTest {
 }
 
 /**
- * Tests that if the network component is stopped while waiting for a 
response to an "invoke" call, the corresponding future completes
+ * Tests that if the network component is stopped before trying to make an 
"invoke" call, the corresponding future completes
+ * exceptionally.
+ */
+@Test
+public void testInvokeAfterStop(TestInfo testInfo) throws 
InterruptedException {
+testCluster = new Cluster(2, testInfo);
+testCluster.startAwait();
+
+ClusterService member0 = testCluster.members.get(0);
+ClusterService member1 = testCluster.members.get(1);
+
+member0.stop();
+
+// Perform two invokes to test that multiple requests can get 
cancelled.
+CompletableFuture invoke0 = 
member0.messagingService().invoke(
+member1.topologyService().localMember(),
+messageFactory.testMessage().build(),
+1000
+);
+
+CompletableFuture invoke1 = 
member0.messagingService().invoke(
+member1.topologyService().localMember(),
+messageFactory.testMessage().build(),
+1000
+);
+
+ExecutionException e = assertThrows(Exec

(ignite-3) branch main updated: IGNITE-21121 Move ItLogicalTopologyTest to the cluster-management module (#2977)

2023-12-19 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 00775e8f24 IGNITE-21121 Move ItLogicalTopologyTest to the 
cluster-management module (#2977)
00775e8f24 is described below

commit 00775e8f2439cd36cd5546e6f7e4e241ad243aee
Author: Roman Puchkovskiy 
AuthorDate: Tue Dec 19 16:40:22 2023 +0400

IGNITE-21121 Move ItLogicalTopologyTest to the cluster-management module 
(#2977)
---
 modules/cluster-management/build.gradle | 1 +
 .../internal/cluster/management/topology}/ItLogicalTopologyTest.java| 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/cluster-management/build.gradle 
b/modules/cluster-management/build.gradle
index 071979b27a..988af51217 100644
--- a/modules/cluster-management/build.gradle
+++ b/modules/cluster-management/build.gradle
@@ -69,6 +69,7 @@ dependencies {
 integrationTestImplementation testFixtures(project(':ignite-core'))
 integrationTestImplementation 
testFixtures(project(':ignite-configuration'))
 integrationTestImplementation testFixtures(project(':ignite-network'))
+integrationTestImplementation testFixtures(project(':ignite-runner'))
 integrationTestImplementation libs.awaitility
 integrationTestImplementation libs.jetbrains.annotations
 }
diff --git 
a/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItLogicalTopologyTest.java
 
b/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/topology/ItLogicalTopologyTest.java
similarity index 99%
rename from 
modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItLogicalTopologyTest.java
rename to 
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/topology/ItLogicalTopologyTest.java
index 41da3d4cd0..ff6210a705 100644
--- 
a/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItLogicalTopologyTest.java
+++ 
b/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/topology/ItLogicalTopologyTest.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.ignite.internal.compute;
+package org.apache.ignite.internal.cluster.management.topology;
 
 import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.testNodeName;
 import static org.hamcrest.MatcherAssert.assertThat;



(ignite-3) branch main updated: IGNITE-21063 Optimize memory usage in optimized marshaller (#2950)

2023-12-13 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 7620cb89ca IGNITE-21063 Optimize memory usage in optimized marshaller 
(#2950)
7620cb89ca is described below

commit 7620cb89ca88601dd817366dcc6d18c3ee848feb
Author: Ivan Bessonov 
AuthorDate: Wed Dec 13 16:38:29 2023 +0300

IGNITE-21063 Optimize memory usage in optimized marshaller (#2950)
---
 .../ignite/internal/index/ItBuildIndexTest.java|  3 +-
 .../internal/raft/util/DefaultByteBuffersPool.java | 76 ++
 ...edMarshaller.java => EmptyByteBuffersPool.java} | 27 ++--
 .../internal/raft/util/OptimizedMarshaller.java| 75 ++---
 .../raft/util/ThreadLocalOptimizedMarshaller.java  |  6 +-
 .../ignite/internal/raft/RaftGroupServiceTest.java |  3 +-
 .../raft/util/DefaultByteBuffersPoolTest.java  | 66 +++
 .../raft/util/EmptyByteBuffersPoolTest.java| 34 ++
 .../raftsnapshot/ItTableRaftSnapshotsTest.java |  3 +-
 .../schema/PartitionCommandsMarshallerImpl.java|  8 +--
 .../ThreadLocalPartitionCommandsMarshaller.java|  7 +-
 .../CheckCatalogVersionOnActionRequestTest.java|  3 +-
 .../PartitionCommandsMarshallerImplTest.java   |  5 +-
 13 files changed, 273 insertions(+), 43 deletions(-)

diff --git 
a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java
 
b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java
index 94e8ba7ecc..291cf607bd 100644
--- 
a/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java
+++ 
b/modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.index;
 
 import static java.util.stream.Collectors.joining;
+import static org.apache.ignite.internal.raft.util.OptimizedMarshaller.NO_POOL;
 import static 
org.apache.ignite.internal.sql.engine.util.QueryChecker.containsIndexScan;
 import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.waitForCondition;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe;
@@ -261,7 +262,7 @@ public class ItBuildIndexTest extends 
BaseSqlIntegrationTest {
 ) {
 IgniteImpl node = CLUSTER.node(0);
 MessageSerializationRegistry serializationRegistry = 
node.raftManager().service().serializationRegistry();
-var commandsMarshaller = new 
PartitionCommandsMarshallerImpl(serializationRegistry);
+var commandsMarshaller = new 
PartitionCommandsMarshallerImpl(serializationRegistry, NO_POOL);
 
 return (nodeConsistentId, networkMessage) -> {
 if (networkMessage instanceof WriteActionRequest) {
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/util/DefaultByteBuffersPool.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/util/DefaultByteBuffersPool.java
new file mode 100644
index 00..631816ece6
--- /dev/null
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/util/DefaultByteBuffersPool.java
@@ -0,0 +1,76 @@
+/*
+ * 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.raft.util;
+
+import static 
org.apache.ignite.internal.raft.util.OptimizedMarshaller.DEFAULT_BUFFER_SIZE;
+import static 
org.apache.ignite.internal.raft.util.OptimizedMarshaller.MAX_CACHED_BUFFER_BYTES;
+
+import java.nio.ByteBuffer;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.atomic.AtomicInteger;
+import 
org.apache.ignite.internal.raft.util.OptimizedMarshaller.ByteBuffersPool;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Basic pool implementation with limited capacity.
+ */
+public class DefaultByteBuffersPool implements ByteBuffersPool {
+/** Max pool size. */
+private final int capacity;
+
+/** Queue with cached buffers. */
+private final Queue queue;
+
+/** Pool s

(ignite-3) branch main updated: IGNITE-20971 Fix deadlock when receiving obsolete lease (#2929)

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

ibessonov 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 08827046a8 IGNITE-20971 Fix deadlock when receiving obsolete lease 
(#2929)
08827046a8 is described below

commit 08827046a8e6409b59b7a7597adc7a650fe091f0
Author: Ivan Bessonov 
AuthorDate: Thu Dec 7 18:00:42 2023 +0300

IGNITE-20971 Fix deadlock when receiving obsolete lease (#2929)
---
 .../internal/index/IndexBuildController.java   | 11 +++---
 .../metastorage/server/WatchProcessor.java | 42 +-
 .../internal/table/distributed/TableManager.java   |  4 +++
 3 files changed, 51 insertions(+), 6 deletions(-)

diff --git 
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
 
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
index 1bc8568931..81ae939949 100644
--- 
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
+++ 
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
@@ -39,6 +39,7 @@ import 
org.apache.ignite.internal.catalog.events.CreateIndexEventParameters;
 import org.apache.ignite.internal.catalog.events.DropIndexEventParameters;
 import org.apache.ignite.internal.close.ManuallyCloseable;
 import org.apache.ignite.internal.hlc.HybridClock;
+import org.apache.ignite.internal.hlc.HybridTimestamp;
 import org.apache.ignite.internal.placementdriver.PlacementDriver;
 import 
org.apache.ignite.internal.placementdriver.PrimaryReplicaAwaitTimeoutException;
 import org.apache.ignite.internal.placementdriver.ReplicaMeta;
@@ -157,7 +158,7 @@ class IndexBuildController implements ManuallyCloseable {
 for (TablePartitionId primaryReplicaId : primaryReplicaIds) {
 if (primaryReplicaId.tableId() == 
parameters.indexDescriptor().tableId()) {
 CompletableFuture startBuildIndexFuture = 
getMvTableStorageFuture(parameters.causalityToken(), primaryReplicaId)
-.thenCompose(mvTableStorage -> 
awaitPrimaryReplicaForNow(primaryReplicaId)
+.thenCompose(mvTableStorage -> 
awaitPrimaryReplica(primaryReplicaId, clock.now())
 .thenAccept(replicaMeta -> 
tryScheduleBuildIndex(
 primaryReplicaId,
 parameters.indexDescriptor(),
@@ -194,7 +195,7 @@ class IndexBuildController implements ManuallyCloseable {
 int catalogVersion = catalogService.latestCatalogVersion();
 
 return getMvTableStorageFuture(parameters.causalityToken(), 
primaryReplicaId)
-.thenCompose(mvTableStorage -> 
awaitPrimaryReplicaForNow(primaryReplicaId)
+.thenCompose(mvTableStorage -> 
awaitPrimaryReplica(primaryReplicaId, parameters.startTime())
 .thenAccept(replicaMeta -> 
tryScheduleBuildIndexesForNewPrimaryReplica(
 catalogVersion,
 primaryReplicaId,
@@ -267,15 +268,15 @@ class IndexBuildController implements ManuallyCloseable {
 return indexManager.getMvTableStorage(causalityToken, 
replicaId.tableId());
 }
 
-private CompletableFuture 
awaitPrimaryReplicaForNow(TablePartitionId replicaId) {
+private CompletableFuture 
awaitPrimaryReplica(TablePartitionId replicaId, HybridTimestamp timestamp) {
 return placementDriver
-.awaitPrimaryReplica(replicaId, clock.now(), 
AWAIT_PRIMARY_REPLICA_TIMEOUT_SEC, SECONDS)
+.awaitPrimaryReplica(replicaId, timestamp, 
AWAIT_PRIMARY_REPLICA_TIMEOUT_SEC, SECONDS)
 .handle((replicaMeta, throwable) -> {
 if (throwable != null) {
 Throwable unwrapThrowable = 
ExceptionUtils.unwrapCause(throwable);
 
 if (unwrapThrowable instanceof 
PrimaryReplicaAwaitTimeoutException) {
-return awaitPrimaryReplicaForNow(replicaId);
+return awaitPrimaryReplica(replicaId, timestamp);
 } else {
 return 
CompletableFuture.failedFuture(unwrapThrowable);
 }
diff --git 
a/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/WatchProcessor.java
 
b/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/WatchProcessor.java
index 918b00cc85..9cb803bce0 100644
--- 
a/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/WatchProcessor.java
+++ 
b/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/WatchProcesso

(ignite-3) branch main updated: IGNITE-19229 Schema validation during tx processing: validators (#2872)

2023-11-27 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 4c61ee327c IGNITE-19229 Schema validation during tx processing: 
validators (#2872)
4c61ee327c is described below

commit 4c61ee327cd38483e7f431641f4dbdf1d3e4b3ac
Author: Roman Puchkovskiy 
AuthorDate: Tue Nov 28 11:03:08 2023 +0400

IGNITE-19229 Schema validation during tx processing: validators (#2872)
---
 .../commands/AlterTableAlterColumnCommand.java |  30 +-
 .../internal/catalog/commands/CatalogUtils.java|  73 +++
 .../commands/TypeChangeValidationListener.java |  43 ++
 .../ItSchemaForwardCompatibilityTest.java  | 175 ++
 .../replicator/PartitionReplicaListener.java   |   2 +
 .../replicator/SchemaCompatibilityValidator.java   | 191 ++-
 .../schema/CatalogValidationSchemasSource.java |   1 +
 .../distributed/schema/ColumnDefinitionDiff.java   |  51 +-
 .../table/distributed/schema/FullTableSchema.java  |  21 +-
 .../distributed/schema/TableDefinitionDiff.java|  48 +-
 .../replication/PartitionReplicaListenerTest.java  |   4 +-
 .../SchemaCompatibilityValidatorTest.java  | 594 +
 .../distributed/schema/FullTableSchemaTest.java|  36 +-
 .../table/impl/DummyValidationSchemasSource.java   |   6 +-
 14 files changed, 1188 insertions(+), 87 deletions(-)

diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/AlterTableAlterColumnCommand.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/AlterTableAlterColumnCommand.java
index 1906ea3d59..6f7f3c42e1 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/AlterTableAlterColumnCommand.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/AlterTableAlterColumnCommand.java
@@ -44,6 +44,10 @@ public class AlterTableAlterColumnCommand extends 
AbstractTableCommand {
 return new Builder();
 }
 
+private static final TypeChangeValidationListener 
TYPE_CHANGE_VALIDATION_HANDLER = (pattern, originalType, newType) -> {
+throw new CatalogValidationException(format(pattern, originalType, 
newType));
+};
+
 private final String columnName;
 
 private final @Nullable ColumnType type;
@@ -145,31 +149,7 @@ public class AlterTableAlterColumnCommand extends 
AbstractTableCommand {
 }
 
 private void validateColumnChange(CatalogTableColumnDescriptor origin) {
-if (type != null && type != origin.type()) {
-if (!CatalogUtils.isSupportedColumnTypeChange(origin.type(), 
type)) {
-throw new CatalogValidationException(format("Changing the type 
from {} to {} is not allowed", origin.type(), type));
-}
-}
-
-if (precision != null && precision != origin.precision() && 
origin.type() != ColumnType.DECIMAL) {
-throw new CatalogValidationException(format("Changing the 
precision for column of type '{}' is not allowed", origin.type()));
-}
-
-if (precision != null && precision < origin.precision()) {
-throw new CatalogValidationException("Decreasing the precision is 
not allowed");
-}
-
-if (scale != null && scale != origin.scale()) {
-throw new CatalogValidationException("Changing the scale is not 
allowed");
-}
-
-if (length != null && length != origin.length() && origin.type() != 
ColumnType.STRING && origin.type() != ColumnType.BYTE_ARRAY) {
-throw new CatalogValidationException(format("Changing the length 
for column of type '{}' is not allowed", origin.type()));
-}
-
-if (length != null && length < origin.length()) {
-throw new CatalogValidationException("Decreasing the length is not 
allowed");
-}
+CatalogUtils.validateColumnChange(origin, type, precision, scale, 
length, TYPE_CHANGE_VALIDATION_HANDLER);
 
 if (nullable != null && !nullable && origin.nullable()) {
 throw new CatalogValidationException("Adding NOT NULL constraint 
is not allowed");
diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CatalogUtils.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CatalogUtils.java
index 670c8eebb9..408c16647c 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CatalogUtils.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CatalogUtils.java
@@ -211,6 +211,79 @@ public class CatalogUtils {
 return supportedTransitions != null && 
supportedTransiti

(ignite-3) branch main updated: IGNITE-20969 Decrease default data region sizes in tests (#2879)

2023-11-27 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 b168ee6297 IGNITE-20969 Decrease default data region sizes in tests 
(#2879)
b168ee6297 is described below

commit b168ee6297963f999af77abfd67bd21508441182
Author: Ivan Bessonov 
AuthorDate: Mon Nov 27 16:32:38 2023 +0300

IGNITE-20969 Decrease default data region sizes in tests (#2879)
---
 .../testframework/TestIgnitionManager.java | 110 -
 .../rebalance/ItRebalanceDistributedTest.java  |   3 +
 2 files changed, 66 insertions(+), 47 deletions(-)

diff --git 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/TestIgnitionManager.java
 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/TestIgnitionManager.java
index 91dda231aa..8d65644ab7 100644
--- 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/TestIgnitionManager.java
+++ 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/TestIgnitionManager.java
@@ -17,13 +17,19 @@
 
 package org.apache.ignite.internal.testframework;
 
+import static java.nio.file.StandardOpenOption.CREATE;
+import static java.nio.file.StandardOpenOption.SYNC;
+import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
+import static org.apache.ignite.internal.util.Constants.MiB;
+
 import com.typesafe.config.ConfigException;
 import com.typesafe.config.parser.ConfigDocument;
 import com.typesafe.config.parser.ConfigDocumentFactory;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.StandardOpenOption;
+import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Objects;
 import java.util.concurrent.CompletableFuture;
 import org.apache.ignite.Ignite;
@@ -49,6 +55,21 @@ public class TestIgnitionManager {
 /** Default partition idle SafeTime interval in ms used for tests that is 
set on node init. */
 public static final int DEFAULT_PARTITION_IDLE_SYNC_TIME_INTERVAL_MS = 100;
 
+/** Map with default node configuration values. */
+private static final Map DEFAULT_NODE_CONFIG = Map.of(
+"network.membership.scaleCube.metadataTimeout", 
Integer.toString(DEFAULT_SCALECUBE_METADATA_TIMEOUT),
+"aipersist.defaultRegion.size", Integer.toString(256 * MiB),
+"aimem.defaultRegion.initSize", Integer.toString(256 * MiB),
+"aimem.defaultRegion.maxSize", Integer.toString(256 * MiB)
+);
+
+/** Map with default cluster configuration values. */
+private static final Map DEFAULT_CLUSTER_CONFIG = Map.of(
+"schemaSync.delayDuration", 
Integer.toString(DEFAULT_DELAY_DURATION_MS),
+"metaStorage.idleSyncTimeInterval", 
Integer.toString(DEFAULT_METASTORAGE_IDLE_SYNC_TIME_INTERVAL_MS),
+"replication.idleSafeTimePropagationDuration", 
Integer.toString(DEFAULT_PARTITION_IDLE_SYNC_TIME_INTERVAL_MS)
+);
+
 /**
  * Starts an Ignite node with an optional bootstrap configuration from an 
input stream with HOCON configs.
  *
@@ -79,22 +100,11 @@ public class TestIgnitionManager {
  * @throws IgniteException If error occurs while reading node 
configuration.
  */
 public static CompletableFuture start(String nodeName, @Nullable 
String configStr, Path workDir) {
-String enrichedConfig = enrichValidConfigWithTestDefaults(configStr);
-
 try {
 Files.createDirectories(workDir);
 Path configPath = workDir.resolve(DEFAULT_CONFIG_NAME);
-if (configStr == null) {
-// Null config might mean that this is a restart, so we should 
not rewrite the existing config file.
-if (Files.notExists(configPath)) {
-Files.createFile(configPath);
-}
-} else {
-assert enrichedConfig != null;
-
-Files.writeString(configPath, enrichedConfig,
-StandardOpenOption.SYNC, StandardOpenOption.CREATE, 
StandardOpenOption.TRUNCATE_EXISTING);
-}
+
+addDefaultsToConfigurationFile(configStr, configPath);
 
 return IgnitionManager.start(nodeName, configPath, workDir);
 } catch (IOException e) {
@@ -102,25 +112,24 @@ public class TestIgnitionManager {
 }
 }
 
-private static @Nullable String 
enrichValidConfigWithTestDefaults(@Nullable String configStr) {
+/**
+ * Writes default values into the configuration file, according to the 
same rules that are used in {@link #start(String, String, Path)}.
+ */
+public static void addDefaultsToConfigurationFile(Path configPath) {
 try {
-return enrich

(ignite-3) branch main updated (8bdbb88f97 -> 6902064892)

2023-11-20 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from 8bdbb88f97 IGNITE-20685 Implement ability to trigger transaction 
recovery (#2832)
 add 6902064892 IGNITE-20818 Optimize some of MV storage GC-related parts 
of the code (#2838)

No new revisions were added by this update.

Summary of changes:
 .../configuration/ItShowConfigurationCallTest.java |   2 +-
 .../ItUpdateConfigurationCallTest.java |  10 +-
 .../internal/rest/ItGeneratedRestClientTest.java   |   2 +-
 .../apache/ignite/internal/util/IgniteUtils.java   |  24 +++
 ...entPageMemoryDataRegionConfigurationSchema.java |   9 +-
 ...ilePageMemoryDataRegionConfigurationSchema.java |  13 +-
 .../rest/ItInitializedClusterRestTest.java |   8 +-
 .../runner/app/ItIgniteNodeRestartTest.java|   4 +-
 .../configuration/GcConfigurationSchema.java   |   4 +-
 .../LowWatermarkConfigurationSchema.java   |   2 +-
 .../mv/RemoveWriteOnGcInvokeClosure.java   |  30 ++--
 .../internal/storage/pagememory/mv/gc/GcQueue.java |   2 +-
 .../PersistentPageMemoryDataRegionTest.java|   4 +-
 .../ignite/distributed/ItTablePersistenceTest.java |  11 +-
 .../ItTxDistributedCleanupRecoveryTest.java|   1 -
 .../distributed/ItTxDistributedTestSingleNode.java |   5 -
 ...xDistributedTestSingleNodeNoCleanupMessage.java |   1 -
 .../ignite/distributed/ItTxStateLocalMapTest.java  |   5 -
 .../table/distributed/StorageUpdateHandler.java|  35 +
 .../internal/table/distributed/TableManager.java   |  11 +-
 .../ignite/internal/table/distributed/gc/MvGc.java |   5 +-
 .../internal/table/distributed/IndexBaseTest.java  |  13 +-
 .../table/distributed/StorageCleanupTest.java  |  22 +--
 .../distributed/StorageUpdateHandlerTest.java  | 168 -
 .../internal/table/distributed/gc/MvGcTest.java|   7 +-
 .../raft/PartitionCommandListenerTest.java |  22 +--
 .../PartitionReplicaListenerIndexLockingTest.java  |  16 +-
 .../replication/PartitionReplicaListenerTest.java  |  15 +-
 .../apache/ignite/distributed/ItTxTestCluster.java |  12 +-
 .../table/impl/DummyInternalTableImpl.java |  14 +-
 .../ignite/internal/tx/impl/TxManagerImpl.java |  72 -
 31 files changed, 138 insertions(+), 411 deletions(-)
 delete mode 100644 
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandlerTest.java



(ignite-3) branch main updated: IGNITE-19453 Move raft command serialization before the action request creation. (#2772)

2023-11-14 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 de146ce3c2 IGNITE-19453 Move raft command serialization before the 
action request creation. (#2772)
de146ce3c2 is described below

commit de146ce3c2842ed7b6f6dea6ad9e6cc2064f4a26
Author: Ivan Bessonov 
AuthorDate: Tue Nov 14 16:35:32 2023 +0300

IGNITE-19453 Move raft command serialization before the action request 
creation. (#2772)
---
 .../impl/ItMetaStorageServicePersistenceTest.java  |   7 ++
 .../server/raft/ItMetaStorageRaftGroupTest.java|  33 +--
 .../server/raft/MetaStorageListener.java   |   4 +-
 .../server/raft/MetaStorageWriteHandler.java   |   6 +-
 .../MessageDeserializerGenerator.java  |   6 +-
 .../serialization/MessageSerializerGenerator.java  |   7 +-
 .../ignite/network/annotations/Transient.java} |  17 ++--
 modules/network/README.md  |   3 +
 .../stream/DirectByteBufferStreamImplV1.java   |   3 +-
 .../internal/placementdriver/ActiveActorTest.java  |   8 +-
 .../placementdriver/PlacementDriverManager.java|   3 +-
 .../apache/ignite/internal/raft/Marshaller.java|  53 +++
 .../apache/ignite/internal/raft/RaftManager.java   |   7 +-
 .../ignite/internal/raft/RaftServiceFactory.java   |   4 +-
 .../internal/raft/service/BeforeApplyHandler.java  |   3 +-
 .../raft/server/ItJraftCounterServerTest.java  |  32 ---
 .../ignite/raft/server/ItJraftHlcServerTest.java   |   8 +-
 .../raft/server/ItSimpleCounterServerTest.java |  15 +++-
 .../ignite/raft/server/JraftAbstractTest.java  |   5 +-
 .../java/org/apache/ignite/internal/raft/Loza.java |  34 +--
 .../ignite/internal/raft/RaftGroupServiceImpl.java |  20 -
 .../internal/raft/server/RaftGroupOptions.java |   2 +-
 .../ignite/internal/raft/server/RaftServer.java|   1 +
 .../internal/raft/server/impl/JraftServerImpl.java |  15 ++--
 .../internal/raft/util/OptimizedMarshaller.java|   2 +-
 .../raft/util/ThreadLocalOptimizedMarshaller.java  |   2 +-
 .../ignite/raft/jraft/option/NodeOptions.java  |   4 +-
 .../ignite/raft/jraft/rpc/WriteActionRequest.java  |  14 ++-
 .../jraft/rpc/impl/ActionRequestInterceptor.java   |  11 +--
 .../jraft/rpc/impl/ActionRequestProcessor.java | 100 +++--
 .../impl/InterceptingActionRequestProcessor.java   |   8 +-
 .../rpc/impl/NullActionRequestInterceptor.java |   3 +-
 .../ignite/raft/jraft/storage/io/MessageFile.java  |   7 +-
 .../snapshot/local/LocalSnapshotMetaTable.java |   6 +-
 .../ignite/raft/jraft/util/JDKMarshaller.java  |   6 +-
 .../ignite/internal/raft/RaftGroupServiceTest.java |  24 +++--
 .../raft/jraft/rpc/AppendEntriesBenchmark.java |  10 +--
 .../service/ItAbstractListenerSnapshotTest.java|  16 ++--
 .../raft/client/TopologyAwareRaftGroupService.java |   7 +-
 .../TopologyAwareRaftGroupServiceFactory.java  |   7 +-
 .../client/TopologyAwareRaftGroupServiceTest.java  |  15 +++-
 .../internal/sql/engine/ItBuildIndexTest.java  |  10 ++-
 modules/table/build.gradle |   1 +
 .../ignite/distributed/ItTablePersistenceTest.java |   7 ++
 .../raftsnapshot/ItTableRaftSnapshotsTest.java |  19 +++-
 .../internal/table/distributed/TableManager.java   |   6 +-
 .../distributed/command/CatalogVersionAware.java   |   7 ++
 .../distributed/command/PartitionCommand.java  |  12 ++-
 .../table/distributed/raft/PartitionListener.java  |   4 +-
 .../schema/CheckCatalogVersionOnActionRequest.java |  18 ++--
 .../schema/CheckCatalogVersionOnAppendEntries.java |  13 ++-
 .../schema/PartitionCommandsMarshaller.java|   9 +-
 .../schema/PartitionCommandsMarshallerImpl.java|  20 ++---
 .../table/distributed/TableManagerTest.java|  10 ++-
 .../CheckCatalogVersionOnActionRequestTest.java|  25 +++---
 .../PartitionCommandsMarshallerImplTest.java   |   2 +-
 .../apache/ignite/distributed/ItTxTestCluster.java |  13 +--
 57 files changed, 511 insertions(+), 203 deletions(-)

diff --git 
a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageServicePersistenceTest.java
 
b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageServicePersistenceTest.java
index ea6930e0fa..bd4b87a4ab 100644
--- 
a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageServicePersistenceTest.java
+++ 
b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageServicePersistenceTest.java
@@ -32,11 +32,13 @@ import 
org.apache.ignite.internal.metastorage.server.KeyValueStorage;
 import 
org.apache.ignite.internal.metastorage.server.persistence.RocksDbKeyValueStorage;
 import

(ignite-3) branch main updated: IGNITE-19240 Use HTTPS port for dynamic completers when connected to SSL enabled node (#2830)

2023-11-14 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 f1cf6bd6e3 IGNITE-19240 Use HTTPS port for dynamic completers when 
connected to SSL enabled node (#2830)
f1cf6bd6e3 is described below

commit f1cf6bd6e37b2de53f37f17d823dfbd10521352e
Author: Vadim Pakhnushev <8614891+valep...@users.noreply.github.com>
AuthorDate: Tue Nov 14 14:14:29 2023 +0300

IGNITE-19240 Use HTTPS port for dynamic completers when connected to SSL 
enabled node (#2830)
---
 ...liCommandTestNotInitializedIntegrationBase.java |  9 
 .../internal/cli/commands/ItNodeNameTest.java  | 21 ++--
 ...tConnectWithBasicAuthenticationCommandTest.java | 18 +++
 .../questions/ItConnectToBasicAuthClusterTest.java |  6 +--
 .../commands/questions/ItConnectToClusterTest.java |  3 +-
 .../ItConnectToSslAndAuthClusterTest.java  | 63 --
 .../questions/ItConnectToSslClusterTest.java   | 36 +++--
 .../cli/commands/sql/ItSqlConnectSslBasicTest.java | 10 ++--
 .../cli/commands/sql/ItSqlConnectSslTest.java  | 10 ++--
 .../internal/cli/ssl/ItSslCustomCipherTest.java| 20 +++
 .../apache/ignite/internal/cli/ssl/ItSslTest.java  | 36 ++---
 .../repl/registry/impl/NodeNameRegistryImpl.java   |  4 ++
 .../apache/ignite/internal/rest/RestComponent.java |  6 +--
 .../component/ItRestAddressReportTest.java | 27 --
 .../org/apache/ignite/internal/app/IgniteImpl.java |  6 +--
 15 files changed, 160 insertions(+), 115 deletions(-)

diff --git 
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/CliCommandTestNotInitializedIntegrationBase.java
 
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/CliCommandTestNotInitializedIntegrationBase.java
index cf350a9caf..cbf716 100644
--- 
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/CliCommandTestNotInitializedIntegrationBase.java
+++ 
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/CliCommandTestNotInitializedIntegrationBase.java
@@ -27,6 +27,7 @@ import java.io.StringWriter;
 import org.apache.ignite.internal.cli.CliIntegrationTestBase;
 import 
org.apache.ignite.internal.cli.commands.cliconfig.TestConfigManagerHelper;
 import 
org.apache.ignite.internal.cli.commands.cliconfig.TestConfigManagerProvider;
+import org.apache.ignite.internal.cli.config.CliConfigKeys;
 import org.apache.ignite.internal.cli.config.ConfigDefaultValueProvider;
 import org.apache.ignite.internal.cli.core.repl.EventListeningActivationPoint;
 import 
org.apache.ignite.internal.cli.core.repl.context.CommandLineContextProvider;
@@ -185,4 +186,12 @@ public class CliCommandTestNotInitializedIntegrationBase 
extends CliIntegrationT
 .as("Expected command error output to contain: " + 
expectedErrOutput)
 .contains(expectedErrOutput);
 }
+
+protected void setConfigProperty(CliConfigKeys key, String value) {
+configManagerProvider.configManager.setProperty(key.value(), value);
+}
+
+protected String getConfigProperty(CliConfigKeys key) {
+return configManagerProvider.get().getCurrentProperty(key.value());
+}
 }
diff --git 
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/ItNodeNameTest.java
 
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/ItNodeNameTest.java
index 30c205c500..9f28c3e84f 100644
--- 
a/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/ItNodeNameTest.java
+++ 
b/modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/ItNodeNameTest.java
@@ -17,11 +17,13 @@
 
 package org.apache.ignite.internal.cli.commands;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Awaitility.await;
 import static org.junit.jupiter.api.Assertions.assertAll;
 
-import jakarta.inject.Inject;
-import org.apache.ignite.internal.cli.core.repl.registry.NodeNameRegistry;
+import java.util.List;
+import java.util.stream.Collectors;
+import org.apache.ignite.internal.app.IgniteImpl;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.Test;
@@ -29,9 +31,6 @@ import org.junit.jupiter.api.Test;
 /** Tests for ignite node commands with a provided node name. */
 public class ItNodeNameTest extends CliCommandTestInitializedIntegrationBase {
 
-@Inject
-private NodeNameRegistry nodeNameRegistry;
-
 @Override
 protected Class getCommandClass() {
 return TopLevelCliReplCommand.class;
@@ -45,6 +44,18 @@ public class ItNodeNameTest extends 
CliCommandTestInitializedIntegrationBase {
 await().until(() -> !nodeNameRegistry.names().isEmpty());
 }
 
+

(ignite-3) branch main updated: IGNITE-20499 Broadcast user-provided initial cluster configuration with cluster state and save it to storage along with defaults (#2817)

2023-11-13 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 c86649d19a IGNITE-20499 Broadcast user-provided initial cluster 
configuration with cluster state and save it to storage along with defaults 
(#2817)
c86649d19a is described below

commit c86649d19ab677799687ce3b7c8a1617ec597afd
Author: Ivan Gagarkin 
AuthorDate: Mon Nov 13 17:30:43 2023 +0700

IGNITE-20499 Broadcast user-provided initial cluster configuration with 
cluster state and save it to storage along with defaults (#2817)
---
 .../cluster/management/ItClusterManagerTest.java   |  67 
 .../management/ClusterManagementGroupManager.java  |  73 -
 .../internal/cluster/management/ClusterState.java  |   2 +-
 .../UpdateDistributedConfigurationAction.java  |  66 
 .../ConfigurationDynamicDefaultsPatcher.java   |   2 +-
 modules/configuration/README.md|  37 +++
 .../configuration/ConfigurationChanger.java|  42 +++-
 .../configuration/ConfigurationRegistry.java   |  37 +++
 .../configuration/ConfigurationChangerTest.java|  22 
 .../org/apache/ignite/internal/app/IgniteImpl.java |  83 ---
 .../DistributedConfigurationUpdater.java   |  64 
 .../DistributedConfigurationUpdaterTest.java   | 116 -
 12 files changed, 204 insertions(+), 407 deletions(-)

diff --git 
a/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterManagerTest.java
 
b/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterManagerTest.java
index da91601235..b68bbd57f6 100644
--- 
a/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterManagerTest.java
+++ 
b/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterManagerTest.java
@@ -19,14 +19,13 @@ package org.apache.ignite.internal.cluster.management;
 
 import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.assertThrowsWithCause;
 import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.waitForCondition;
-import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureExceptionMatcher.willThrow;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.will;
+import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.hamcrest.Matchers.hasItem;
 import static org.hamcrest.Matchers.hasSize;
-import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
@@ -36,7 +35,6 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
-import java.util.concurrent.CancellationException;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -48,7 +46,6 @@ import org.apache.ignite.internal.testframework.WorkDirectory;
 import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
 import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.network.ClusterNode;
-import org.awaitility.Awaitility;
 import org.jetbrains.annotations.Nullable;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
@@ -102,6 +99,26 @@ public class ItClusterManagerTest extends 
BaseItClusterManagementTest {
 assertThat(cluster.get(1).logicalTopologyNodes(), 
will(containsInAnyOrder(expectedTopology)));
 }
 
+/**
+ * Tests initial cluster setup with provided configuration.
+ */
+@Test
+void testInitWithProvidedConfiguration(TestInfo testInfo) throws Exception 
{
+startCluster(3, testInfo);
+
+String[] cmgNodes = { cluster.get(0).name() };
+
+String[] metaStorageNodes = { cluster.get(1).name() };
+
+String configuration = "{security: {enabled: true}}";
+
+initCluster(metaStorageNodes, cmgNodes, configuration);
+
+for (MockNode node : cluster) {
+
assertThat(node.clusterManager().initialClusterConfigurationFuture(), 
willBe(configuration));
+}
+}
+
 /**
  * Tests that init fails in case some nodes cannot be found.
  */
@@ -350,48 +367,6 @@ public class ItClusterManagerTest extends 
BaseItClusterManagementTest {
 assertThat(node.clusterManager().o

(ignite-3) branch main updated (8e11db74fa -> 6e45167f49)

2023-11-12 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from 8e11db74fa IGNITE-20817 Reimplement HybridTimestamp#toString to make 
it readable by humans (#2821)
 add 6e45167f49 IGNITE-20821 Fix a reading error during the race between 
read and rename for delta-files (#2829)

No new revisions were added by this update.

Summary of changes:
 .../apache/ignite/internal/fileio/AsyncFileIo.java | 68 --
 .../ignite/internal/pagememory/tree/BplusTree.java |  3 +-
 .../store/AbstractFilePageStoreIoTest.java | 35 +++
 3 files changed, 60 insertions(+), 46 deletions(-)



(ignite-3) branch main updated: IGNITE-20817 Reimplement HybridTimestamp#toString to make it readable by humans (#2821)

2023-11-10 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 8e11db74fa IGNITE-20817 Reimplement HybridTimestamp#toString to make 
it readable by humans (#2821)
8e11db74fa is described below

commit 8e11db74fa6f10e6026194e69d858ee4735fc70f
Author: Ivan Bessonov 
AuthorDate: Fri Nov 10 16:48:08 2023 +0300

IGNITE-20817 Reimplement HybridTimestamp#toString to make it readable by 
humans (#2821)
---
 .../java/org/apache/ignite/internal/hlc/HybridTimestamp.java   |  9 +++--
 .../org/apache/ignite/internal/lang/JavaLoggerFormatter.java   | 10 ++
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/hlc/HybridTimestamp.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/hlc/HybridTimestamp.java
index 4889133ffb..1b635adc81 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/hlc/HybridTimestamp.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/hlc/HybridTimestamp.java
@@ -17,8 +17,11 @@
 
 package org.apache.ignite.internal.hlc;
 
+import static 
org.apache.ignite.internal.lang.JavaLoggerFormatter.DATE_FORMATTER;
+
 import java.io.Serializable;
-import org.apache.ignite.internal.tostring.S;
+import java.time.Instant;
+import java.time.ZoneId;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -230,7 +233,9 @@ public final class HybridTimestamp implements 
Comparable, Seria
 
 @Override
 public String toString() {
-return S.toString(HybridTimestamp.class, this, "physical", 
getPhysical(), "logical", getLogical());
+String formattedTime = 
DATE_FORMATTER.format(Instant.ofEpochMilli(getPhysical()).atZone(ZoneId.systemDefault()));
+
+return String.format("HybridTimestamp [physical=%s, logical=%d, 
composite=%d]", formattedTime, getLogical(), time);
 }
 
 /**
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/lang/JavaLoggerFormatter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/lang/JavaLoggerFormatter.java
index 727fd8801e..d04d66b036 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/lang/JavaLoggerFormatter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/lang/JavaLoggerFormatter.java
@@ -67,13 +67,7 @@ public class JavaLoggerFormatter extends Formatter {
 public static final String ANONYMOUS_LOGGER_NAME = "UNKNOWN";
 
 /** Date formatter. */
-private static final ThreadLocal DATE_FORMATTER = new 
ThreadLocal<>() {
-/** {@inheritDoc} */
-@Override
-protected DateTimeFormatter initialValue() {
-return DateTimeFormatter.ofPattern("-MM-dd HH:mm:ss:SSS Z");
-}
-};
+public static final DateTimeFormatter DATE_FORMATTER = 
DateTimeFormatter.ofPattern("-MM-dd HH:mm:ss:SSS Z");
 
 /** {@inheritDoc} */
 @Override
@@ -100,7 +94,7 @@ public class JavaLoggerFormatter extends Formatter {
 ex = "\n" + stackTrace;
 }
 
-return 
DATE_FORMATTER.get().format(Instant.ofEpochMilli(record.getMillis()).atZone(ZoneId.systemDefault()))
+return 
DATE_FORMATTER.format(Instant.ofEpochMilli(record.getMillis()).atZone(ZoneId.systemDefault()))
 + " [" + toLevel(record.getLevel().intValue()) + "]["
 + threadName + "]["
 + logName + "] "



(ignite-3) branch main updated: IGNITE-20803 Split ActionRequest into 2 interfaces (#2814)

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

ibessonov 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 9282bda9b9 IGNITE-20803 Split ActionRequest into 2 interfaces (#2814)
9282bda9b9 is described below

commit 9282bda9b982229ec714f93c3839f75a8dd329f4
Author: Ivan Bessonov 
AuthorDate: Wed Nov 8 13:15:47 2023 +0300

IGNITE-20803 Split ActionRequest into 2 interfaces (#2814)
---
 .../ignite/internal/raft/RaftGroupServiceImpl.java | 19 +
 .../apache/ignite/raft/jraft/RaftMessageGroup.java | 14 +++---
 .../ignite/raft/jraft/rpc/ActionRequest.java   | 17 +---
 .../{ActionRequest.java => ReadActionRequest.java} | 21 ++-
 ...{ActionRequest.java => WriteActionRequest.java} | 24 +
 .../jraft/rpc/impl/ActionRequestProcessor.java | 21 ++-
 .../raft/jraft/rpc/impl/IgniteRpcServer.java   | 31 +++---
 .../ignite/internal/raft/RaftGroupServiceTest.java |  3 ++-
 .../raftsnapshot/ItTableRaftSnapshotsTest.java |  6 ++---
 .../internal/sql/engine/ItBuildIndexTest.java  |  6 ++---
 .../schema/CheckCatalogVersionOnActionRequest.java |  7 -
 .../CheckCatalogVersionOnActionRequestTest.java| 16 +--
 12 files changed, 97 insertions(+), 88 deletions(-)

diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java
index 5b3eaaab35..4e36c5aa67 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java
@@ -449,11 +449,20 @@ public class RaftGroupServiceImpl implements 
RaftGroupService {
 return refreshLeader().thenCompose(res -> run(cmd));
 }
 
-Function requestFactory = targetPeer -> 
factory.actionRequest()
-.command(cmd)
-.groupId(groupId)
-.readOnlySafe(true)
-.build();
+Function requestFactory;
+
+if (cmd instanceof WriteCommand) {
+requestFactory = targetPeer -> factory.writeActionRequest()
+.groupId(groupId)
+.command((WriteCommand) cmd)
+.build();
+} else {
+requestFactory = targetPeer -> factory.readActionRequest()
+.groupId(groupId)
+.command((ReadCommand) cmd)
+.readOnlySafe(true)
+.build();
+}
 
 return this.sendWithRetry(leader, requestFactory)
 .thenApply(resp -> (R) resp.result());
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/RaftMessageGroup.java 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/RaftMessageGroup.java
index 1f407204ce..75266aba7a 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/RaftMessageGroup.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/RaftMessageGroup.java
@@ -19,10 +19,11 @@ package org.apache.ignite.raft.jraft;
 
 import org.apache.ignite.network.annotations.MessageGroup;
 import org.apache.ignite.raft.jraft.entity.RaftOutter;
-import org.apache.ignite.raft.jraft.rpc.ActionRequest;
 import org.apache.ignite.raft.jraft.rpc.ActionResponse;
 import org.apache.ignite.raft.jraft.rpc.CliRequests;
+import org.apache.ignite.raft.jraft.rpc.ReadActionRequest;
 import org.apache.ignite.raft.jraft.rpc.RpcRequests;
+import org.apache.ignite.raft.jraft.rpc.WriteActionRequest;
 
 /**
  * Message group for the Raft module.
@@ -178,13 +179,18 @@ public class RaftMessageGroup {
  */
 public static final class RpcActionMessageGroup {
 /**
- * Message type for {@link ActionRequest}.
+ * Message type for {@link ReadActionRequest}.
  */
-public static final short ACTION_REQUEST = 4000;
+public static final short READ_ACTION_REQUEST = 4000;
+
+/**
+ * Message type for {@link WriteActionRequest}.
+ */
+public static final short WRITE_ACTION_REQUEST = 4001;
 
 /**
  * Message type for {@link ActionResponse}.
  */
-public static final short ACTION_RESPONSE = 4001;
+public static final short ACTION_RESPONSE = 4002;
 }
 }
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/ActionRequest.java
 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/ActionRequest.java
index 9659be3992..1a3cc992dc 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/ActionRequest.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/ActionRequest.java
@@ -17,27 +17,12 @@
 
 package org.apache.ignite.raft

(ignite-3) branch main updated: IGNITE-20786 Disable Logit log storage by default (#2788)

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

ibessonov 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 b80a1b02ec IGNITE-20786 Disable Logit log storage by default (#2788)
b80a1b02ec is described below

commit b80a1b02ec37e3110bcf86879dbbe7e7411fd16a
Author: Ivan Bessonov 
AuthorDate: Fri Nov 3 13:53:50 2023 +0300

IGNITE-20786 Disable Logit log storage by default (#2788)
---
 .../org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
index d5aadc784d..8b2404eb59 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
@@ -101,7 +101,7 @@ import org.jetbrains.annotations.TestOnly;
  */
 public class JraftServerImpl implements RaftServer {
 /**
- * Enables logit log storage. {@code true} by default.
+ * Enables logit log storage. {@code false} by default.
  * This is a temporary property, that should only be used for testing and 
comparing the two storages.
  */
 public static final String LOGIT_STORAGE_ENABLED_PROPERTY = 
"LOGIT_STORAGE_ENABLED";
@@ -177,7 +177,7 @@ public class JraftServerImpl implements RaftServer {
 this.service = service;
 this.dataPath = dataPath;
 this.nodeManager = new NodeManager();
-this.logStorageFactory = 
IgniteSystemProperties.getBoolean(LOGIT_STORAGE_ENABLED_PROPERTY, true)
+this.logStorageFactory = 
IgniteSystemProperties.getBoolean(LOGIT_STORAGE_ENABLED_PROPERTY, false)
 ? new LogitLogStorageFactory(dataPath.resolve("log"), 
getLogOptions())
 : new DefaultLogStorageFactory(dataPath.resolve("log"));
 this.opts = opts;



(ignite-3) branch main updated: IGNITE-20777 Fix IllegalAccessException on Java 17 (#2782)

2023-11-02 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 a9ed167a50 IGNITE-20777 Fix IllegalAccessException on Java 17 (#2782)
a9ed167a50 is described below

commit a9ed167a5045ba166a6b3c84f8fb9df486579b14
Author: Ivan Bessonov 
AuthorDate: Thu Nov 2 16:54:17 2023 +0300

IGNITE-20777 Fix IllegalAccessException on Java 17 (#2782)
---
 build.gradle|  1 +
 .../org/apache/ignite/internal/util/FeatureChecker.java |  1 +
 .../internal/raft/storage/logit/LogitLogStorageFactory.java | 13 +
 packaging/common/bootstrap-functions.sh |  3 ++-
 packaging/db/build.gradle   |  1 +
 5 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 42f58c4e0a..be4b8f0ac4 100644
--- a/build.gradle
+++ b/build.gradle
@@ -70,6 +70,7 @@ allprojects {
 "--add-opens=java.base/java.util=ALL-UNNAMED",
 "--add-opens=java.base/java.time=ALL-UNNAMED",
 "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
+"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
 "--add-opens=java.base/sun.security.x509=ALL-UNNAMED",
 "-Dio.netty.tryReflectionSetAccessible=true",
 "-XX:+HeapDumpOnOutOfMemoryError"]
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/FeatureChecker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/FeatureChecker.java
index f16885cdde..1883762668 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/FeatureChecker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/FeatureChecker.java
@@ -28,6 +28,7 @@ public class FeatureChecker {
 + 
"--add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED\n"
 + 
"--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED\n"
 + 
"--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED\n"
++ "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
 + "--illegal-access=permit";
 
 /** Java version specific warning to be added in case access failed. */
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/logit/LogitLogStorageFactory.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/logit/LogitLogStorageFactory.java
index 2bcb4cf1ec..a38628d8dc 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/logit/LogitLogStorageFactory.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/logit/LogitLogStorageFactory.java
@@ -20,10 +20,12 @@ package org.apache.ignite.internal.raft.storage.logit;
 import java.nio.file.Path;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
+import org.apache.ignite.internal.lang.IgniteInternalException;
 import org.apache.ignite.internal.logger.IgniteLogger;
 import org.apache.ignite.internal.logger.Loggers;
 import org.apache.ignite.internal.raft.storage.LogStorageFactory;
 import org.apache.ignite.internal.thread.NamedThreadFactory;
+import org.apache.ignite.internal.util.FeatureChecker;
 import org.apache.ignite.raft.jraft.option.RaftOptions;
 import org.apache.ignite.raft.jraft.storage.LogStorage;
 import org.apache.ignite.raft.jraft.storage.logit.option.StoreOptions;
@@ -31,6 +33,7 @@ import 
org.apache.ignite.raft.jraft.storage.logit.storage.LogitLogStorage;
 import org.apache.ignite.raft.jraft.util.ExecutorServiceHelper;
 import org.apache.ignite.raft.jraft.util.Requires;
 import org.apache.ignite.raft.jraft.util.StringUtils;
+import sun.nio.ch.DirectBuffer;
 
 /**
  * Log storage factory for {@link LogitLogStorage} instances.
@@ -59,6 +62,16 @@ public class LogitLogStorageFactory implements 
LogStorageFactory {
 checkpointExecutor = Executors.newSingleThreadScheduledExecutor(
 new NamedThreadFactory("logit-checkpoint-executor", LOG)
 );
+
+checkVmOptions();
+}
+
+private static void checkVmOptions() {
+try {
+Class.forName(DirectBuffer.class.getName());
+} catch (Throwable e) {
+throw new IgniteInternalException("sun.nio.ch.DirectBuffer is 
unavailable." + FeatureChecker.JAVA_VER_SPECIFIC_WARN, e);
+}
 }
 
 @Override
diff --git a/packaging/common/bootstrap-functions.sh 
b/packaging/common/bootstrap-functions.sh
index cf61e629ce..2358250a20 100644
--- a/packaging/common/bootstrap-functions.sh
+++ b/packaging/common/bootstrap-functi

(ignite-3) branch main updated: IGNITE-20767 Move code related to recovering volatile RAFT groups out of TableManager (#2773)

2023-11-01 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 3321b4a317 IGNITE-20767 Move code related to recovering volatile RAFT 
groups out of TableManager (#2773)
3321b4a317 is described below

commit 3321b4a317445f841795cf51653a598cb3bc95b2
Author: Roman Puchkovskiy 
AuthorDate: Wed Nov 1 11:31:47 2023 +0400

IGNITE-20767 Move code related to recovering volatile RAFT groups out of 
TableManager (#2773)
---
 .../PartitionReplicatorNodeRecovery.java   | 208 +
 .../internal/table/distributed/TableManager.java   | 127 ++---
 2 files changed, 225 insertions(+), 110 deletions(-)

diff --git 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/PartitionReplicatorNodeRecovery.java
 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/PartitionReplicatorNodeRecovery.java
new file mode 100644
index 00..b432cdd4c4
--- /dev/null
+++ 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/PartitionReplicatorNodeRecovery.java
@@ -0,0 +1,208 @@
+/*
+ * 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.distributed;
+
+import static java.util.concurrent.CompletableFuture.allOf;
+import static java.util.concurrent.CompletableFuture.completedFuture;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Objects;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import java.util.function.IntFunction;
+import org.apache.ignite.internal.affinity.Assignment;
+import org.apache.ignite.internal.lang.IgniteInternalException;
+import org.apache.ignite.internal.metastorage.MetaStorageManager;
+import org.apache.ignite.internal.raft.Peer;
+import org.apache.ignite.internal.raft.PeersAndLearners;
+import org.apache.ignite.internal.replicator.TablePartitionId;
+import org.apache.ignite.internal.storage.MvPartitionStorage;
+import org.apache.ignite.internal.storage.RowId;
+import org.apache.ignite.internal.storage.engine.MvTableStorage;
+import org.apache.ignite.internal.table.InternalTable;
+import org.apache.ignite.internal.table.TableImpl;
+import org.apache.ignite.internal.table.distributed.message.HasDataRequest;
+import org.apache.ignite.internal.table.distributed.message.HasDataResponse;
+import org.apache.ignite.internal.utils.RebalanceUtil;
+import org.apache.ignite.network.ClusterNode;
+import org.apache.ignite.network.MessagingService;
+
+/**
+ * Code specific to recovering a partition replicator group node. This 
includes a case when we lost metadata
+ * that is required for the replication protocol (for instance, for RAFT it's 
about group metadata).
+ */
+class PartitionReplicatorNodeRecovery {
+private static final long QUERY_DATA_NODES_COUNT_TIMEOUT = 
TimeUnit.SECONDS.toMillis(3);
+
+private static final TableMessagesFactory TABLE_MESSAGES_FACTORY = new 
TableMessagesFactory();
+
+private final MetaStorageManager metaStorageManager;
+
+private final MessagingService messagingService;
+
+/** Resolver that resolves a node consistent ID to cluster node. */
+private final Function clusterNodeResolver;
+
+/** Obtains a TableImpl instance by a table ID. */
+private final IntFunction tableById;
+
+PartitionReplicatorNodeRecovery(
+MetaStorageManager metaStorageManager,
+MessagingService messagingService,
+Function clusterNodeResolver,
+IntFunction tableById) {
+this.metaStorageManager = metaStorageManager;
+this.messagingService = messagingService;
+this.clusterNodeResolver = clusterNodeResolver;
+this.tableById = tableById;
+}
+
+/**
+ * Starts the component.
+ */
+void start() {
+addMessageHandler();
+}
+
+private void addMessageHandler() {
+messagingService.addMessageHandler(TableMessageGroup.class, (message, 
sender, correlationId) -> {
+   

(ignite-3) branch main updated: IGNITE-20496 Enable Logit log storage by default (#2758)

2023-10-31 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 753dcde009 IGNITE-20496 Enable Logit log storage by default (#2758)
753dcde009 is described below

commit 753dcde0095e0061efddc15a61c0ae2dc8c80239
Author: Ivan Bessonov 
AuthorDate: Tue Oct 31 14:10:06 2023 +0300

IGNITE-20496 Enable Logit log storage by default (#2758)
---
 .../server/persistence/RocksDbKeyValueStorage.java | 19 +++---
 .../internal/raft/server/impl/JraftServerImpl.java | 17 -
 .../storage/logit/LogitLogStorageFactory.java  | 45 -
 .../jraft/storage/logit/option/StoreOptions.java   |  8 +--
 .../storage/logit/storage/LogitLogStorage.java | 35 +-
 .../jraft/storage/logit/storage/db/AbstractDB.java | 24 ---
 .../jraft/storage/logit/storage/db/ConfDB.java |  5 +-
 .../jraft/storage/logit/storage/db/IndexDB.java|  5 +-
 .../storage/logit/storage/db/SegmentLogDB.java |  5 +-
 .../logit/storage/factory/LogStoreFactory.java | 19 --
 .../storage/logit/storage/file/AbstractFile.java   | 28 
 .../storage/logit/storage/file/FileManager.java|  2 +-
 .../logit/storage/file/index/IndexFile.java|  9 ++-
 .../logit/storage/file/segment/SegmentFile.java| 15 +++--
 .../jraft/storage/impl/LogStorageBenchmark.java| 76 +++---
 .../jraft/storage/logit/LogitLogStorageTest.java   |  7 +-
 .../raft/jraft/storage/logit/db/ConfDBTest.java|  8 ++-
 .../raft/jraft/storage/logit/db/IndexDBTest.java   |  9 ++-
 .../jraft/storage/logit/db/SegmentLogDBTest.java   |  9 ++-
 .../storage/logit/file/index/IndexFileTest.java|  3 +-
 .../logit/file/segment/SegmentFileTest.java|  3 +-
 .../inmemory/ItRaftStorageVolatilityTest.java  |  3 +
 22 files changed, 232 insertions(+), 122 deletions(-)

diff --git 
a/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/persistence/RocksDbKeyValueStorage.java
 
b/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/persistence/RocksDbKeyValueStorage.java
index e08fccc7f8..b298b6c8e8 100644
--- 
a/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/persistence/RocksDbKeyValueStorage.java
+++ 
b/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/persistence/RocksDbKeyValueStorage.java
@@ -41,7 +41,9 @@ import static 
org.apache.ignite.lang.ErrorGroups.MetaStorage.RESTORING_STORAGE_E
 import static 
org.apache.ignite.lang.ErrorGroups.MetaStorage.STARTING_STORAGE_ERR;
 import static org.rocksdb.util.SizeUnit.MB;
 
+import java.io.IOException;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -246,7 +248,7 @@ public class RocksDbKeyValueStorage implements 
KeyValueStorage {
 destroyRocksDb();
 
 createDb();
-} catch (RocksDBException e) {
+} catch (IOException | RocksDBException e) {
 throw new MetaStorageException(STARTING_STORAGE_ERR, "Failed to 
start the storage", e);
 }
 }
@@ -331,16 +333,15 @@ public class RocksDbKeyValueStorage implements 
KeyValueStorage {
 }
 
 /**
- * Clear the RocksDB instance. The major difference with directly deleting 
the DB directory manually is that destroyDB() will take care
- * of the case where the RocksDB database is stored in multiple 
directories. For instance, a single DB can be configured to store its
- * data in multiple directories by specifying different paths to 
DBOptions::db_paths, DBOptions::db_log_dir, and DBOptions::wal_dir.
+ * Clear the RocksDB instance.
  *
- * @throws RocksDBException If failed.
+ * @throws IOException If failed.
  */
-protected void destroyRocksDb() throws RocksDBException {
-try (Options opt = new Options()) {
-RocksDB.destroyDB(dbPath.toString(), opt);
-}
+protected void destroyRocksDb() throws IOException {
+// For unknown reasons, RocksDB#destroyDB(String, Options) throws 
RocksDBException with ".../LOCK: No such file or directory".
+IgniteUtils.deleteIfExists(dbPath);
+
+Files.createDirectories(dbPath);
 }
 
 @Override
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
index c3f7a1934d..d5aadc784d 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/server/impl/JraftServerImpl.java
@@ -42,6 +42,7 @@ import java.util.function.BiPredicate;
 import java.util.strea

[ignite-3] branch main updated: IGNITE-20741 Fix incorrect timestamps when notifying watches on MetaStorage recovery (#2754)

2023-10-26 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 6b4971dade IGNITE-20741 Fix incorrect timestamps when notifying 
watches on MetaStorage recovery (#2754)
6b4971dade is described below

commit 6b4971dadef93ca40042899223c136af0489d37b
Author: Roman Puchkovskiy 
AuthorDate: Thu Oct 26 14:33:53 2023 +0400

IGNITE-20741 Fix incorrect timestamps when notifying watches on MetaStorage 
recovery (#2754)
---
 .../internal/catalog/CatalogManagerImpl.java   |  1 +
 .../testframework/BaseIgniteAbstractTest.java  |  2 +-
 .../metastorage/impl/ItMetaStorageWatchTest.java   | 99 +-
 .../server/persistence/RocksDbKeyValueStorage.java |  5 +-
 4 files changed, 102 insertions(+), 5 deletions(-)

diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
index 638d119ab7..87bfafb5f1 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
@@ -529,6 +529,7 @@ public class CatalogManagerImpl extends 
AbstractEventProducerhttps://issues.apache.org/jira/browse/IGNITE-20499 is fixed and DelayDuration 
is truly constant.
 Math.max(activationTimestamp, prevVersionActivationTimestamp),
 catalog.objectIdGenState(),
 catalog.zones(),
diff --git 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
index 7ab1133e35..90e68ca971 100644
--- 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
+++ 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
@@ -39,7 +39,7 @@ import org.mockito.Mockito;
  * Ignite base test class.
  */
 @ExtendWith(SystemPropertiesExtension.class)
-@WithSystemProperty(key = 
IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS_PROPERTY, value = "25")
+@WithSystemProperty(key = 
IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS_PROPERTY, value = "100")
 public abstract class BaseIgniteAbstractTest {
 /** Logger. */
 protected final IgniteLogger log = Loggers.forClass(getClass());
diff --git 
a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageWatchTest.java
 
b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageWatchTest.java
index df7017cef2..e8e501ebc3 100644
--- 
a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageWatchTest.java
+++ 
b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageWatchTest.java
@@ -18,11 +18,15 @@
 package org.apache.ignite.internal.metastorage.impl;
 
 import static java.util.concurrent.CompletableFuture.completedFuture;
+import static java.util.stream.Collectors.toList;
+import static java.util.stream.Collectors.toMap;
+import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.waitForCondition;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
 import static 
org.apache.ignite.utils.ClusterServiceTestUtils.findLocalAddresses;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.is;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
@@ -31,12 +35,16 @@ import java.nio.charset.StandardCharsets;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.function.BiConsumer;
-import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import org.apache.ignite.internal.cluster.management.ClusterInitializer;
 import 
org.apache.ignite.internal.cluster.management.ClusterManagementGroupManager;
@@ -52,9 +60,11 @@ import 
org.apache.ignite.internal.configuration.testframework.Inject

[ignite-3] branch main updated: IGNITE-20699 Decrease idle safe time propagation period in tests (#2730)

2023-10-20 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 35d03f08c0 IGNITE-20699 Decrease idle safe time propagation period in 
tests (#2730)
35d03f08c0 is described below

commit 35d03f08c0c420b24518cc7c7ed2ca67323af24a
Author: Roman Puchkovskiy 
AuthorDate: Fri Oct 20 12:06:24 2023 +0400

IGNITE-20699 Decrease idle safe time propagation period in tests (#2730)
---
 .../ignite/internal/testframework/BaseIgniteAbstractTest.java  | 2 +-
 .../apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java | 7 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
index c811c4d11d..98221daeed 100644
--- 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
+++ 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
@@ -39,7 +39,7 @@ import org.mockito.Mockito;
  * Ignite base test class.
  */
 @ExtendWith(SystemPropertiesExtension.class)
-@WithSystemProperty(key = 
IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS_PROPERTY, value = "200")
+@WithSystemProperty(key = 
IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS_PROPERTY, value = "25")
 public abstract class BaseIgniteAbstractTest {
 /** Logger. */
 protected final IgniteLogger log = Loggers.forClass(getClass());
diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
index 82f0e4e09b..06ff12f8f4 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.runner.app;
 
 import static java.util.concurrent.CompletableFuture.completedFuture;
 import static java.util.concurrent.CompletableFuture.failedFuture;
+import static 
org.apache.ignite.internal.Hacks.IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS_PROPERTY;
 import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.testNodeName;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willSucceedFast;
@@ -122,6 +123,7 @@ import 
org.apache.ignite.internal.table.distributed.raft.snapshot.outgoing.Outgo
 import 
org.apache.ignite.internal.table.distributed.schema.SchemaSyncServiceImpl;
 import org.apache.ignite.internal.table.distributed.storage.InternalTableImpl;
 import org.apache.ignite.internal.testframework.TestIgnitionManager;
+import org.apache.ignite.internal.testframework.WithSystemProperty;
 import org.apache.ignite.internal.tx.HybridTimestampTracker;
 import org.apache.ignite.internal.tx.impl.HeapLockManager;
 import org.apache.ignite.internal.tx.impl.TransactionIdGenerator;
@@ -154,6 +156,7 @@ import org.junit.jupiter.params.provider.ValueSource;
  */
 @ExtendWith(ConfigurationExtension.class)
 @Timeout(120)
+@WithSystemProperty(key = 
IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS_PROPERTY, value = "200")
 public class ItIgniteNodeRestartTest extends BaseIgniteRestartTest {
 /** Value producer for table data, is used to create data and check it 
later. */
 private static final IntFunction VALUE_PRODUCER = i -> "val " + i;
@@ -897,7 +900,7 @@ public class ItIgniteNodeRestartTest extends 
BaseIgniteRestartTest {
  * Starts two nodes and checks that the data are storing through restarts. 
Nodes restart in the same order when they started at first.
  */
 @Test
-public void testTwoNodesRestartDirect() throws InterruptedException {
+public void testTwoNodesRestartDirect() {
 twoNodesRestart(true);
 }
 
@@ -905,7 +908,7 @@ public class ItIgniteNodeRestartTest extends 
BaseIgniteRestartTest {
  * Starts two nodes and checks that the data are storing through restarts. 
Nodes restart in reverse order when they started at first.
  */
 @Test
-public void testTwoNodesRestartReverse() throws InterruptedException {
+public void testTwoNodesRestartReverse() {
 twoNodesRestart(false);
 }
 



[ignite-3] branch main updated: IGNITE-20668 Increase wait after a DDL to account for idle safe-time propagation period (#2703)

2023-10-18 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 0a59af8a10 IGNITE-20668 Increase wait after a DDL to account for idle 
safe-time propagation period (#2703)
0a59af8a10 is described below

commit 0a59af8a100e1e8e05e541c701aaf8da3ab818f2
Author: Roman Puchkovskiy 
AuthorDate: Wed Oct 18 13:17:24 2023 +0400

IGNITE-20668 Increase wait after a DDL to account for idle safe-time 
propagation period (#2703)
---
 .../internal/catalog/CatalogManagerImpl.java   | 24 --
 .../internal/catalog/CatalogManagerSelfTest.java   |  4 +-
 .../java/org/apache/ignite/internal/Hacks.java | 27 +++
 .../testframework/BaseIgniteAbstractTest.java  |  2 +
 .../ignite/internal/replicator/ReplicaManager.java | 56 +-
 .../apache/ignite/internal/jdbc/ItJdbcTest.java|  2 +-
 .../internal/readonly/ItReadOnlyTxInPastTest.java  | 86 ++
 .../rebalance/ItRebalanceDistributedTest.java  | 11 ++-
 .../rebalance/ItRebalanceRecoveryTest.java |  3 +
 .../runner/app/ItIgniteNodeRestartTest.java| 11 ++-
 .../ignite/internal/sql/api/ItSqlApiBaseTest.java  |  9 ++-
 .../org/apache/ignite/internal/app/IgniteImpl.java | 16 +++-
 .../java/org/apache/ignite/internal/Cluster.java   | 10 +++
 .../LowWatermarkConfigurationSchema.java   |  4 +-
 .../ignite/internal/tx/impl/TxManagerImpl.java | 49 ++--
 .../apache/ignite/internal/tx/TxManagerTest.java   | 21 +++---
 16 files changed, 291 insertions(+), 44 deletions(-)

diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
index aab4f0f777..9a6ead5252 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
@@ -90,6 +90,8 @@ public class CatalogManagerImpl extends 
AbstractEventProducer delayDurationMs);
+CatalogManagerImpl(UpdateLog updateLog, ClockWaiter clockWaiter, long 
delayDurationMs, long partitionIdleSafeTimePropagationPeriod) {
+this(updateLog, clockWaiter, () -> delayDurationMs, () -> 
partitionIdleSafeTimePropagationPeriod);
 }
 
 /**
  * Constructor.
  */
-public CatalogManagerImpl(UpdateLog updateLog, ClockWaiter clockWaiter, 
LongSupplier delayDurationMsSupplier) {
+public CatalogManagerImpl(
+UpdateLog updateLog,
+ClockWaiter clockWaiter,
+LongSupplier delayDurationMsSupplier,
+LongSupplier partitionIdleSafeTimePropagationPeriodMsSupplier
+) {
 this.updateLog = updateLog;
 this.clockWaiter = clockWaiter;
 this.delayDurationMsSupplier = delayDurationMsSupplier;
+this.partitionIdleSafeTimePropagationPeriodMsSupplier = 
partitionIdleSafeTimePropagationPeriodMsSupplier;
 }
 
 @Override
@@ -415,8 +425,12 @@ public class CatalogManagerImpl extends 
AbstractEventProducerhttp://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;
+
+/**
+ * Contains hacks needed for the whole codebase. Should be removed as quickly 
as possible.
+ */
+public class Hacks {
+// TODO: Remove after IGNITE-20499 is fixed.
+/** Name of the property overriding idle safe time propagation period (in 
milliseconds). */
+public static final String 
IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS_PROPERTY = 
"IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS";
+}
diff --git 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
index 8d3338cc9a..c811c4d11d 100644
--- 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
+++ 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/BaseIgniteAbstractTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.testframework;
 
+import static 
org.apache.ignite.internal.Hacks.IDLE_SAFE_TIME_PROPAGATION_PERIOD_MILLISECONDS_PROPERTY;
 import static 
org.apache.ignite.internal.lang.IgniteSystemProperties.IGNITE_SENSITIVE_DATA_LOGGING;
 import static org.apache.ignite.internal.lang.IgniteSystemProperties.getString;
 import static org.apache.ignite.internal.util.IgniteU

[ignite-3] branch main updated: IGNITE-20519 Introduce update token for CatalogObjectDescriptor (#2656)

2023-10-05 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 564c4ada56 IGNITE-20519 Introduce update token for 
CatalogObjectDescriptor (#2656)
564c4ada56 is described below

commit 564c4ada56bef2c6749e6113b3ed85d278d94c2d
Author: Mirza Aliev 
AuthorDate: Thu Oct 5 15:37:33 2023 +0400

IGNITE-20519 Introduce update token for CatalogObjectDescriptor (#2656)
---
 .../internal/catalog/CatalogManagerImpl.java   |  18 +-
 .../catalog/commands/CreateTableCommand.java   |   4 +-
 .../descriptors/CatalogIndexDescriptor.java|   4 +-
 .../descriptors/CatalogObjectDescriptor.java   |  34 +-
 .../descriptors/CatalogSchemaDescriptor.java   |   5 +-
 .../descriptors/CatalogSystemViewDescriptor.java   |   4 +-
 .../descriptors/CatalogTableDescriptor.java|   5 +-
 .../catalog/descriptors/CatalogZoneDescriptor.java |   4 +-
 .../internal/catalog/storage/AlterColumnEntry.java |   8 +-
 .../internal/catalog/storage/AlterZoneEntry.java   |   4 +-
 .../internal/catalog/storage/DropColumnsEntry.java |   8 +-
 .../internal/catalog/storage/DropIndexEntry.java   |   5 +-
 .../internal/catalog/storage/DropTableEntry.java   |   5 +-
 .../internal/catalog/storage/DropZoneEntry.java|   2 +-
 .../internal/catalog/storage/NewColumnsEntry.java  |   8 +-
 .../internal/catalog/storage/NewIndexEntry.java|   7 +-
 .../catalog/storage/NewSystemViewEntry.java|   7 +-
 .../internal/catalog/storage/NewTableEntry.java|   7 +-
 .../internal/catalog/storage/NewZoneEntry.java |   4 +-
 .../catalog/storage/ObjectIdGenUpdateEntry.java|   2 +-
 .../internal/catalog/storage/UpdateEntry.java  |   3 +-
 ...CatalogManagerDescriptorCausalityTokenTest.java | 444 +
 .../internal/catalog/CatalogManagerSelfTest.java   |  17 -
 .../internal/catalog/CatalogSystemViewTest.java|  34 ++
 .../commands/AbstractCommandValidationTest.java|   6 +-
 .../catalog/storage/UpdateLogImplTest.java |  31 +-
 .../internal/catalog/BaseCatalogManagerTest.java   |  23 ++
 .../RebalanceUtilUpdateAssignmentsTest.java|   4 +-
 .../internal/schema/CatalogSchemaManagerTest.java  |   9 +-
 .../CatalogToSchemaDescriptorConverterTest.java|   4 +-
 .../engine/schema/CatalogSqlSchemaManagerTest.java |  13 +-
 .../storage/AbstractMvTableStorageTest.java|   4 +-
 .../storage/index/AbstractIndexStorageTest.java|   4 +-
 .../replication/PartitionReplicaListenerTest.java  |   4 +-
 34 files changed, 677 insertions(+), 68 deletions(-)

diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
index 1600b76787..faf1316d9b 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogManagerImpl.java
@@ -42,6 +42,7 @@ import 
org.apache.ignite.internal.catalog.commands.CreateZoneParams;
 import org.apache.ignite.internal.catalog.commands.DropZoneParams;
 import org.apache.ignite.internal.catalog.commands.RenameZoneParams;
 import org.apache.ignite.internal.catalog.descriptors.CatalogIndexDescriptor;
+import org.apache.ignite.internal.catalog.descriptors.CatalogObjectDescriptor;
 import org.apache.ignite.internal.catalog.descriptors.CatalogSchemaDescriptor;
 import 
org.apache.ignite.internal.catalog.descriptors.CatalogSystemViewDescriptor;
 import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor;
@@ -79,6 +80,13 @@ public class CatalogManagerImpl extends 
AbstractEventProducer entries = producer.get(catalog);
 
 for (UpdateEntry entry : entries) {
-catalog = entry.applyUpdate(catalog);
+catalog = entry.applyUpdate(catalog, 
INITIAL_CAUSALITY_TOKEN);
 }
 
 bulkUpdateEntries.addAll(entries);
diff --git 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java
 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java
index bc78766dd2..3ef142c6b4 100644
--- 
a/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java
+++ 
b/modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.catalog.commands;
 
 import static java.util.Objects.requireNonNullElse;
 import static java.util.stream.Collectors.toList;
+import static 
org.apache.ignite.internal.catalog.CatalogManagerImpl.INITIAL_CAUSALITY_TOKEN;
 import static

[ignite-3] branch main updated: IGNITE-20358 Make data storage engine configuration local (#2571)

2023-10-04 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 5799a7a1e5 IGNITE-20358 Make data storage engine configuration local 
(#2571)
5799a7a1e5 is described below

commit 5799a7a1e5d8ae1da16e1554ad0e56d644ec9c8a
Author: Kirill Gusakov 
AuthorDate: Wed Oct 4 10:14:59 2023 +0300

IGNITE-20358 Make data storage engine configuration local (#2571)
---
 .../ignite/example/AbstractExamplesTest.java   | 23 ++-
 .../storage/ItPageMemoryStorageExampleTest.java|  4 +--
 .../storage/ItRocksdbStorageExampleTest.java   |  2 +-
 .../configuration/ItShowConfigurationCallTest.java |  4 +--
 .../ItUpdateConfigurationCallTest.java | 14 -
 .../repl/executor/ItIgnitePicocliCommandsTest.java |  4 ++-
 .../internal/rest/ItGeneratedRestClientTest.java   |  4 +--
 ...ava => PageMemoryLocalConfigurationModule.java} |  4 +--
 .../rebalance/ItRebalanceDistributedTest.java  | 34 +-
 .../rest/ItInitializedClusterRestTest.java | 12 
 .../runner/app/ItIgniteNodeRestartTest.java|  9 +++---
 .../org/apache/ignite/internal/app/IgniteImpl.java |  4 +--
 ...va => TestStorageLocalConfigurationModule.java} |  4 +--
 ...moryStorageEngineLocalConfigurationModule.java} |  7 ++---
 ...PageMemoryStorageEngineConfigurationSchema.java |  4 +--
 ...PageMemoryStorageEngineConfigurationSchema.java |  4 +--
 ...ksDbStorageEngineLocalConfigurationModule.java} |  4 +--
 .../RocksDbStorageEngineConfigurationSchema.java   |  4 +--
 18 files changed, 79 insertions(+), 66 deletions(-)

diff --git 
a/examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java
 
b/examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java
index 1d0aa9a302..f7c4485826 100644
--- 
a/examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java
+++ 
b/examples/src/integrationTest/java/org/apache/ignite/example/AbstractExamplesTest.java
@@ -20,6 +20,8 @@ package org.apache.ignite.example;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
 import static org.hamcrest.MatcherAssert.assertThat;
 
+import java.io.IOException;
+import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
@@ -28,12 +30,15 @@ import org.apache.ignite.IgnitionManager;
 import org.apache.ignite.InitParameters;
 import org.apache.ignite.internal.app.IgniteImpl;
 import org.apache.ignite.internal.testframework.IgniteAbstractTest;
+import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.extension.ExtendWith;
 
 /**
  * Base class for creating tests for examples.
  */
+@ExtendWith(WorkDirectoryExtension.class)
 public abstract class AbstractExamplesTest extends IgniteAbstractTest {
 private static final String TEST_NODE_NAME = "ignite-node";
 
@@ -50,7 +55,7 @@ public abstract class AbstractExamplesTest extends 
IgniteAbstractTest {
 public void startNode() throws Exception {
 CompletableFuture igniteFuture = IgnitionManager.start(
 TEST_NODE_NAME,
-Path.of("config", "ignite-config.conf"),
+configFile(),
 workDir
 );
 
@@ -75,4 +80,20 @@ public abstract class AbstractExamplesTest extends 
IgniteAbstractTest {
 public void stopNode() {
 IgnitionManager.stop(TEST_NODE_NAME);
 }
+
+/**
+ * Copy the original node configuration file to the temporary directory.
+ * It needs for the safety reasons: some tests can mutate local 
configurations (for example storage tests)
+ * and mutate this file as a result. So, further tests will run with 
inappropriate configuration.
+ *
+ * @return The path of the copied configuration file.
+ * @throws IOException If an I/O error occurs during the file copying 
process.
+ */
+private Path configFile() throws IOException {
+var configFileName = "ignite-config.conf";
+
+return Files.copy(
+Path.of("config", configFileName),
+workDir.resolve(configFileName));
+}
 }
diff --git 
a/examples/src/integrationTest/java/org/apache/ignite/example/storage/ItPageMemoryStorageExampleTest.java
 
b/examples/src/integrationTest/java/org/apache/ignite/example/storage/ItPageMemoryStorageExampleTest.java
index 8a51270f65..d97612689d 100644
--- 
a/examples/src/integrationTest/java/org/apache/ignite/example/storage/ItPageMemoryStorageExampleTest.java
+++ 
b/examples/src/integrationTest/java/org/apache/ignite/example/storage/ItPageMemory

[ignite-3] branch main updated: IGNITE-20518 Use CatalogService in JdbcMetadataCatalog (#2643)

2023-10-02 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 211732556c IGNITE-20518 Use CatalogService in JdbcMetadataCatalog 
(#2643)
211732556c is described below

commit 211732556c90e63749280ec5e93d92205b9fa169
Author: Roman Puchkovskiy 
AuthorDate: Mon Oct 2 11:29:45 2023 +0400

IGNITE-20518 Use CatalogService in JdbcMetadataCatalog (#2643)
---
 modules/client-handler/build.gradle|   3 +
 .../apache/ignite/client/handler/TestServer.java   |   6 +-
 .../ignite/client/handler/ClientHandlerModule.java |  20 +++-
 .../handler/ClientInboundMessageHandler.java   |  16 ++-
 .../handler/requests/jdbc/JdbcMetadataCatalog.java | 119 -
 modules/client/build.gradle|   2 +
 .../ignite/client/TestClientHandlerModule.java |   8 +-
 .../java/org/apache/ignite/client/TestServer.java  |   8 +-
 .../org/apache/ignite/internal/app/IgniteImpl.java |   6 +-
 .../internal/schema/CatalogSchemaManager.java  |   2 +-
 .../table/distributed/TableManagerTest.java|   4 +-
 .../PartitionReplicaListenerIndexLockingTest.java  |   4 +-
 .../replication/PartitionReplicaListenerTest.java  |   5 +-
 .../apache/ignite/distributed/ItTxTestCluster.java |   3 +-
 .../schema/AlwaysSyncedSchemaSyncService.java  |  34 ++
 .../table/impl/DummyInternalTableImpl.java |   4 +-
 16 files changed, 172 insertions(+), 72 deletions(-)

diff --git a/modules/client-handler/build.gradle 
b/modules/client-handler/build.gradle
index 46ebd57241..5fcbe609dd 100644
--- a/modules/client-handler/build.gradle
+++ b/modules/client-handler/build.gradle
@@ -36,6 +36,7 @@ dependencies {
 implementation project(':ignite-security')
 implementation project(':ignite-metrics')
 implementation project(':ignite-transactions')
+implementation project(':ignite-catalog')
 implementation libs.jetbrains.annotations
 implementation libs.fastutil.core
 implementation libs.netty.common
@@ -60,8 +61,10 @@ dependencies {
 integrationTestImplementation project(':ignite-metrics')
 integrationTestImplementation project(':ignite-security')
 integrationTestImplementation project(':ignite-transactions')
+integrationTestImplementation project(':ignite-catalog')
 
integrationTestImplementation(testFixtures(project(':ignite-configuration')))
 integrationTestImplementation(testFixtures(project(':ignite-core')))
+integrationTestImplementation(testFixtures(project(':ignite-table')))
 integrationTestImplementation libs.msgpack.core
 integrationTestImplementation libs.netty.handler
 integrationTestImplementation libs.jetbrains.annotations
diff --git 
a/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/TestServer.java
 
b/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/TestServer.java
index a1a857b1f6..55772b2391 100644
--- 
a/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/TestServer.java
+++ 
b/modules/client-handler/src/integrationTest/java/org/apache/ignite/client/handler/TestServer.java
@@ -26,6 +26,7 @@ import java.util.UUID;
 import java.util.concurrent.CompletableFuture;
 import 
org.apache.ignite.client.handler.configuration.ClientConnectorConfiguration;
 import org.apache.ignite.compute.IgniteCompute;
+import org.apache.ignite.internal.catalog.CatalogService;
 import org.apache.ignite.internal.configuration.AuthenticationConfiguration;
 import org.apache.ignite.internal.configuration.ConfigurationManager;
 import org.apache.ignite.internal.configuration.ConfigurationTreeGenerator;
@@ -38,6 +39,7 @@ import 
org.apache.ignite.internal.security.authentication.AuthenticationManager;
 import 
org.apache.ignite.internal.security.authentication.AuthenticationManagerImpl;
 import org.apache.ignite.internal.sql.engine.QueryProcessor;
 import org.apache.ignite.internal.table.IgniteTablesInternal;
+import 
org.apache.ignite.internal.table.distributed.schema.AlwaysSyncedSchemaSyncService;
 import org.apache.ignite.internal.tx.impl.IgniteTransactionsImpl;
 import org.apache.ignite.network.ClusterService;
 import org.apache.ignite.network.NettyBootstrapFactory;
@@ -130,7 +132,9 @@ public class TestServer {
 metrics,
 authenticationManager(),
 authenticationConfiguration,
-new HybridClockImpl()
+new HybridClockImpl(),
+new AlwaysSyncedSchemaSyncService(),
+mock(CatalogService.class)
 );
 
 module.start();
diff --git 
a/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientHandlerModule.java
 
b/modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientHandlerModule.java
index 0a3ded7715

[ignite-3] branch main updated: IGNITE-20497 Fix logger formatter (#2633)

2023-09-27 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 3ffa60cf7e IGNITE-20497 Fix logger formatter (#2633)
3ffa60cf7e is described below

commit 3ffa60cf7e04b75d652f3beecf8168282d3595ec
Author: Ivan Bessonov 
AuthorDate: Wed Sep 27 10:22:35 2023 +0300

IGNITE-20497 Fix logger formatter (#2633)
---
 examples/config/java.util.logging.properties | 2 +-
 packaging/db/ignite.java.util.logging.properties | 2 +-
 packaging/docker/ignite.java.util.logging.properties | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/config/java.util.logging.properties 
b/examples/config/java.util.logging.properties
index 357c56b020..63edfffee1 100644
--- a/examples/config/java.util.logging.properties
+++ b/examples/config/java.util.logging.properties
@@ -19,5 +19,5 @@
 
 handlers=java.util.logging.FileHandler
 
-java.util.logging.FileHandler.formatter=org.apache.ignite.lang.JavaLoggerFormatter
+java.util.logging.FileHandler.formatter=org.apache.ignite.internal.lang.JavaLoggerFormatter
 java.util.logging.FileHandler.pattern=example-node.log
diff --git a/packaging/db/ignite.java.util.logging.properties 
b/packaging/db/ignite.java.util.logging.properties
index 86b99f6d92..61ca740987 100644
--- a/packaging/db/ignite.java.util.logging.properties
+++ b/packaging/db/ignite.java.util.logging.properties
@@ -40,7 +40,7 @@ handlers=java.util.logging.FileHandler
 # Console handler logs all messages with importance level `SEVERE` and above
 # into standard error stream (`System.err`).
 #
-java.util.logging.FileHandler.formatter = 
org.apache.ignite.lang.JavaLoggerFormatter
+java.util.logging.FileHandler.formatter = 
org.apache.ignite.internal.lang.JavaLoggerFormatter
 java.util.logging.FileHandler.pattern = @APP_LOG_DIR@/ignite3db-%g.log
 java.util.logging.FileHandler.level = INFO
 java.util.logging.FileHandler.append = true
diff --git a/packaging/docker/ignite.java.util.logging.properties 
b/packaging/docker/ignite.java.util.logging.properties
index 312b25682e..a47daceeff 100644
--- a/packaging/docker/ignite.java.util.logging.properties
+++ b/packaging/docker/ignite.java.util.logging.properties
@@ -40,6 +40,6 @@ handlers=java.util.logging.ConsoleHandler
 # Console handler logs all messages with importance level `INFO` and above
 # into standard error stream (`System.err`).
 #
-java.util.logging.ConsoleHandler.formatter = 
org.apache.ignite.lang.JavaLoggerFormatter
+java.util.logging.ConsoleHandler.formatter = 
org.apache.ignite.internal.lang.JavaLoggerFormatter
 java.util.logging.ConsoleHandler.level = INFO
 java.util.logging.ConsoleHandler.encoding = UTF-8



[ignite-3] branch main updated (aebca24f0a -> 196bbdace6)

2023-09-27 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from aebca24f0a IGNITE-20468 .NET: Fix test timeouts (#2626)
 add 196bbdace6 IGNITE-20410 Fix CheckCatalogVersionOnActionRequest 
handling that breaks RAFT client leaderId refresh protocol (#2628)

No new revisions were added by this update.

Summary of changes:
 .../apache/ignite/raft/jraft/core/NodeImpl.java| 28 +++---
 .../raftsnapshot/ItTableRaftSnapshotsTest.java |  1 -
 .../schemasync/ItSchemaSyncAndReplicationTest.java |  4 +-
 .../schema/CheckCatalogVersionOnActionRequest.java | 51 +-
 .../schema/CheckCatalogVersionOnAppendEntries.java |  4 +-
 .../CheckCatalogVersionOnActionRequestTest.java| 61 +-
 6 files changed, 132 insertions(+), 17 deletions(-)



[ignite-3] branch main updated: IGNITE-20419 Fix partition meta loss after idle cluster restart. (#2594)

2023-09-18 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 ba9c1f88d1 IGNITE-20419 Fix partition meta loss after idle cluster 
restart. (#2594)
ba9c1f88d1 is described below

commit ba9c1f88d13a79d069e1ab6798b8932e8367a01d
Author: Ivan Bessonov 
AuthorDate: Mon Sep 18 13:10:08 2023 +0300

IGNITE-20419 Fix partition meta loss after idle cluster restart. (#2594)
---
 .../persistence/PersistentPageMemory.java  |   1 +
 .../persistence/checkpoint/CheckpointManager.java  |   7 ++
 .../checkpoint/CheckpointPagesWriter.java  |   5 +
 .../persistence/checkpoint/CheckpointWorkflow.java |  45 
 .../persistence/checkpoint/Checkpointer.java   |   8 ++
 .../internal/pagememory/util/PageIdUtils.java  |   6 +-
 .../checkpoint/CheckpointWorkflowTest.java |  90 +++-
 .../internal/storage/engine/StorageEngine.java |   5 +
 .../storage/AbstractMvTableStorageTest.java|  19 ++--
 .../storage/engine/AbstractStorageEngineTest.java  | 119 +
 .../internal/storage/impl/TestStorageEngine.java   |   5 +
 .../PersistentPageMemoryStorageEngine.java |   5 +
 .../VolatilePageMemoryStorageEngine.java   |   5 +
 .../mv/PersistentPageMemoryMvPartitionStorage.java |  58 ++
 .../PersistentPageMemoryStorageEngineTest.java |  58 ++
 .../storage/rocksdb/RocksDbStorageEngine.java  |   5 +
 .../rocksdb/engine/RocksDbStorageEngineTest.java   |  51 +
 17 files changed, 456 insertions(+), 36 deletions(-)

diff --git 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
index 4f11ab1454..e160645826 100644
--- 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
+++ 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
@@ -1230,6 +1230,7 @@ public class PersistentPageMemory implements PageMemory {
 
 if (dirty) {
 assert checkpointTimeoutLock.checkpointLockIsHeldByThread();
+assert pageIndex(pageId.pageId()) != 0 : "Partition meta should 
only be updated via the instance of PartitionMeta.";
 
 if (!wasDirty || forceAdd) {
 Segment seg = segment(pageId.groupId(), pageId.pageId());
diff --git 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointManager.java
 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointManager.java
index f2dac1a081..74bfbad288 100644
--- 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointManager.java
+++ 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointManager.java
@@ -236,6 +236,13 @@ public class CheckpointManager {
 return checkpointer.lastCheckpointProgress();
 }
 
+/**
+ * Marks partition as dirty, forcing partition's meta-page to be written 
on disk during next checkpoint.
+ */
+public void markPartitionAsDirty(DataRegion dataRegion, int groupId, 
int partitionId) {
+checkpointer.markPartitionAsDirty(dataRegion, groupId, partitionId);
+}
+
 /**
  * Returns {@link true} if it is safe for all {@link DataRegion data 
regions} to update their {@link PageMemory}.
  *
diff --git 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointPagesWriter.java
 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointPagesWriter.java
index f133eb4aa0..093cdba516 100644
--- 
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointPagesWriter.java
+++ 
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointPagesWriter.java
@@ -229,6 +229,11 @@ public class CheckpointPagesWriter implements Runnable {
 pm -> createPageStoreWriter(pm, pageIdsToRetry)
 );
 
+if (fullId.pageIdx() == 0) {
+// Skip meta-pages, they are written by 
"writePartitionMeta".
+continue;
+}
+
 // Should also be done for partitions that will be destroyed 
to remove their pages from the data region.
 pageMemory.checkpointWritePage(fullId, tmpWriteBuf, 
pageStoreWriter, tracker);
 }
diff --git 
a/modules/page-memory/src/main/java/org/apache/ignite/internal

[ignite-3] branch main updated: IGNITE-20398 Filter null values for any cfg (#2580)

2023-09-13 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 cf946e9f94 IGNITE-20398 Filter null values for any cfg (#2580)
cf946e9f94 is described below

commit cf946e9f9475be1aba308a9a6b7b2c36a489b48d
Author: Mikhail 
AuthorDate: Wed Sep 13 15:35:59 2023 +0300

IGNITE-20398 Filter null values for any cfg (#2580)
---
 .../processor/ConfigurationProcessor.java  |   3 +-
 .../configuration/ConfigurationTreeGenerator.java  |  10 +-
 .../ConfigurationNotificationUtils.java|  42 -
 .../notifications/ConfigurationNotifier.java   |  44 ++---
 .../configuration/util/ConfigurationUtil.java  | 138 +++-
 .../configuration/util/ConfigurationUtilTest.java  | 106 
 .../ignite/internal/util/CollectionUtils.java  | 184 +++--
 .../ignite/internal/util/CollectionUtilsTest.java  |  88 +-
 .../persistence/compaction/Compactor.java  |   2 +-
 .../persistence/store/FilePageStoreManager.java|   5 +-
 .../persistence/store/GroupPageStoresMap.java  |   7 +-
 .../store/FilePageStoreManagerTest.java|   8 +-
 .../persistence/store/GroupPageStoresMapTest.java  |   9 +-
 13 files changed, 338 insertions(+), 308 deletions(-)

diff --git 
a/modules/configuration-annotation-processor/src/main/java/org/apache/ignite/internal/configuration/processor/ConfigurationProcessor.java
 
b/modules/configuration-annotation-processor/src/main/java/org/apache/ignite/internal/configuration/processor/ConfigurationProcessor.java
index bc86798d14..e399bcaad4 100644
--- 
a/modules/configuration-annotation-processor/src/main/java/org/apache/ignite/internal/configuration/processor/ConfigurationProcessor.java
+++ 
b/modules/configuration-annotation-processor/src/main/java/org/apache/ignite/internal/configuration/processor/ConfigurationProcessor.java
@@ -33,7 +33,6 @@ import static 
org.apache.ignite.internal.configuration.processor.ConfigurationPr
 import static org.apache.ignite.internal.util.ArrayUtils.nullOrEmpty;
 import static org.apache.ignite.internal.util.CollectionUtils.concat;
 import static org.apache.ignite.internal.util.CollectionUtils.difference;
-import static org.apache.ignite.internal.util.CollectionUtils.viewReadOnly;
 
 import com.google.auto.service.AutoService;
 import com.squareup.javapoet.ClassName;
@@ -760,7 +759,7 @@ public class ConfigurationProcessor extends 
AbstractProcessor {
 /** {@inheritDoc} */
 @Override
 public Set getSupportedAnnotationTypes() {
-return Set.copyOf(viewReadOnly(supportedAnnotationTypes(), 
Class::getCanonicalName));
+return 
supportedAnnotationTypes().stream().map(Class::getCanonicalName).collect(toSet());
 }
 
 /** {@inheritDoc} */
diff --git 
a/modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationTreeGenerator.java
 
b/modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationTreeGenerator.java
index 74784db651..b8447ff8e6 100644
--- 
a/modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationTreeGenerator.java
+++ 
b/modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationTreeGenerator.java
@@ -24,12 +24,12 @@ import static java.util.stream.Collectors.toList;
 import static java.util.stream.Collectors.toMap;
 import static 
org.apache.ignite.internal.configuration.util.ConfigurationUtil.collectSchemas;
 import static 
org.apache.ignite.internal.configuration.util.ConfigurationUtil.isPolymorphicId;
+import static 
org.apache.ignite.internal.configuration.util.ConfigurationUtil.mapIterable;
 import static 
org.apache.ignite.internal.configuration.util.ConfigurationUtil.polymorphicInstanceId;
 import static 
org.apache.ignite.internal.configuration.util.ConfigurationUtil.polymorphicSchemaExtensions;
 import static 
org.apache.ignite.internal.configuration.util.ConfigurationUtil.schemaExtensions;
 import static 
org.apache.ignite.internal.configuration.util.ConfigurationUtil.schemaFields;
 import static org.apache.ignite.internal.util.CollectionUtils.difference;
-import static org.apache.ignite.internal.util.CollectionUtils.viewReadOnly;
 
 import java.lang.reflect.Field;
 import java.util.Collection;
@@ -161,12 +161,14 @@ public class ConfigurationTreeGenerator implements 
ManuallyCloseable {
  * @param polymorphicSchemaExtensions polymorphic schema extensions
  * @return set of all schema classes
  */
-private static Set> collectAllSchemas(Collection> 
rootKeys,
+private static Set> collectAllSchemas(
+Collection> rootKeys,
 Collection> internalSchemaExtensions,
-Collection> polymorphicSchemaExtensions) {
+Collection> polymorphicSchemaExtensions

[ignite-3] branch main updated: IGNITE-20044 Validate schema eligibility on each read/write operation in an RW transaction (#2566)

2023-09-13 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 0d1ae2d1d6 IGNITE-20044 Validate schema eligibility on each read/write 
operation in an RW transaction (#2566)
0d1ae2d1d6 is described below

commit 0d1ae2d1d67724f43abfaa8af4a2f85b9e328656
Author: Roman Puchkovskiy 
AuthorDate: Wed Sep 13 10:56:27 2023 +0400

IGNITE-20044 Validate schema eligibility on each read/write operation in an 
RW transaction (#2566)
---
 .../Table/SchemaSynchronizationTest.cs |   1 +
 .../org/apache/ignite/internal/SessionUtils.java   |   2 +-
 .../inmemory/ItRaftStorageVolatilityTest.java  |  55 +---
 .../runner/app/PlatformTestNodeRunner.java | 216 ++-
 .../ignite/internal/runner/app/TableTestUtils.java |  62 +
 .../schemasync/ItSchemaSyncSingleNodeTest.java | 215 +++
 .../ignite/internal/sql/api/ItCommonApiTest.java   |  40 +--
 .../ignite/internal/table/ItRoReadsTest.java   |  50 ++--
 .../org/apache/ignite/internal/app/IgniteImpl.java |  10 +
 .../table/distributed/TableIdRegistry.java |  48 
 .../RequestType.java => TableIdTranslator.java}|  52 +---
 .../internal/table/distributed/TableManager.java   |  33 +++
 .../distributed/replicator/CatalogTables.java  |  42 +++
 .../replicator/CatalogTablesWithIdConversion.java  |  47 
 .../RequestType.java => DirectCatalogTables.java}  |  54 ++--
 .../replicator/PartitionReplicaListener.java   | 298 +++--
 .../replicator/SchemaCompatValidator.java  |  24 +-
 .../distributed/replicator/action/RequestType.java |  40 ++-
 .../PartitionReplicaListenerIndexLockingTest.java  |   8 +
 .../replication/PartitionReplicaListenerTest.java  | 289 
 .../replicator/action/RequestTypeTest.java |  60 +
 .../apache/ignite/distributed/ItTxTestCluster.java |  10 +
 .../replicator/action/RequestTypes.java|  78 +-
 .../table/impl/DummyInternalTableImpl.java |  11 +
 24 files changed, 1425 insertions(+), 320 deletions(-)

diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaSynchronizationTest.cs
 
b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaSynchronizationTest.cs
index 99f13d0e64..ea7cf08de8 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaSynchronizationTest.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaSynchronizationTest.cs
@@ -337,6 +337,7 @@ public class SchemaSynchronizationTest : IgniteTestsBase
 }
 
 [Test]
+[Ignore("https://issues.apache.org/jira/browse/IGNITE-20399;)]
 public async Task TestSchemaUpdateWhileStreaming([Values(true, false)] 
bool insertNewColumn)
 {
 await Client.Sql.ExecuteAsync(null, $"CREATE TABLE {TestTableName} 
(KEY bigint PRIMARY KEY)");
diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/SessionUtils.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/SessionUtils.java
index d0562a1373..ad99e6567d 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/SessionUtils.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/SessionUtils.java
@@ -35,7 +35,7 @@ public class SessionUtils {
  * be executed n an implicit transaction.
  */
 public static void executeUpdate(String sql, Session session, @Nullable 
Transaction transaction) {
-try (ResultSet ignored = session.execute(transaction, sql)) {
+try (ResultSet ignored = session.execute(transaction, sql)) {
 // Do nothing, just adhere to the syntactic ceremony...
 }
 }
diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/inmemory/ItRaftStorageVolatilityTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/inmemory/ItRaftStorageVolatilityTest.java
index 5bd78aa357..e865b7573f 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/inmemory/ItRaftStorageVolatilityTest.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/inmemory/ItRaftStorageVolatilityTest.java
@@ -20,9 +20,7 @@ package org.apache.ignite.internal.inmemory;
 import static ca.seinesoftware.hamcrest.path.PathMatcher.exists;
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static java.util.stream.Collectors.toList;
-import static 
org.apache.ignite.internal.distributionzones.DistributionZoneManager.DEFAULT_PARTITION_COUNT;
-import static 
org.apache.ignite.internal.distributionzones.DistributionZoneManager.DEFAULT_ZONE_NAME;
-import static 
org.apache.ignite.internal.distributionzones.DistributionZonesTestUtil.creat

[ignite-3] branch main updated: IGNITE-20200 Revert PR #2442 (#2569)

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

ibessonov 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 dfd111047e IGNITE-20200 Revert PR #2442 (#2569)
dfd111047e is described below

commit dfd111047e7f4a59cf9c9bee3945f2639b714d6a
Author: Ivan Bessonov 
AuthorDate: Mon Sep 11 16:07:53 2023 +0300

IGNITE-20200 Revert PR #2442 (#2569)

This reverts commit 027bdd16819ff8a6d811b6cba836652b28592e0b.
---
 buildscripts/java-core.gradle | 2 --
 1 file changed, 2 deletions(-)

diff --git a/buildscripts/java-core.gradle b/buildscripts/java-core.gradle
index 52c72513f4..36d414eff0 100644
--- a/buildscripts/java-core.gradle
+++ b/buildscripts/java-core.gradle
@@ -29,8 +29,6 @@ java {
 }
 
 test {
-ignoreFailures = true
-
 finalizedBy(jacocoTestReport)
 }
 



[ignite-3] 01/01: Revert "IGNITE-20200 Fix Gradle non-zero exit code on test failure (#2442)"

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

ibessonov pushed a commit to branch revert-2442-ignite-20200
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 9bdb7c6a02de831c14bd4adc15385842c12abb44
Author: Ivan Bessonov 
AuthorDate: Mon Sep 11 16:04:41 2023 +0300

Revert "IGNITE-20200 Fix Gradle non-zero exit code on test failure (#2442)"

This reverts commit 027bdd16819ff8a6d811b6cba836652b28592e0b.
---
 buildscripts/java-core.gradle | 2 --
 1 file changed, 2 deletions(-)

diff --git a/buildscripts/java-core.gradle b/buildscripts/java-core.gradle
index 52c72513f4..36d414eff0 100644
--- a/buildscripts/java-core.gradle
+++ b/buildscripts/java-core.gradle
@@ -29,8 +29,6 @@ java {
 }
 
 test {
-ignoreFailures = true
-
 finalizedBy(jacocoTestReport)
 }
 



[ignite-3] branch revert-2442-ignite-20200 created (now 9bdb7c6a02)

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

ibessonov pushed a change to branch revert-2442-ignite-20200
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


  at 9bdb7c6a02 Revert "IGNITE-20200 Fix Gradle non-zero exit code on test 
failure (#2442)"

This branch includes the following new commits:

 new 9bdb7c6a02 Revert "IGNITE-20200 Fix Gradle non-zero exit code on test 
failure (#2442)"

The 1 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-3] branch main updated (a1fe0da528 -> 61b28d67a4)

2023-09-08 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from a1fe0da528 IGNITE-20181: KV/Binary view public API should only throw 
public exceptions (#2523)
 add 61b28d67a4 IGNITE-14818 Implement compressed encoding for short type 
in messaging. (#2544)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/ignite/network/NetworkMessage.java  |   4 +-
 .../network/serialization/MessageReader.java   |   8 ++
 .../network/direct/DirectMarshallingUtils.java |  49 ---
 .../network/direct/DirectMessageReader.java|  11 ++
 .../network/direct/DirectMessageWriter.java|   1 -
 .../stream/DirectByteBufferStreamImplV1.java   | 141 +++--
 .../network/message/ClassDescriptorMessage.java|   4 +-
 .../internal/network/netty/InboundDecoder.java |  72 ---
 .../PerSessionSerializationService.java|   2 +-
 .../internal/network/netty/NettyServerTest.java|   4 +-
 .../ignite/internal/raft/util/OptimizedStream.java |   7 -
 11 files changed, 149 insertions(+), 154 deletions(-)
 delete mode 100644 
modules/network/src/main/java/org/apache/ignite/internal/network/direct/DirectMarshallingUtils.java



[ignite-3] branch main updated: IGNITE-20256 Refuse to install Raft snapshots on partitions when not enough schemas are available (#2473)

2023-09-04 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 4406ebf825 IGNITE-20256 Refuse to install Raft snapshots on partitions 
when not enough schemas are available (#2473)
4406ebf825 is described below

commit 4406ebf825083e21ebd0a20d2fafed738acdff55
Author: Roman Puchkovskiy 
AuthorDate: Mon Sep 4 18:57:10 2023 +0400

IGNITE-20256 Refuse to install Raft snapshots on partitions when not enough 
schemas are available (#2473)
---
 .../internal/catalog/CatalogManagerSelfTest.java   |   2 +
 .../internal/testframework/IgniteTestUtils.java|   4 +-
 .../ignite/raft/jraft/entity/RaftOutter.java   |   3 +
 .../raftsnapshot/ItTableRaftSnapshotsTest.java | 202 ++--
 .../storage/rocksdb/RocksDbMvPartitionStorage.java |   2 +-
 .../internal/table/distributed/TableManager.java   |   1 +
 .../raft/snapshot/PartitionSnapshotStorage.java|  13 ++
 .../snapshot/PartitionSnapshotStorageFactory.java  |  13 +-
 .../snapshot/incoming/IncomingSnapshotCopier.java  | 126 --
 .../raft/snapshot/outgoing/OutgoingSnapshot.java   |   8 +-
 .../snapshot/outgoing/OutgoingSnapshotReader.java  |   2 +-
 .../raft/snapshot/outgoing/SnapshotMetaUtils.java  |   6 +-
 .../schema/CatalogVersionSufficiency.java  |   2 +-
 .../PartitionSnapshotStorageFactoryTest.java   |   3 +
 .../snapshot/PartitionSnapshotStorageTest.java |   2 +
 .../incoming/IncomingSnapshotCopierTest.java   | 254 ++---
 .../outgoing/OutgoingSnapshotCommonTest.java   |  11 +-
 .../OutgoingSnapshotMvDataStreamingTest.java   |   6 +-
 .../outgoing/OutgoingSnapshotReaderTest.java   |   2 +
 .../OutgoingSnapshotTxDataStreamingTest.java   |   6 +-
 .../outgoing/OutgoingSnapshotsManagerTest.java |   6 +-
 .../snapshot/outgoing/SnapshotMetaUtilsTest.java   |   5 +-
 22 files changed, 536 insertions(+), 143 deletions(-)

diff --git 
a/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java
 
b/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java
index 21f92469f9..23239c547f 100644
--- 
a/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java
+++ 
b/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java
@@ -173,6 +173,8 @@ public class CatalogManagerSelfTest extends 
BaseCatalogManagerTest {
 assertEquals(INFINITE_TIMER_VALUE, 
zone.dataNodesAutoAdjustScaleDown());
 assertEquals(DEFAULT_STORAGE_ENGINE, zone.dataStorage().engine());
 assertEquals(DEFAULT_DATA_REGION, zone.dataStorage().dataRegion());
+
+assertThat(manager.latestCatalogVersion(), is(0));
 }
 
 @Test
diff --git 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
index a8c22d1eeb..c21b6e70e9 100644
--- 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
+++ 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
@@ -190,9 +190,9 @@ public final class IgniteTestUtils {
  * @param fieldName name of the field
  * @return field value
  */
-public static Object getFieldValue(@Nullable Object target, Class 
declaredClass, String fieldName) {
+public static  T getFieldValue(@Nullable Object target, Class 
declaredClass, String fieldName) {
 try {
-return getField(target, declaredClass, fieldName).get(target);
+return (T) getField(target, declaredClass, fieldName).get(target);
 } catch (IllegalAccessException e) {
 throw new IgniteInternalException("Cannot get field value", e);
 }
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/entity/RaftOutter.java
 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/entity/RaftOutter.java
index 8e36f3ec75..935b4fbda1 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/entity/RaftOutter.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/entity/RaftOutter.java
@@ -73,5 +73,8 @@ public final class RaftOutter {
 
 @Nullable
 Collection oldLearnersList();
+
+/** Minimum catalog version that is required for the snapshot to be 
accepted by a follower. */
+int requiredCatalogVersion();
 }
 }
diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
index 88a2ec05e5..37299f5675 100644
--- 
a/modules/runner/src/integratio

[ignite-3] branch main updated: IGNITE-20318 Fix logging for raft log truncation (#2522)

2023-08-31 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 b75485057c IGNITE-20318 Fix logging for raft log truncation (#2522)
b75485057c is described below

commit b75485057ca6ac609293e6e8252fc68e573d71cf
Author: Ivan Bessonov 
AuthorDate: Thu Aug 31 13:43:40 2023 +0300

IGNITE-20318 Fix logging for raft log truncation (#2522)
---
 .../ignite/raft/jraft/storage/impl/LogManagerImpl.java | 14 +++---
 .../main/java/org/apache/ignite/raft/jraft/util/Utils.java |  2 +-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/storage/impl/LogManagerImpl.java
 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/storage/impl/LogManagerImpl.java
index 82198b7c93..49e72c4f1f 100644
--- 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/storage/impl/LogManagerImpl.java
+++ 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/storage/impl/LogManagerImpl.java
@@ -532,7 +532,11 @@ public class LogManagerImpl implements LogManager {
 long startMs = Utils.monotonicMs();
 try {
 final TruncatePrefixClosure tpc = 
(TruncatePrefixClosure) done;
-LOG.debug("Truncating storage to 
firstIndexKept={}.", tpc.firstIndexKept);
+LOG.info(
+"Truncating log storage prefix 
[groupId={}, firstIndexKept={}]",
+nodeId.getGroupId(),
+tpc.firstIndexKept
+);
 ret = 
LogManagerImpl.this.logStorage.truncatePrefix(tpc.firstIndexKept);
 }
 finally {
@@ -544,7 +548,11 @@ public class LogManagerImpl implements LogManager {
 startMs = Utils.monotonicMs();
 try {
 final TruncateSuffixClosure tsc = 
(TruncateSuffixClosure) done;
-LOG.warn("Truncating storage to 
lastIndexKept={}.", tsc.lastIndexKept);
+LOG.warn(
+"Truncating log storage suffix 
[groupId={}, lastIndexKept={}]",
+nodeId.getGroupId(),
+tsc.lastIndexKept
+);
 ret = 
LogManagerImpl.this.logStorage.truncateSuffix(tsc.lastIndexKept);
 if (ret) {
 this.lastId.setIndex(tsc.lastIndexKept);
@@ -559,7 +567,7 @@ public class LogManagerImpl implements LogManager {
 break;
 case RESET:
 final ResetClosure rc = (ResetClosure) done;
-LOG.info("Resetting storage to nextLogIndex={}.", 
rc.nextLogIndex);
+LOG.info("Resetting log storage [groupId={}, 
nextLogIndex={}]", nodeId.getGroupId(), rc.nextLogIndex);
 ret = 
LogManagerImpl.this.logStorage.reset(rc.nextLogIndex);
 break;
 default:
diff --git 
a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/util/Utils.java 
b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/util/Utils.java
index 078e64252c..33ab5dd673 100644
--- a/modules/raft/src/main/java/org/apache/ignite/raft/jraft/util/Utils.java
+++ b/modules/raft/src/main/java/org/apache/ignite/raft/jraft/util/Utils.java
@@ -321,7 +321,7 @@ public final class Utils {
  * Gets the current monotonic time in milliseconds.
  */
 public static long monotonicMs() {
-return TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
+return IgniteUtils.monotonicMs();
 }
 
 /**



[ignite-3] branch main updated: IGNITE-20312 Increase the number of log files in rotation (#2515)

2023-08-31 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 e569728d29 IGNITE-20312 Increase the number of log files in rotation 
(#2515)
e569728d29 is described below

commit e569728d29a0a2075ca1f3e6bdd9015a55a217d2
Author: Ivan Bessonov 
AuthorDate: Thu Aug 31 11:35:37 2023 +0300

IGNITE-20312 Increase the number of log files in rotation (#2515)
---
 packaging/db/ignite.java.util.logging.properties | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/packaging/db/ignite.java.util.logging.properties 
b/packaging/db/ignite.java.util.logging.properties
index a1ebb74acf..86b99f6d92 100644
--- a/packaging/db/ignite.java.util.logging.properties
+++ b/packaging/db/ignite.java.util.logging.properties
@@ -43,5 +43,6 @@ handlers=java.util.logging.FileHandler
 java.util.logging.FileHandler.formatter = 
org.apache.ignite.lang.JavaLoggerFormatter
 java.util.logging.FileHandler.pattern = @APP_LOG_DIR@/ignite3db-%g.log
 java.util.logging.FileHandler.level = INFO
-java.util.logging.FileHandler.limit = 10485760
-java.util.logging.FileHandler.count = 10
+java.util.logging.FileHandler.append = true
+java.util.logging.FileHandler.limit = 104857600
+java.util.logging.FileHandler.count = 50



[ignite-3] branch main updated: IGNITE-20316 Fix possible lost updates in MetastorageInhibitor (#2521)

2023-08-31 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 7ee03fdfe6 IGNITE-20316 Fix possible lost updates in 
MetastorageInhibitor (#2521)
7ee03fdfe6 is described below

commit 7ee03fdfe6ef6f1b5ffb8fb986511e390259fa1b
Author: Roman Puchkovskiy 
AuthorDate: Thu Aug 31 12:18:49 2023 +0400

IGNITE-20316 Fix possible lost updates in MetastorageInhibitor (#2521)
---
 .../internal/test/WatchListenerInhibitor.java  | 36 +-
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/test/WatchListenerInhibitor.java
 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/test/WatchListenerInhibitor.java
index dc3f880ee1..8e5b5792d1 100644
--- 
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/test/WatchListenerInhibitor.java
+++ 
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/test/WatchListenerInhibitor.java
@@ -22,6 +22,7 @@ import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.getFieldV
 
 import java.lang.reflect.Field;
 import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.locks.ReadWriteLock;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.internal.app.IgniteImpl;
 import org.apache.ignite.internal.metastorage.impl.MetaStorageManagerImpl;
@@ -34,7 +35,11 @@ import 
org.apache.ignite.internal.metastorage.server.persistence.RocksDbKeyValue
 public class WatchListenerInhibitor {
 private final WatchProcessor watchProcessor;
 
-private final Field notificationFutureField;
+private final RocksDbKeyValueStorage storage;
+
+private final Field processorNotificationFutureField;
+
+private final Field storageRwLockField;
 
 /** Future used to block the watch notification thread. */
 private final CompletableFuture inhibitFuture = new 
CompletableFuture<>();
@@ -46,19 +51,24 @@ public class WatchListenerInhibitor {
  * @return Listener inhibitor.
  */
 public static WatchListenerInhibitor metastorageEventsInhibitor(Ignite 
ignite) {
-//TODO: IGNITE-15723 After a component factory will be implemented, 
need to got rid of reflection here.
-var metaStorageManager = (MetaStorageManagerImpl) 
getFieldValue(ignite, IgniteImpl.class, "metaStorageMgr");
+IgniteImpl igniteImpl = (IgniteImpl) ignite;
+
+var metaStorageManager = (MetaStorageManagerImpl) 
igniteImpl.metaStorageManager();
 
+//TODO: IGNITE-15723 After a component factory is implemented, need to 
got rid of reflection here.
 var storage = (RocksDbKeyValueStorage) 
getFieldValue(metaStorageManager, MetaStorageManagerImpl.class, "storage");
 
 var watchProcessor = (WatchProcessor) getFieldValue(storage, 
RocksDbKeyValueStorage.class, "watchProcessor");
 
-return new WatchListenerInhibitor(watchProcessor);
+return new WatchListenerInhibitor(watchProcessor, storage);
 }
 
-private WatchListenerInhibitor(WatchProcessor watchProcessor) {
+private WatchListenerInhibitor(WatchProcessor watchProcessor, 
RocksDbKeyValueStorage storage) {
 this.watchProcessor = watchProcessor;
-this.notificationFutureField = getField(watchProcessor, 
WatchProcessor.class, "notificationFuture");
+this.storage = storage;
+
+processorNotificationFutureField = getField(watchProcessor, 
WatchProcessor.class, "notificationFuture");
+storageRwLockField = getField(storage, RocksDbKeyValueStorage.class, 
"rwLock");
 }
 
 /**
@@ -66,9 +76,19 @@ public class WatchListenerInhibitor {
  */
 public void startInhibit() {
 try {
-CompletableFuture notificationFuture = 
(CompletableFuture) notificationFutureField.get(watchProcessor);
+// We take this lock because it's actually used by 
RocksDbKeyValueStorage, among other things, to make future chaining
+// correct wrt concurrency.
+ReadWriteLock rwLock = (ReadWriteLock) 
storageRwLockField.get(storage);
+
+rwLock.writeLock().lock();
+
+try {
+CompletableFuture notificationFuture = 
(CompletableFuture) processorNotificationFutureField.get(watchProcessor);
 
-notificationFutureField.set(watchProcessor, 
notificationFuture.thenCompose(v -> inhibitFuture));
+processorNotificationFutureField.set(watchProcessor, 
notificationFuture.thenCompose(v -> inhibitFuture));
+} finally {
+rwLock.writeLock().unlock();
+}
 } catch (IllegalAccessException e) {
 throw new RuntimeException(e);
 }



[ignite-3] branch main updated (2734aea7b9 -> 2c1b153a22)

2023-08-25 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from 2734aea7b9 IGNITE-19982 .NET: Support BOOLEAN datatype (#2499)
 add 2c1b153a22 IGNITE-20283: IDEA gradle run configurations improvements 
(#2502)

No new revisions were added by this update.

Summary of changes:
 ...l checks [PMD, modernizer, checkstyle].run.xml} | 12 ---
 .run/All checks [check].run.xml|  4 ++--
 ...onfigure -x :platforms:cmakeBuildOdbc].run.xml} | 23 --
 3 files changed, 24 insertions(+), 15 deletions(-)
 copy .run/{All checks [check].run.xml => All checks [PMD, modernizer, 
checkstyle].run.xml} (61%)
 copy .run/{PMD [pmdMain].run.xml => Fast build only java [clean build -x 
assembleDist -x distTar -x distZip -x check -x :platforms:build -x 
:platforms:cmakeConfigureOdbc -x :platforms:cmakeConfigure -x 
:platforms:cmakeBuildOdbc].run.xml} (61%)



[ignite-3] branch main updated: IGNITE-20278 Make binary_tuple_builder fields protected instead of private. (#2496)

2023-08-25 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 4baed38452 IGNITE-20278 Make binary_tuple_builder fields protected 
instead of private. (#2496)
4baed38452 is described below

commit 4baed38452b3334cb7d92d2531c54152b4d97edc
Author: Dmitriy Zabotlin 
AuthorDate: Fri Aug 25 10:20:21 2023 +0300

IGNITE-20278 Make binary_tuple_builder fields protected instead of private. 
(#2496)
---
 modules/platforms/cpp/ignite/tuple/binary_tuple_builder.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/platforms/cpp/ignite/tuple/binary_tuple_builder.h 
b/modules/platforms/cpp/ignite/tuple/binary_tuple_builder.h
index fcc94d0ddf..7e15673606 100644
--- a/modules/platforms/cpp/ignite/tuple/binary_tuple_builder.h
+++ b/modules/platforms/cpp/ignite/tuple/binary_tuple_builder.h
@@ -58,6 +58,7 @@ namespace ignite {
  * 5. Finally, the resulting binary tuple is obtained with the @ref build call.
  */
 class binary_tuple_builder {
+protected:
 const tuple_num_t element_count; /**< Total number of elements. */
 
 tuple_num_t element_index; /**< Index of the next element to add. */



[ignite-3] branch main updated: IGNITE-20276: Include tests into run PMD configuration (#2492)

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

ibessonov 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 0f92a9a12c IGNITE-20276: Include tests into run PMD configuration 
(#2492)
0f92a9a12c is described below

commit 0f92a9a12c3ca786ac39b3f42a802b6b1d95e84f
Author: ygerzhedovich <41903880+ygerzhedov...@users.noreply.github.com>
AuthorDate: Thu Aug 24 14:39:22 2023 +0300

IGNITE-20276: Include tests into run PMD configuration (#2492)
---
 .run/PMD [pmdMain].run.xml |  5 +++--
 .../java/org/apache/ignite/internal/rocksdb/ColumnFamily.java  | 10 +-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/.run/PMD [pmdMain].run.xml b/.run/PMD [pmdMain].run.xml
index 9a37fc54e5..5a56985715 100644
--- a/.run/PMD [pmdMain].run.xml
+++ b/.run/PMD [pmdMain].run.xml
@@ -16,7 +16,7 @@
   -->
 
 
-  
+  
 
   
   
@@ -28,6 +28,7 @@
   
 
   
+  
 
   
   
@@ -37,4 +38,4 @@
 false
 
   
-
\ No newline at end of file
+
diff --git 
a/modules/rocksdb-common/src/main/java/org/apache/ignite/internal/rocksdb/ColumnFamily.java
 
b/modules/rocksdb-common/src/main/java/org/apache/ignite/internal/rocksdb/ColumnFamily.java
index f1d902c4c2..111e98acc0 100644
--- 
a/modules/rocksdb-common/src/main/java/org/apache/ignite/internal/rocksdb/ColumnFamily.java
+++ 
b/modules/rocksdb-common/src/main/java/org/apache/ignite/internal/rocksdb/ColumnFamily.java
@@ -103,7 +103,7 @@ public class ColumnFamily {
  * @throws RocksDBException If failed.
  * @see RocksDB#get(ColumnFamilyHandle, byte[])
  */
-public byte @Nullable [] get(byte [] key) throws RocksDBException {
+public byte @Nullable [] get(byte[] key) throws RocksDBException {
 return db.get(cfHandle, key);
 }
 
@@ -115,7 +115,7 @@ public class ColumnFamily {
  * @throws RocksDBException If failed.
  * @see RocksDB#put(ColumnFamilyHandle, byte[], byte[])
  */
-public void put(byte [] key, byte [] value) throws RocksDBException {
+public void put(byte[] key, byte[] value) throws RocksDBException {
 db.put(cfHandle, key, value);
 }
 
@@ -128,7 +128,7 @@ public class ColumnFamily {
  * @throws RocksDBException If failed.
  * @see WriteBatch#put(ColumnFamilyHandle, byte[], byte[])
  */
-public void put(WriteBatch batch, byte [] key, byte [] value) throws 
RocksDBException {
+public void put(WriteBatch batch, byte[] key, byte[] value) throws 
RocksDBException {
 batch.put(cfHandle, key, value);
 }
 
@@ -139,7 +139,7 @@ public class ColumnFamily {
  * @throws RocksDBException If failed.
  * @see RocksDB#delete(ColumnFamilyHandle, byte[])
  */
-public void delete(byte [] key) throws RocksDBException {
+public void delete(byte[] key) throws RocksDBException {
 db.delete(cfHandle, key);
 }
 
@@ -151,7 +151,7 @@ public class ColumnFamily {
  * @throws RocksDBException If failed.
  * @see WriteBatch#delete(ColumnFamilyHandle, byte[])
  */
-public void delete(WriteBatch batch, byte [] key) throws RocksDBException {
+public void delete(WriteBatch batch, byte[] key) throws RocksDBException {
 batch.delete(cfHandle, key);
 }
 



[ignite-3] branch main updated: IGNITE-20214 Fix flaky ItSimpleCounterServerTest#testRefreshLeader test (#2445)

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

ibessonov 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 e98dee77ee IGNITE-20214 Fix flaky 
ItSimpleCounterServerTest#testRefreshLeader test (#2445)
e98dee77ee is described below

commit e98dee77ee66084aa1df553addf4564ea0fbffa9
Author: Alexander Polovtcev 
AuthorDate: Tue Aug 15 09:43:53 2023 +0300

IGNITE-20214 Fix flaky ItSimpleCounterServerTest#testRefreshLeader test 
(#2445)
---
 .../org/apache/ignite/raft/server/ItSimpleCounterServerTest.java| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItSimpleCounterServerTest.java
 
b/modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItSimpleCounterServerTest.java
index ad326a0d42..25770b4f4f 100644
--- 
a/modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItSimpleCounterServerTest.java
+++ 
b/modules/raft/src/integrationTest/java/org/apache/ignite/raft/server/ItSimpleCounterServerTest.java
@@ -136,9 +136,9 @@ class ItSimpleCounterServerTest extends 
RaftServerAbstractTest {
 .start(COUNTER_GROUP_ID_1, clientNode2, FACTORY, 
raftConfiguration, memberConfiguration, false, executor)
 .get(3, TimeUnit.SECONDS);
 
-assertTrue(waitForTopology(service, 3, 1000));
-assertTrue(waitForTopology(clientNode1, 3, 1000));
-assertTrue(waitForTopology(clientNode2, 3, 1000));
+assertTrue(waitForTopology(service, 3, 10_000));
+assertTrue(waitForTopology(clientNode1, 3, 10_000));
+assertTrue(waitForTopology(clientNode2, 3, 10_000));
 }
 
 /**



[ignite-3] branch main updated (f6214ae730 -> 99f7775253)

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

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


from f6214ae730 IGNITE-20035 Sql. Fixed handling "maxRows" jdbc query 
parameter (#2437)
 add 99f7775253 IGNITE-20049 Remove BinaryRow#hasValue method (#2424)

No new revisions were added by this update.

Summary of changes:
 .idea/inspectionProfiles/Project_Default.xml   |   8 +-
 build.gradle   |   1 +
 .../org/apache/ignite/table/mapper/Mapper.java |   3 +-
 .../internal/binarytuple/BinaryTupleCommon.java|   6 -
 .../ignite/client/fakes/FakeIgniteTables.java  |  22 ++-
 .../ignite/client/fakes/FakeInternalTable.java | 133 ++---
 .../ignite/client/fakes/FakeSchemaRegistry.java|  15 +-
 .../apache/ignite/internal/index/IndexManager.java |  49 +--
 .../ignite/internal/marshaller/Marshaller.java |  22 ++-
 .../ItRaftCommandLeftInLogUntilRestartTest.java|  15 +-
 .../internal/table/ItReadOnlyTransactionTest.java  |   4 +-
 .../ignite/internal/table/ItRoReadsTest.java   |  53 +++
 .../ignite/internal/table/ItTableScanTest.java |   8 +-
 .../apache/ignite/internal/schema/BinaryRow.java   |   3 -
 .../ignite/internal/schema/BinaryRowConverter.java |  82 +++
 .../ignite/internal/schema/BinaryRowImpl.java  |   7 -
 ...icationException.java => ColumnsExtractor.java} |  23 ++-
 .../ignite/internal/schema/SchemaRegistry.java |  10 +-
 .../marshaller/asm/AsmMarshallerGenerator.java |   5 +-
 .../marshaller/reflection/KvMarshallerImpl.java|  17 +--
 .../schema/marshaller/reflection/Marshaller.java   |  28 +++-
 .../reflection/RecordMarshallerImpl.java   |   4 +-
 .../schema/registry/SchemaRegistryImpl.java|  58 +---
 .../schema/registry/UpgradingRowAdapter.java   |  40 --
 .../org/apache/ignite/internal/schema/row/Row.java |  47 +++---
 .../ignite/internal/schema/row/RowAssembler.java   |  44 +-
 .../apache/ignite/internal/util/ObjectFactory.java |   2 +
 .../benchmarks/SerializerBenchmarkTest.java|   7 +-
 .../org/apache/ignite/internal/schema/RowTest.java |   2 +-
 .../schema/marshaller/KvMarshallerTest.java|  68 -
 .../schema/marshaller/RecordMarshallerTest.java|  12 +-
 .../RecordMarshallerValidationsTest.java   |   9 +-
 .../sql/engine/exec/UpdatableTableImpl.java|   6 +-
 .../internal/storage/BaseMvStoragesTest.java   |  14 +-
 .../ItInternalTableReadOnlyOperationsTest.java |  13 +-
 .../ignite/distributed/ItTablePersistenceTest.java |   2 +-
 .../distributed/ItTxDistributedTestSingleNode.java |   6 +-
 .../ignite/internal/table/ItColocationTest.java|   2 +-
 .../schema/marshaller/TupleMarshallerImpl.java |  29 ++--
 .../internal/table/AbstractRowTupleAdapter.java|   4 +-
 .../apache/ignite/internal/table/IndexWrapper.java |  12 +-
 .../internal/table/KeyValueBinaryViewImpl.java |   6 +-
 .../ignite/internal/table/KeyValueViewImpl.java|   4 +-
 .../internal/table/RecordBinaryViewImpl.java   |  18 ++-
 .../ignite/internal/table/RecordViewImpl.java  |   4 +-
 .../apache/ignite/internal/table/TableImpl.java|   8 +-
 .../table/distributed/HashIndexLocker.java |  20 +--
 .../internal/table/distributed/IndexLocker.java|  18 ++-
 .../table/distributed/SortedIndexLocker.java   |  21 +--
 .../internal/table/distributed/TableManager.java   |  17 +--
 .../distributed/TableSchemaAwareIndexStorage.java  |  21 ++-
 .../distributed/index/IndexUpdateHandler.java  |   4 +-
 .../request/MultipleRowReplicaRequest.java |   3 +-
 .../replicator/PartitionReplicaListener.java   | 111 +++---
 .../table/ColocationHashCalculationTest.java   |   2 +-
 .../internal/table/distributed/IndexBaseTest.java  |  39 -
 .../raft/PartitionCommandListenerTest.java |  22 +--
 .../PartitionReplicaListenerIndexLockingTest.java  |  91 +---
 .../replication/PartitionReplicaListenerTest.java  | 159 +++--
 .../table/impl/DummyInternalTableImpl.java |   6 +-
 .../table/impl/DummySchemaManagerImpl.java |  15 +-
 61 files changed, 892 insertions(+), 592 deletions(-)
 copy 
modules/schema/src/main/java/org/apache/ignite/internal/schema/{SchemaModificationException.java
 => ColumnsExtractor.java} (58%)



[ignite-3] branch main updated: IGNITE-20180 Fix flaky ItTablePersistenceTest#testSnapshot (#2428)

2023-08-10 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

ibessonov 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 0e0ba6a3ca IGNITE-20180 Fix flaky ItTablePersistenceTest#testSnapshot 
(#2428)
0e0ba6a3ca is described below

commit 0e0ba6a3ca8e4432e642be75b8d27ea23ceaa0e0
Author: Ivan Bessonov 
AuthorDate: Thu Aug 10 11:31:57 2023 +0300

IGNITE-20180 Fix flaky ItTablePersistenceTest#testSnapshot (#2428)
---
 .../raft/service/ItAbstractListenerSnapshotTest.java|  7 +++
 .../ignite/distributed/ItTablePersistenceTest.java  | 17 -
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git 
a/modules/raft/src/testFixtures/java/org/apache/ignite/internal/raft/service/ItAbstractListenerSnapshotTest.java
 
b/modules/raft/src/testFixtures/java/org/apache/ignite/internal/raft/service/ItAbstractListenerSnapshotTest.java
index fce4690e24..ec6ce84fbb 100644
--- 
a/modules/raft/src/testFixtures/java/org/apache/ignite/internal/raft/service/ItAbstractListenerSnapshotTest.java
+++ 
b/modules/raft/src/testFixtures/java/org/apache/ignite/internal/raft/service/ItAbstractListenerSnapshotTest.java
@@ -145,6 +145,13 @@ public abstract class ItAbstractListenerSnapshotTest servers() {
+return List.copyOf(servers);
+}
+
 /**
  * Test parameters for {@link #testSnapshot}.
  */
diff --git 
a/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTablePersistenceTest.java
 
b/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTablePersistenceTest.java
index a49467a756..28c7b6339e 100644
--- 
a/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTablePersistenceTest.java
+++ 
b/modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTablePersistenceTest.java
@@ -33,6 +33,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
 import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.LinkedList;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ConcurrentHashMap;
@@ -225,7 +226,21 @@ public class ItTablePersistenceTest extends 
ItAbstractListenerSnapshotTest servers = servers();
+
+JraftServerImpl leader = servers.stream()
+.filter(server -> 
server.localPeers(raftGroupId()).contains(service.leader()))
+.findFirst().orElseThrow();
+
+// We only read from the leader, every other node may not 
have the latest data.
+int storageIndex = servers.indexOf(leader);
+
+// Here we must account for the stopped node, index in 
"servers" and index in "mvPartitionStorages" will differ
+// for "serverIndex >= stoppedNodeIndex".
+if (storageIndex >= stoppedNodeIndex) {
+storageIndex++;
+}
+
 MvPartitionStorage partitionStorage = 
mvPartitionStorages.get(storageIndex);
 
 Map primaryIndex = 
rowsToRowIds(partitionStorage);



[ignite-3] branch main updated (551401872e -> 8451881ebf)

2023-08-08 Thread ibessonov
This is an automated email from the ASF dual-hosted git repository.

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


from 551401872e Merge branch 'main' of 
https://gitbox.apache.org/repos/asf/ignite-3
 add 8451881ebf IGNITE-20161 Fix NPE in AppendEntriesRequestProcessor 
(#2407)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/ignite/raft/jraft/core/ItNodeTest.java   |  7 ++-
 .../java/org/apache/ignite/raft/jraft/JRaftUtils.java   |  4 +++-
 .../org/apache/ignite/raft/jraft/core/NodeImpl.java | 17 ++---
 3 files changed, 7 insertions(+), 21 deletions(-)



[ignite-3] branch main updated: IGNITE-20076 Improve networking shutdown implementation (#2375)

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

ibessonov 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 4084a87d19 IGNITE-20076 Improve networking shutdown implementation 
(#2375)
4084a87d19 is described below

commit 4084a87d194e007c7bd2fc59cf7e5653b4cf6204
Author: Roman Puchkovskiy 
AuthorDate: Fri Jul 28 18:09:07 2023 +0400

IGNITE-20076 Improve networking shutdown implementation (#2375)
---
 .../cluster/management/ItClusterManagerTest.java   |  2 +-
 .../internal/network/netty/ConnectionManager.java  | 46 +---
 .../recovery/RecoveryClientHandshakeManager.java   | 50 +-
 .../recovery/RecoveryServerHandshakeManager.java   | 50 +-
 .../recovery/message/HandshakeRejectedMessage.java |  6 +++
 .../scalecube/ScaleCubeClusterServiceFactory.java  |  2 +
 .../network/netty/RecoveryHandshakeTest.java   | 20 -
 .../network/DefaultMessagingServiceTest.java   |  3 +-
 8 files changed, 150 insertions(+), 29 deletions(-)

diff --git 
a/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterManagerTest.java
 
b/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterManagerTest.java
index 6ea0bd490f..bc20440a6e 100644
--- 
a/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterManagerTest.java
+++ 
b/modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/ItClusterManagerTest.java
@@ -346,7 +346,7 @@ public class ItClusterManagerTest extends 
BaseItClusterManagementTest {
 
 stopNodes(List.of(leaderNode));
 
-// Issue the JoinReadCommand on the joining node. It is expected that 
the joining node is still treated as validated.
+// Issue the JoinReadyCommand on the joining node. It is expected that 
the joining node is still treated as validated.
 assertThat(node.clusterManager().onJoinReady(), 
willCompleteSuccessfully());
 }
 
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java
index 2a77bfe720..df8a27edee 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java
@@ -46,6 +46,7 @@ import 
org.apache.ignite.internal.network.recovery.RecoveryServerHandshakeManage
 import org.apache.ignite.internal.network.recovery.StaleIdDetector;
 import org.apache.ignite.internal.network.serialization.SerializationService;
 import org.apache.ignite.lang.IgniteInternalException;
+import org.apache.ignite.lang.NodeStoppingException;
 import org.apache.ignite.network.ChannelType;
 import org.apache.ignite.network.NettyBootstrapFactory;
 import org.jetbrains.annotations.Nullable;
@@ -97,6 +98,8 @@ public class ConnectionManager implements 
ChannelCreationListener {
 /** Start flag. */
 private final AtomicBoolean started = new AtomicBoolean(false);
 
+private final AtomicBoolean stopping = new AtomicBoolean(false);
+
 /** Stop flag. */
 private final AtomicBoolean stopped = new AtomicBoolean(false);
 
@@ -234,14 +237,18 @@ public class ConnectionManager implements 
ChannelCreationListener {
 }
 }
 
-// Get an existing client or create a new one. NettyClient provides a 
CompletableFuture that resolves
+// Get an existing client or create a new one. NettyClient provides a 
future that resolves
 // when the client is ready for write operations, so previously 
started client, that didn't establish connection
 // or didn't perform the handshake operation, can be reused.
-NettyClient client = clients.compute(
+@Nullable NettyClient client = clients.compute(
 new ConnectorKey<>(address, type),
 (key, existingClient) -> isClientConnected(existingClient) ? 
existingClient : connect(key.id(), key.type())
 );
 
+if (client == null) {
+return OrderingFuture.failedFuture(new NodeStoppingException("No 
outgoing connections are allowed as the node is stopping"));
+}
+
 return client.sender();
 }
 
@@ -277,9 +284,14 @@ public class ConnectionManager implements 
ChannelCreationListener {
  * Create new client from this node to specified address.
  *
  * @param address Target address.
- * @return New netty client.
+ * @return New netty client or {@code null} if we are stopping.
  */
+@Nullable
 private NettyClient connect(InetSocketAddress address, ChannelType 
channelType) {
+ 

[ignite-3] branch main updated (a6f1f8208b -> fb100d1027)

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

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


from a6f1f8208b IGNITE-20045 Use classes from Catalog domain in assignments 
recalculation code (#2358)
 add fb100d1027 IGNITE-20043 Prevent certain Mockito-related memory leaks 
in tests. (#2355)

No new revisions were added by this update.

Summary of changes:
 .../ignite/internal/testframework/BaseIgniteAbstractTest.java  | 10 ++
 .../internal/deployment/ItDeploymentUnitFailoverTest.java  |  2 ++
 2 files changed, 12 insertions(+)



[ignite-3] branch main updated: IGNITE-20045 Use classes from Catalog domain in assignments recalculation code (#2358)

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

ibessonov 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 a6f1f8208b IGNITE-20045 Use classes from Catalog domain in assignments 
recalculation code (#2358)
a6f1f8208b is described below

commit a6f1f8208b05058937578e19d0ca01b80c03731c
Author: Roman Puchkovskiy 
AuthorDate: Wed Jul 26 19:05:23 2023 +0400

IGNITE-20045 Use classes from Catalog domain in assignments recalculation 
code (#2358)
---
 modules/distribution-zones/build.gradle|  1 +
 .../rebalance/DistributionZoneRebalanceEngine.java | 26 ++---
 .../distributionzones/rebalance/RebalanceUtil.java | 42 ++---
 .../rebalance/ZoneCatalogDescriptorUtils.java  | 68 ++
 .../DistributionZoneRebalanceEngineTest.java   | 25 
 .../RebalanceUtilUpdateAssignmentsTest.java| 20 ---
 .../internal/table/distributed/TableManager.java   | 42 +
 7 files changed, 148 insertions(+), 76 deletions(-)

diff --git a/modules/distribution-zones/build.gradle 
b/modules/distribution-zones/build.gradle
index c0d38eff4f..54c78c763f 100644
--- a/modules/distribution-zones/build.gradle
+++ b/modules/distribution-zones/build.gradle
@@ -34,6 +34,7 @@ dependencies {
 implementation project(':ignite-vault')
 implementation project(':ignite-schema')
 implementation project(':ignite-affinity')
+implementation project(':ignite-catalog')
 
 implementation libs.auto.service.annotations
 implementation libs.fastutil.core
diff --git 
a/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/DistributionZoneRebalanceEngine.java
 
b/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/DistributionZoneRebalanceEngine.java
index 89c45d0dd4..7de5fd1d2f 100644
--- 
a/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/DistributionZoneRebalanceEngine.java
+++ 
b/modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/DistributionZoneRebalanceEngine.java
@@ -27,6 +27,8 @@ import static 
org.apache.ignite.internal.distributionzones.DistributionZonesUtil
 import static 
org.apache.ignite.internal.distributionzones.DistributionZonesUtil.getZoneById;
 import static 
org.apache.ignite.internal.distributionzones.DistributionZonesUtil.parseDataNodes;
 import static 
org.apache.ignite.internal.distributionzones.DistributionZonesUtil.zoneDataNodesKey;
+import static 
org.apache.ignite.internal.distributionzones.rebalance.ZoneCatalogDescriptorUtils.toZoneDescriptor;
+import static 
org.apache.ignite.internal.schema.CatalogDescriptorUtils.toTableDescriptor;
 import static org.apache.ignite.lang.ErrorGroups.Common.NODE_STOPPING_ERR;
 
 import java.util.ArrayList;
@@ -37,6 +39,8 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.ignite.configuration.notifications.ConfigurationListener;
 import 
org.apache.ignite.configuration.notifications.ConfigurationNotificationEvent;
+import org.apache.ignite.internal.catalog.descriptors.CatalogTableDescriptor;
+import org.apache.ignite.internal.catalog.descriptors.CatalogZoneDescriptor;
 import org.apache.ignite.internal.distributionzones.DistributionZoneManager;
 import org.apache.ignite.internal.distributionzones.Node;
 import 
org.apache.ignite.internal.distributionzones.configuration.DistributionZoneView;
@@ -176,10 +180,14 @@ public class DistributionZoneRebalanceEngine {
 return completedFuture(null);
 }
 
+CatalogZoneDescriptor zoneDescriptor = 
toZoneDescriptor(zoneConfig);
+
 for (TableView tableConfig : findTablesByZoneId(zoneId)) {
+CatalogTableDescriptor tableDescriptor = 
toTableDescriptor(tableConfig);
+
 CompletableFuture[] partitionFutures = 
RebalanceUtil.triggerAllTablePartitionsRebalance(
-tableConfig,
-zoneConfig,
+tableDescriptor,
+zoneDescriptor,
 filteredDataNodes,
 evt.entryEvent().newEntry().revision(),
 metaStorageManager
@@ -198,13 +206,13 @@ public class DistributionZoneRebalanceEngine {
 // The exception is specific to this 
partition.
 LOG.error(
 "Exception on updating assignments 
for [table={}/{}, partition={}]", e,
-tableConfig.id(), 
tableConfig.name(), f

[ignite-3] branch main updated (55f33041f8 -> 8d96ed95ff)

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

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


from 55f33041f8 IGNITE-19926 Close CompletedFileUploads when unit is 
deployed (#2334)
 add 8d96ed95ff IGNITE-20040 Fix flaky 
"testOneChannelLeftIfConnectToEachOther" (#2352)

No new revisions were added by this update.

Summary of changes:
 .../ignite/internal/network/netty/ItConnectionManagerTest.java   | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)



[ignite-3] branch main updated: IGNITE-20037 Fix Gradle issues when building Ignite 3 on Java 17 (#2351)

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

ibessonov 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 df4fdc5986 IGNITE-20037 Fix Gradle issues when building Ignite 3 on 
Java 17 (#2351)
df4fdc5986 is described below

commit df4fdc5986d524fef749e2fee4904e8e4989ca19
Author: Alexander Polovtcev 
AuthorDate: Tue Jul 25 11:24:27 2023 +0300

IGNITE-20037 Fix Gradle issues when building Ignite 3 on Java 17 (#2351)
---
 build.gradle  |  1 +
 buildscripts/java-integration-test.gradle |  2 +-
 gradle/wrapper/gradle-wrapper.properties  |  2 +-
 .../internal/testframework/IgniteTestUtils.java   | 19 ++-
 packaging/odbc/build.gradle   |  7 ++-
 5 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/build.gradle b/build.gradle
index 30c5f9166f..62a8d42bcf 100644
--- a/build.gradle
+++ b/build.gradle
@@ -64,6 +64,7 @@ allprojects {
 "--add-opens=java.base/java.math=ALL-UNNAMED",
 "--add-opens=java.base/java.util=ALL-UNNAMED",
 "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
+"--add-opens=java.base/sun.security.x509=ALL-UNNAMED",
 "-Dio.netty.tryReflectionSetAccessible=true",
 
"-Djava.util.logging.config.file=${project.rootDir}/config/java.util.logging.properties"]
 
diff --git a/buildscripts/java-integration-test.gradle 
b/buildscripts/java-integration-test.gradle
index 568036fb69..8be4bd6a22 100644
--- a/buildscripts/java-integration-test.gradle
+++ b/buildscripts/java-integration-test.gradle
@@ -26,7 +26,7 @@ testing {
 useJUnitJupiter()
 
 dependencies {
-implementation project
+implementation project()
 implementation libs.junit5.api
 implementation libs.junit5.impl
 implementation libs.junit5.params
diff --git a/gradle/wrapper/gradle-wrapper.properties 
b/gradle/wrapper/gradle-wrapper.properties
index ae04661ee7..98debb84d5 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
index 4594818fd7..a8c22d1eeb 100644
--- 
a/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
+++ 
b/modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java
@@ -20,6 +20,8 @@ package org.apache.ignite.internal.testframework;
 import static java.lang.Thread.sleep;
 import static org.junit.jupiter.api.Assertions.fail;
 
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
@@ -64,6 +66,17 @@ public final class IgniteTestUtils {
 
 private static final int TIMEOUT_SEC = 30;
 
+private static final VarHandle MODIFIERS;
+
+static {
+try {
+MethodHandles.Lookup lookup = 
MethodHandles.privateLookupIn(Field.class, MethodHandles.lookup());
+MODIFIERS = lookup.findVarHandle(Field.class, "modifiers", 
int.class);
+} catch (IllegalAccessException | NoSuchFieldException ex) {
+throw new ExceptionInInitializerError(ex);
+}
+}
+
 /**
  * Set object field value via reflection.
  *
@@ -137,11 +150,7 @@ public final class IgniteTestUtils {
 }
 
 if (isFinal) {
-Field modifiersField = 
Field.class.getDeclaredField("modifiers");
-
-modifiersField.setAccessible(true);
-
-modifiersField.setInt(field, field.getModifiers() & 
~Modifier.FINAL);
+MODIFIERS.set(field, field.getModifiers() & ~Modifier.FINAL);
 }
 
 field.set(obj, val);
diff --git a/packaging/odbc/build.gradle b/packaging/odbc/build.gradle
index 25ce1e40fc..0ad0e5826f 100644
--- a/packaging/odbc/build.gradle
+++ b/packaging/odbc/build.gradle
@@ -25,6 +25,11 @@ plugins {
 alias(libs.plugins.checksum)
 }
 
+java {
+sourceCompatibility = JavaVersion.VERSION_11
+targetCompatibility = JavaVersion.VERSION_11
+}
+
 configurations {
 odbc
 }
@@ -100,4 +105,4 @@ ospackage {

[ignite-3] branch main updated: IGNITE-19671 Save default configuration values to configuration storage (#2301)

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

ibessonov 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 3f89316ace IGNITE-19671 Save default configuration values to 
configuration storage (#2301)
3f89316ace is described below

commit 3f89316acea9d1ac9763147c14f33ef01090cdae
Author: Cyrill 
AuthorDate: Thu Jul 20 17:03:31 2023 +0300

IGNITE-19671 Save default configuration values to configuration storage 
(#2301)
---
 .../configuration/ConfigurationChanger.java| 118 -
 .../configuration/ConfigurationRegistry.java   |  18 +---
 .../configuration/ConfigurationChangerTest.java|  15 +--
 .../asm/ConfigurationTreeGeneratorTest.java|   1 -
 .../configuration/direct/DirectPropertiesTest.java |   2 -
 .../ConfigurationAnyListenerTest.java  |   2 -
 .../notifications/ConfigurationListenerTest.java   |   4 +-
 .../internal/configuration/sample/UsageTest.java   |   2 -
 .../configuration/tree/InternalIdTest.java |   2 -
 ...ibutionZoneManagerConfigurationChangesTest.java |  12 +--
 .../DistributionZoneManagerScaleUpTest.java|   4 +-
 .../DistributionZoneManagerTest.java   |   4 +-
 .../org/apache/ignite/internal/app/IgniteImpl.java |   2 +-
 .../storage/LocalFileConfigurationStorageTest.java | 117 +---
 .../DdlCommandHandlerExceptionHandlingTest.java|   4 +-
 15 files changed, 189 insertions(+), 118 deletions(-)

diff --git 
a/modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationChanger.java
 
b/modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationChanger.java
index ade0c4b9c4..eb0fed2e2c 100644
--- 
a/modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationChanger.java
+++ 
b/modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationChanger.java
@@ -49,7 +49,6 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ForkJoinPool;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -95,6 +94,9 @@ public abstract class ConfigurationChanger implements 
DynamicConfigurationChange
 /** Storage trees. */
 private volatile StorageRoots storageRoots;
 
+/** Future that resolves after the defaults are persisted to the storage. 
*/
+private final CompletableFuture defaultsPersisted = new 
CompletableFuture<>();
+
 /** Configuration listener notification counter, must be incremented 
before each use of {@link #configurationUpdateListener}. */
 private final AtomicLong notificationListenerCnt = new AtomicLong();
 
@@ -124,6 +126,9 @@ public abstract class ConfigurationChanger implements 
DynamicConfigurationChange
  * Immutable data container to store version and all roots associated with 
the specific storage.
  */
 private static class StorageRoots {
+/** Immutable forest, so to say. */
+private final SuperRoot rootsWithoutDefaults;
+
 /** Immutable forest, so to say. */
 private final SuperRoot roots;
 
@@ -136,14 +141,17 @@ public abstract class ConfigurationChanger implements 
DynamicConfigurationChange
 /**
  * Constructor.
  *
- * @param roots Forest.
+ * @param rootsWithoutDefaults Forest without the defaults
+ * @param roots Forest with the defaults filled in
  * @param version Version associated with the currently known storage 
state.
  */
-private StorageRoots(SuperRoot roots, long version) {
+private StorageRoots(SuperRoot rootsWithoutDefaults, SuperRoot roots, 
long version) {
+this.rootsWithoutDefaults = rootsWithoutDefaults;
 this.roots = roots;
 this.version = version;
 
 makeImmutable(roots);
+makeImmutable(rootsWithoutDefaults);
 }
 }
 
@@ -151,7 +159,7 @@ public abstract class ConfigurationChanger implements 
DynamicConfigurationChange
  * Makes the node immutable by calling {@link 
ConstructableTreeNode#makeImmutable()} on each sub-node recursively.
  */
 private static void makeImmutable(InnerNode node) {
-if (!node.makeImmutable()) {
+if (node == null || !node.makeImmutable()) {
 return;
 }
 
@@ -251,59 +259,56 @@ public abstract class ConfigurationChanger implements 
DynamicConfigurationChange
 superRoot.addRoot(rootKey, rootNode);
 }
 
-//Workaround for distributed configuration.
+SuperRoot superRootNoDefaults = superRoot.copy();
+
 addDe

[ignite-3] branch main updated: IGNITE-19984 Improve "dependingOn" documentation and add clarifying tests. (#2319)

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

ibessonov 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 b2fcc49669 IGNITE-19984 Improve "dependingOn" documentation and add 
clarifying tests. (#2319)
b2fcc49669 is described below

commit b2fcc4966989535a1b33c626e09efe59ed4b8a7b
Author: Ivan Bessonov 
AuthorDate: Mon Jul 17 12:29:00 2023 +0300

IGNITE-19984 Improve "dependingOn" documentation and add clarifying tests. 
(#2319)
---
 .../causality/IncrementalVersionedValue.java   | 14 +--
 .../causality/IncrementalVersionedValueTest.java   | 49 ++
 2 files changed, 60 insertions(+), 3 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/causality/IncrementalVersionedValue.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/causality/IncrementalVersionedValue.java
index 62e823b8f4..8cdd89c3cf 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/causality/IncrementalVersionedValue.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/causality/IncrementalVersionedValue.java
@@ -63,7 +63,14 @@ public class IncrementalVersionedValue implements 
VersionedValue {
 
 /**
  * This registry chains two versioned values. The value, that uses this 
registry in the constructor, will be completed strictly after
- * the value, passed into this method.
+ * the value, passed into this method, meaning that {@code 
resultVv.get(token).isDone();} will always imply
+ * {@code vv.get(token).isDone();} for the same token value.
+ *
+ * While affecting the state of resulting futures, this dependency 
doesn't affect the order of {@link #update(long, BiFunction)}
+ * closures execution. These closures will still be called independently 
once the required parameter value is available.
+ *
+ * In the case of "fresh" VV with no updates, first closure is always 
being executed synchronously inside of the
+ * {@link #update(long, BiFunction)} call.
  */
 public static Consumer>> 
dependingOn(IncrementalVersionedValue vv) {
 return callback -> vv.whenComplete((causalityToken, value, ex) -> 
callback.apply(causalityToken));
@@ -162,8 +169,9 @@ public class IncrementalVersionedValue implements 
VersionedValue {
  * previous token, then updater is used to process the exception and 
calculate a new value. This method can be called multiple times
  * for the same token, and doesn't complete the future created for this 
token. The future is supposed to be completed by storage
  * revision update or a call of {@link #complete(long)} in this case. If 
this method has been called at least once on the given token,
- * the updater will receive a value that was evaluated by updater on 
previous call, as intermediate result. As the order of multiple
- * calls of this method on the same token is unknown, operations done by 
the updater must be commutative. For example:
+ * the updater will receive a value that was evaluated by updater on 
previous call, as intermediate result. If no update were done on
+ * the given token, the updated will immediately receive the value from 
the previous token, if it's completed.  As the order of
+ * multiple calls of this method on the same token is unknown, operations 
done by the updater must be commutative. For example:
  * 
  * this method was called for token N-1 and updater evaluated the 
value V1;
  * a storage revision update happened;
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/causality/IncrementalVersionedValueTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/causality/IncrementalVersionedValueTest.java
index 9e7a14d00c..5759e53d80 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/causality/IncrementalVersionedValueTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/causality/IncrementalVersionedValueTest.java
@@ -19,9 +19,12 @@ package org.apache.ignite.internal.causality;
 
 import static java.util.concurrent.CompletableFuture.completedFuture;
 import static java.util.concurrent.CompletableFuture.failedFuture;
+import static java.util.concurrent.CompletableFuture.supplyAsync;
+import static 
org.apache.ignite.internal.causality.IncrementalVersionedValue.dependingOn;
 import static 
org.apache.ignite.internal.testframework.IgniteTestUtils.assertThrowsWithCause;
 import static org.apache.ignite.internal.testframework.IgniteTestUtils.runRace;
 import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe;
+import static 
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcre

  1   2   3   4   5   >