(ignite) branch master updated: IGNITE-21216 Excluded tasks that are not in the Ignite package from system tasks. (#11167)
This is an automated email from the ASF dual-hosted git repository. mpetrov pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git The following commit(s) were added to refs/heads/master by this push: new a0d55347b9f IGNITE-21216 Excluded tasks that are not in the Ignite package from system tasks. (#11167) a0d55347b9f is described below commit a0d55347b9f41d0c36af50c93f0dc314e0ee031c Author: Mikhail Petrov <32207922+petrov...@users.noreply.github.com> AuthorDate: Wed Jan 10 13:59:07 2024 +0300 IGNITE-21216 Excluded tasks that are not in the Ignite package from system tasks. (#11167) --- .../internal/processors/security/IgniteSecurityAdapter.java | 9 - .../ignite/internal/processors/security/SecurityUtils.java| 11 +++ .../java/org/apache/ignite/internal/util/IgniteUtils.java | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityAdapter.java index be874b469cc..2c1984629d7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/IgniteSecurityAdapter.java @@ -26,6 +26,7 @@ import org.apache.ignite.internal.processors.GridProcessorAdapter; import org.apache.ignite.internal.util.typedef.F; import static org.apache.ignite.internal.processors.security.SecurityUtils.doPrivileged; +import static org.apache.ignite.internal.processors.security.SecurityUtils.isInIgnitePackage; /** */ public abstract class IgniteSecurityAdapter extends GridProcessorAdapter implements IgniteSecurity { @@ -47,7 +48,13 @@ public abstract class IgniteSecurityAdapter extends GridProcessorAdapter impleme c -> { ProtectionDomain pd = doPrivileged(c::getProtectionDomain); -return pd != null && F.eq(CORE_CODE_SOURCE, pd.getCodeSource()); +return pd != null +&& F.eq(CORE_CODE_SOURCE, pd.getCodeSource()) +// It allows users create an Uber-JAR that includes both Ignite source code and custom classes +// and to pass mentioned classes to Ignite via public API (e.g. tasks execution). +// Otherwise, Ignite will treat custom classes as internal and block their execution through the +// public API. +&& isInIgnitePackage(cls); } ); } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityUtils.java index 384a5153dbf..0bb26afac20 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityUtils.java @@ -58,6 +58,9 @@ import org.apache.ignite.plugin.security.SecurityPermissionSet; import org.apache.ignite.spi.IgniteSpiException; import org.apache.ignite.spi.discovery.DiscoverySpiNodeAuthenticator; +import static org.apache.ignite.internal.util.IgniteUtils.IGNITE_PKG; +import static org.apache.ignite.internal.util.IgniteUtils.packageName; + /** * Security utilities. */ @@ -245,6 +248,14 @@ public class SecurityUtils { return target instanceof GridInternalWrapper ? ((GridInternalWrapper)target).userObject() : target; } +/** + * @param cls Class instance. + * @return Whether specified class is in Ignite package. + */ +public static boolean isInIgnitePackage(Class cls) { +return packageName(cls).startsWith(IGNITE_PKG); +} + /** * @return True if current thread runs inside the Ignite Sandbox. */ diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 37ca4feabe6..695439ab1f3 100755 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -10527,7 +10527,7 @@ public abstract class IgniteUtils { * @param cls Class. * @return Package name. */ -private static String packageName(Class cls) { +public static String packageName(Class cls) { Package pkg = cls.getPackage(); return pkg == null ? "" : pkg.getName();
(ignite-3) branch main updated: IGNITE-20795: Sql. QuerySplitter does not visit IgniteTableFunctionScan nodes
This is an automated email from the ASF dual-hosted git repository. korlov pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/ignite-3.git The following commit(s) were added to refs/heads/main by this push: new cdb906c550 IGNITE-20795: Sql. QuerySplitter does not visit IgniteTableFunctionScan nodes cdb906c550 is described below commit cdb906c550838ba4637626627b461bbefded3726 Author: Max Zhuravkov AuthorDate: Wed Jan 10 13:03:41 2024 +0200 IGNITE-20795: Sql. QuerySplitter does not visit IgniteTableFunctionScan nodes --- .../sql/engine/exec/mapping/QuerySplitter.java | 7 +++ .../src/test/resources/mapping/correlated.test | 20 ++-- .../src/test/resources/mapping/table_functions.test | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/mapping/QuerySplitter.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/mapping/QuerySplitter.java index e898e1559a..3dc4100bbf 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/mapping/QuerySplitter.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/mapping/QuerySplitter.java @@ -33,6 +33,7 @@ import org.apache.ignite.internal.sql.engine.rel.IgniteReceiver; import org.apache.ignite.internal.sql.engine.rel.IgniteRel; import org.apache.ignite.internal.sql.engine.rel.IgniteSender; import org.apache.ignite.internal.sql.engine.rel.IgniteSystemViewScan; +import org.apache.ignite.internal.sql.engine.rel.IgniteTableFunctionScan; import org.apache.ignite.internal.sql.engine.rel.IgniteTableModify; import org.apache.ignite.internal.sql.engine.rel.IgniteTableScan; import org.apache.ignite.internal.sql.engine.rel.IgniteTrimExchange; @@ -195,6 +196,12 @@ public class QuerySplitter extends IgniteRelShuttle { return rel.clone(idGenerator.nextId()); } +/** {@inheritDoc} */ +@Override +public IgniteRel visit(IgniteTableFunctionScan rel) { +return rel.clone(idGenerator.nextId()); +} + /** {@inheritDoc} */ @Override public IgniteRel visit(IgniteTableModify rel) { diff --git a/modules/sql-engine/src/test/resources/mapping/correlated.test b/modules/sql-engine/src/test/resources/mapping/correlated.test index 3919943217..22383d089f 100644 --- a/modules/sql-engine/src/test/resources/mapping/correlated.test +++ b/modules/sql-engine/src/test/resources/mapping/correlated.test @@ -118,7 +118,7 @@ Fragment#0 root IgniteReceiver(sourceFragment=1, exchange=1, distribution=single) IgniteSort IgniteFilter -IgniteTableFunctionScan(source=-1, distribution=single) +IgniteTableFunctionScan(source=2, distribution=single) Fragment#1 targetNodes: [N0] @@ -127,25 +127,25 @@ Fragment#1 tree: IgniteSender(targetFragment=0, exchange=1, distribution=single) IgniteSort -IgniteTableScan(name=PUBLIC.T_N1, source=2, distribution=random) +IgniteTableScan(name=PUBLIC.T_N1, source=3, distribution=random) --- N0 SELECT t.c1 FROM ct_n1 t WHERE t.c1 < 5 AND EXISTS (SELECT x FROM table(system_range(t.c1, t.c2)) WHERE mod(x, 2) = 0) --- -Fragment#2 root +Fragment#3 root executionNodes: [N0] - remoteFragments: [3] + remoteFragments: [4] tree: -IgniteReceiver(sourceFragment=3, exchange=3, distribution=single) +IgniteReceiver(sourceFragment=4, exchange=4, distribution=single) -Fragment#3 +Fragment#4 targetNodes: [N0] executionNodes: [N1] tables: [CT_N1] tree: -IgniteSender(targetFragment=2, exchange=3, distribution=single) +IgniteSender(targetFragment=3, exchange=4, distribution=single) IgniteProject IgniteFilter IgniteCorrelatedNestedLoopJoin @@ -153,7 +153,7 @@ Fragment#3 IgniteColocatedHashAggregate IgniteProject IgniteFilter - IgniteTableFunctionScan(source=-1, distribution=single) + IgniteTableFunctionScan(source=2, distribution=single) --- N0 @@ -171,7 +171,7 @@ Fragment#0 root IgniteColocatedHashAggregate IgniteProject IgniteFilter -IgniteTableFunctionScan(source=-1, distribution=single) +IgniteTableFunctionScan(source=2, distribution=single) Fragment#1 targetNodes: [N0] @@ -179,5 +179,5 @@ Fragment#1 tables: [T_N1] tree: IgniteSender(targetFragment=0, exchange=1, distribution=single) - IgniteTableScan(name=PUBLIC.T_N1, source=2, distribution=affinity[table: T_N1, columns: [ID]]) + IgniteTableScan(name=PUBLIC.T_N1, source=3, distribution=affinity[table: T_N1, columns: [ID]]) --- diff --git a/modules/sql-engine/src/test/resources/mapping/table_functions.test b/modules/sql-engine/src/test/resources/mapping/table_functions.test index 4d85ff544
(ignite) branch master updated: IGNITE-21165 : .NET platform test timeouts (#11160)
This is an automated email from the ASF dual-hosted git repository. av pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ignite.git The following commit(s) were added to refs/heads/master by this push: new 260228b486a IGNITE-21165 : .NET platform test timeouts (#11160) 260228b486a is described below commit 260228b486a66770488658542c39c931e0f73a72 Author: Vladimir Steshin AuthorDate: Wed Jan 10 15:00:35 2024 +0300 IGNITE-21165 : .NET platform test timeouts (#11160) --- .../java/org/apache/ignite/platform/PlatformProcessUtils.java| 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformProcessUtils.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformProcessUtils.java index b5933f5ab4f..ac2d41327a7 100644 --- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformProcessUtils.java +++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformProcessUtils.java @@ -127,13 +127,20 @@ public class PlatformProcessUtils { } /** - * Kills the process previously started with {@link #startProcess}. + * Kills the process previously started with {@link #startProcess}. Waits for until the process stops. */ public static void destroyProcess() throws Exception { if (process == null) throw new Exception("Process has not been started"); +System.out.println("PlatformProcessUtils >> stopping the process..."); + process.destroyForcibly(); + +process.waitFor(); + process = null; + +System.out.println("PlatformProcessUtils >> the process has stopped."); } }
(ignite-3) branch main updated: IGNITE-20905 Make it possible to add an explicitly NULL column via ADD COLUMN
This is an automated email from the ASF dual-hosted git repository. korlov pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/ignite-3.git The following commit(s) were added to refs/heads/main by this push: new 50ad9453c8 IGNITE-20905 Make it possible to add an explicitly NULL column via ADD COLUMN 50ad9453c8 is described below commit 50ad9453c81b00147393e06e66d624a53aa46d93 Author: Max Zhuravkov AuthorDate: Wed Jan 10 14:53:52 2024 +0200 IGNITE-20905 Make it possible to add an explicitly NULL column via ADD COLUMN --- .../internal/sql/engine/ItCreateTableDdlTest.java | 14 + .../src/main/codegen/includes/parserImpls.ftl | 4 ++ .../prepare/ddl/DdlSqlToCommandConverter.java | 3 +- .../internal/sql/engine/sql/SqlDdlParserTest.java | 59 ++ 4 files changed, 79 insertions(+), 1 deletion(-) diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItCreateTableDdlTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItCreateTableDdlTest.java index 0f7ed762e5..f2548291cf 100644 --- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItCreateTableDdlTest.java +++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItCreateTableDdlTest.java @@ -199,6 +199,20 @@ public class ItCreateTableDdlTest extends BaseSqlIntegrationTest { .check(); } +/** Test that adding nullable column via ALTER TABLE ADD name type NULL works. */ +@Test +public void testNullableColumn() { +sql("CREATE TABLE my (c1 INT PRIMARY KEY, c2 INT)"); +sql("INSERT INTO my VALUES (1, 1)"); +sql("ALTER TABLE my ADD COLUMN c3 INT NULL"); +sql("INSERT INTO my VALUES (2, 2, NULL)"); + +assertQuery("SELECT * FROM my ORDER by c1 ASC") +.returns(1, 1, null) +.returns(2, 2, null) +.check(); +} + /** * Adds columns of all supported types and checks that the row * created on the old schema version is read correctly. diff --git a/modules/sql-engine/src/main/codegen/includes/parserImpls.ftl b/modules/sql-engine/src/main/codegen/includes/parserImpls.ftl index ba18c9c40b..933c8c4789 100644 --- a/modules/sql-engine/src/main/codegen/includes/parserImpls.ftl +++ b/modules/sql-engine/src/main/codegen/includes/parserImpls.ftl @@ -378,6 +378,10 @@ SqlNode ColumnWithType() : { nullable = false; } +| + { +nullable = true; +} ] ( { s.add(this); } dflt = Literal() { diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java index 8455b69071..2e226debb0 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java @@ -390,7 +390,8 @@ public class DdlSqlToCommandConverter { assert col.name.isSimple(); -RelDataType relType = ctx.planner().convert(col.dataType, true); +Boolean nullable = col.dataType.getNullable(); +RelDataType relType = ctx.planner().convert(col.dataType, nullable != null ? nullable : true); DefaultValueDefinition dflt = convertDefault(col.expression, relType); String name = col.name.getSimple(); diff --git a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java index 340d00ab43..8c07f714ab 100644 --- a/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java +++ b/modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java @@ -24,6 +24,8 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.nullValue; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNull; import java.util.List; @@ -31,6 +33,7 @@ import java.util.Objects; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; +import org.apache.calcite.schema.ColumnStrategy; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlIdentifier; import org.apache.calcite.sql.SqlKind; @@ -650,6 +653,51 @@ public class SqlDdlParserTest extends AbstractDdlParserTest {
(ignite-3) branch main updated: IGNITE-20885 Sql. Bump calcite version to 1.36 (#3014)
This is an automated email from the ASF dual-hosted git repository. zstan 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 f4fef42899 IGNITE-20885 Sql. Bump calcite version to 1.36 (#3014) f4fef42899 is described below commit f4fef428996350470489eb64cb5e31f8c6d8b805 Author: Evgeniy Stanilovskiy AuthorDate: Wed Jan 10 15:56:05 2024 +0300 IGNITE-20885 Sql. Bump calcite version to 1.36 (#3014) --- gradle/libs.versions.toml | 4 +- .../internal/sql/engine/ItDataTypesTest.java | 2 +- .../ignite/internal/sql/engine/ItDmlTest.java | 3 +- modules/sql-engine/src/main/codegen/config.fmpp| 2 - .../src/main/codegen/includes/parserImpls.ftl | 11 - .../internal/sql/engine/exec/exp/RexImpTable.java | 346 ++--- .../sql/engine/externalize/RelJsonReader.java | 11 + .../sql/engine/sql/IgniteSqlDecimalLiteral.java| 113 --- ...malLiteralTest.java => DecimalLiteralTest.java} | 86 + .../sql/engine/sql/IgniteSqlParserTest.java| 2 +- .../sql/engine/sql/SqlLiteralArchTest.java | 114 --- .../sql/engine/sql/SqlReservedWordsTest.java | 3 + 12 files changed, 191 insertions(+), 506 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 339623b50a..b6678388ed 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -54,7 +54,7 @@ hamcrest = "2.2" hamcrestOptional = "2.0.0" hamcrestPath = "1.0.1" scalecube = "2.6.15" -calcite = "1.35.0" +calcite = "1.36.0" value = "2.8.8" janino = "3.1.9" avatica = "1.23.0" @@ -76,7 +76,7 @@ openapi = "4.10.0" autoService = "1.0.1" awaitility = "4.2.0" progressBar = "0.9.4" -guava = "31.1-jre" +guava = "32.1.3-jre" jna = "5.13.0" #Tools diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java index 3161184a8f..b3517b88db 100644 --- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java +++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDataTypesTest.java @@ -304,7 +304,7 @@ public class ItDataTypesTest extends BaseSqlIntegrationTest { sql("CREATE TABLE tbl(id int PRIMARY KEY, val DECIMAL(32, 5))"); assertQuery("SELECT DECIMAL '-123.0'").returns(new BigDecimal(("-123.0"))).check(); -assertQuery("SELECT DECIMAL '10'").returns(new BigDecimal(("10"))).check(); +assertQuery("SELECT DECIMAL '10'").returns(new Integer(("10"))).check(); assertQuery("SELECT DECIMAL '10.000'").returns(new BigDecimal(("10.000"))).check(); assertQuery("SELECT DECIMAL '10.000' + DECIMAL '0.1'").returns(new BigDecimal(("10.100"))).check(); diff --git a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDmlTest.java b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDmlTest.java index 4ab9b5a5db..39cd8c2f06 100644 --- a/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDmlTest.java +++ b/modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItDmlTest.java @@ -516,7 +516,8 @@ public class ItDmlTest extends BaseSqlIntegrationTest { public void testInsertDefaultNullValue() { checkDefaultValue(defaultValueArgs() .filter(a -> !a.sqlType.endsWith("NOT NULL")) -.map(a -> new DefaultValueArg(a.sqlType, "NULL", null)) +// TODO: uncomment after https://issues.apache.org/jira/browse/IGNITE-21208 +//.map(a -> new DefaultValueArg(a.sqlType, "NULL", null)) .collect(Collectors.toList())); } diff --git a/modules/sql-engine/src/main/codegen/config.fmpp b/modules/sql-engine/src/main/codegen/config.fmpp index b0f28d861c..61f06fdd30 100644 --- a/modules/sql-engine/src/main/codegen/config.fmpp +++ b/modules/sql-engine/src/main/codegen/config.fmpp @@ -52,7 +52,6 @@ data: { "org.apache.ignite.internal.sql.engine.sql.IgniteSqlIndexType", "org.apache.ignite.internal.sql.engine.sql.IgniteSqlAlterZoneSet", "org.apache.ignite.internal.sql.engine.sql.IgniteSqlAlterZoneRenameTo", - "org.apache.ignite.internal.sql.engine.sql.IgniteSqlDecimalLiteral", "org.apache.ignite.internal.sql.engine.sql.IgniteSqlTypeNameSpec", "org.apache.ignite.internal.sql.engine.type.UuidType", ] @@ -327,7 +326,6 @@ data: { # Return type of method implementation should be "SqlNode". # Example: ParseJsonLiteral(). literalParserMethods: [ - "ParseDecimalLiteral()", ] # List of methods for parsing custom data types. diff --git a/modules/sql-engine/sr
(ignite-3) branch main updated: IGNITE-16947 Resolve message send future when message is acknowledged (#3009)
This is an automated email from the ASF dual-hosted git repository. apolovtsev 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 be6d294a60 IGNITE-16947 Resolve message send future when message is acknowledged (#3009) be6d294a60 is described below commit be6d294a6068b8900f7a3258f87d970e33cff3e9 Author: Roman Puchkovskiy AuthorDate: Wed Jan 10 18:00:35 2024 +0400 IGNITE-16947 Resolve message send future when message is acknowledged (#3009) --- .../java/org/apache/ignite/lang/ErrorGroups.java | 3 + .../ignite/internal/IgniteExceptionArchTest.java | 2 + .../ignite/network/RecipientLeftException.java}| 22 ++- .../network/netty/ItConnectionManagerTest.java | 134 ++ .../netty/OutgoingAcknowledgementSilencer.java | 102 ++ .../scalecube/ItScaleCubeNetworkMessagingTest.java | 145 ++- .../internal/network/netty/ConnectionManager.java | 156 ++--- .../netty/DefaultRecoveryDescriptorProvider.java | 19 ++- .../ignite/internal/network/netty/NettySender.java | 16 +-- .../network/recovery/DescriptorAcquiry.java| 21 ++- .../recovery/RecoveryClientHandshakeManager.java | 73 ++ .../network/recovery/RecoveryDescriptor.java | 98 +++-- .../recovery/RecoveryDescriptorProvider.java | 14 ++ .../recovery/RecoveryServerHandshakeManager.java | 80 +++ .../apache/ignite/network/OutNetworkObject.java| 15 ++ .../scalecube/ScaleCubeClusterServiceFactory.java | 50 +++ .../network/netty/RecoveryHandshakeTest.java | 4 +- .../RecoveryClientHandshakeManagerTest.java| 58 +++- .../network/recovery/RecoveryDescriptorTest.java | 47 +-- .../RecoveryServerHandshakeManagerTest.java| 41 +- .../network/DefaultMessagingServiceTest.java | 4 +- .../ignite/network/OutNetworkObjectTest.java | 55 22 files changed, 966 insertions(+), 193 deletions(-) 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 ff12c2b897..dfa3d3eca2 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 @@ -434,6 +434,9 @@ public class ErrorGroups { /** Port is in use. */ public static final int PORT_IN_USE_ERR = NETWORK_ERR_GROUP.registerErrorCode((short) 2); + +/** Recipient node has left the physical topology. */ +public static final int RECIPIENT_LEFT_ERR = NETWORK_ERR_GROUP.registerErrorCode((short) 5); } /** Node configuration error group. */ diff --git a/modules/arch-test/src/test/java/org/apache/ignite/internal/IgniteExceptionArchTest.java b/modules/arch-test/src/test/java/org/apache/ignite/internal/IgniteExceptionArchTest.java index ce095d0535..6d76efdab9 100644 --- a/modules/arch-test/src/test/java/org/apache/ignite/internal/IgniteExceptionArchTest.java +++ b/modules/arch-test/src/test/java/org/apache/ignite/internal/IgniteExceptionArchTest.java @@ -41,6 +41,7 @@ import org.apache.ignite.client.IgniteClientFeatureNotSupportedByServerException import org.apache.ignite.lang.IgniteCheckedException; import org.apache.ignite.lang.IgniteException; import org.apache.ignite.lang.LocationProvider.RootLocationProvider; +import org.apache.ignite.network.RecipientLeftException; import org.apache.ignite.network.UnresolvableConsistentIdException; import org.apache.ignite.security.exception.InvalidCredentialsException; import org.apache.ignite.security.exception.UnsupportedAuthenticationTypeException; @@ -89,6 +90,7 @@ public class IgniteExceptionArchTest { exclusions.add(NoRowSetExpectedException.class.getCanonicalName()); exclusions.add(InvalidCredentialsException.class.getCanonicalName()); exclusions.add(UnsupportedAuthenticationTypeException.class.getCanonicalName()); +exclusions.add(RecipientLeftException.class.getCanonicalName()); } private static class ExclusionPredicate extends DescribedPredicate { diff --git a/modules/network/src/main/java/org/apache/ignite/internal/network/recovery/RecoveryDescriptorProvider.java b/modules/network-api/src/main/java/org/apache/ignite/network/RecipientLeftException.java similarity index 59% copy from modules/network/src/main/java/org/apache/ignite/internal/network/recovery/RecoveryDescriptorProvider.java copy to modules/network-api/src/main/java/org/apache/ignite/network/RecipientLeftException.java index 5603e18009..cf7a3841fb 100644 --- a/modules/network/src/main/java/org/apache/ignite/internal/network/recovery/RecoveryDescriptorProvider.java +++ b/modules/network-api/src/main/java/org/apache/ignite/network/RecipientLeftException.java @@ -15,21 +15,17 @@ * limitations un
(ignite-3) branch main updated: IGNITE-21203 Sql. Fix flaky ItSqlAsynchronousApiTest.closeSession
This is an automated email from the ASF dual-hosted git repository. korlov pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/ignite-3.git The following commit(s) were added to refs/heads/main by this push: new f812debe86 IGNITE-21203 Sql. Fix flaky ItSqlAsynchronousApiTest.closeSession f812debe86 is described below commit f812debe867d16728a5aab2a96cd3cfae533765d Author: korlov42 AuthorDate: Wed Jan 10 16:15:23 2024 +0200 IGNITE-21203 Sql. Fix flaky ItSqlAsynchronousApiTest.closeSession --- .../internal/sql/api/AsyncResultSetImpl.java | 9 +-- .../ignite/internal/sql/api/SessionImpl.java | 70 +++--- .../sql/engine/exec/ExecutionServiceImpl.java | 30 +++--- .../ignite/internal/sql/api/SessionImplTest.java | 24 ++-- .../sql/engine/exec/ExecutionServiceImplTest.java | 43 - 5 files changed, 147 insertions(+), 29 deletions(-) diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java index b9bc4ee0d7..4bd0ea638f 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/AsyncResultSetImpl.java @@ -55,8 +55,6 @@ public class AsyncResultSetImpl implements AsyncResultSet { private final int pageSize; -private final Runnable closeRun; - /** * Constructor. * @@ -65,20 +63,17 @@ public class AsyncResultSetImpl implements AsyncResultSet { * @param pageSize Size of the page to fetch. * @param expirationTracker A tracker to register any interaction with given result set. * Used to prevent session from expiration. - * @param closeRun Callback to be invoked after result is closed. */ AsyncResultSetImpl( AsyncSqlCursor cursor, BatchedResult page, int pageSize, -IdleExpirationTracker expirationTracker, -Runnable closeRun +IdleExpirationTracker expirationTracker ) { this.cursor = cursor; this.curPage = page; this.pageSize = pageSize; this.expirationTracker = expirationTracker; -this.closeRun = closeRun; } /** {@inheritDoc} */ @@ -171,7 +166,7 @@ public class AsyncResultSetImpl implements AsyncResultSet { /** {@inheritDoc} */ @Override public CompletableFuture closeAsync() { -return cursor.closeAsync().thenRun(closeRun); +return cursor.closeAsync(); } private void requireResultSet() { diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java index 8be3178e8c..069524d8b5 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/api/SessionImpl.java @@ -79,6 +79,7 @@ public class SessionImpl implements AbstractSession { private final IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock(); private final AtomicBoolean closed = new AtomicBoolean(false); +private final CompletableFuture closedFut = new CompletableFuture<>(); private final AtomicInteger cursorIdGen = new AtomicInteger(); @@ -227,14 +228,15 @@ public class SessionImpl implements AbstractSession { try { int cursorId = registerCursor(cur); +cur.onClose().whenComplete((r, e) -> openedCursors.remove(cursorId)); + return cur.requestNextAsync(pageSize) .thenApply( batchRes -> new AsyncResultSetImpl<>( cur, batchRes, pageSize, -expirationTracker, -() -> openedCursors.remove(cursorId) +expirationTracker ) ); } finally { @@ -463,9 +465,12 @@ public class SessionImpl implements AbstractSession { @Override public CompletableFuture closeAsync() { try { -closeInternal(); +return closeInternal() +.exceptionally(e -> { +sneakyThrow(mapToPublicSqlException(e)); -return nullCompletedFuture(); +return null; +}); } catch (Exception e) { r
(ignite-3) branch main updated: IGNITE-20850 Add compute job failover (#2990)
This is an automated email from the ASF dual-hosted git repository. apkhmv pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/ignite-3.git The following commit(s) were added to refs/heads/main by this push: new 2142bcdcb4 IGNITE-20850 Add compute job failover (#2990) 2142bcdcb4 is described below commit 2142bcdcb4a9af857942ddc16f12f8a83d6ebe55 Author: Aleksandr Pakhomov AuthorDate: Wed Jan 10 17:57:01 2024 +0300 IGNITE-20850 Add compute job failover (#2990) * ComputeJobFailover wraps the returned by IgniteComputeImpl Future. Failover captures the context of the job: workerNode, deployment units, jobClassName, etc. * ComputeJobFailover listens topology events and if the worker node has left the topology, the job will be restarted on one of the failover nodes. The future returned by IgniteComputeImpl will be completed/cancelled when the restarted job is completed/cancelled. - Co-authored-by: Vadim Pakhnushev <8614891+valep...@users.noreply.github.com> --- .../java/org/apache/ignite/lang/ErrorGroups.java | 6 + modules/compute/build.gradle | 1 + ...aseEmbedded.java => ItComputeTestEmbedded.java} | 2 +- .../internal/compute/ItWorkerShutdownTest.java | 562 + .../internal/compute/ComputeJobFailover.java | 159 ++ .../internal/compute/FailSafeJobExecution.java | 175 +++ .../ignite/internal/compute/IgniteComputeImpl.java | 42 +- .../internal/compute/NodeLeftEventsSource.java | 54 ++ .../internal/compute/RemoteExecutionContext.java | 94 9 files changed, 1089 insertions(+), 6 deletions(-) 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 dfa3d3eca2..108ccb25b1 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 @@ -530,6 +530,12 @@ public class ErrorGroups { /** Compute job result not found error. */ public static final int RESULT_NOT_FOUND_ERR = COMPUTE_ERR_GROUP.registerErrorCode((short) 7); + +/** Compute job status can not be retrieved. */ +public static final int FAIL_TO_GET_JOB_STATUS_ERR = COMPUTE_ERR_GROUP.registerErrorCode((short) 8); + +/** Compute job failed. */ +public static final int COMPUTE_JOB_FAILED_ERR = COMPUTE_ERR_GROUP.registerErrorCode((short) 9); } /** Catalog error group. */ diff --git a/modules/compute/build.gradle b/modules/compute/build.gradle index 2802b64a07..f2c14fec74 100644 --- a/modules/compute/build.gradle +++ b/modules/compute/build.gradle @@ -50,6 +50,7 @@ dependencies { integrationTestImplementation project(':ignite-code-deployment') integrationTestImplementation project(':ignite-network') integrationTestImplementation project(':ignite-cluster-management') +integrationTestImplementation project(':ignite-table') integrationTestImplementation testFixtures(project(':ignite-core')) integrationTestImplementation testFixtures(project(':ignite-runner')) } diff --git a/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeTestBaseEmbedded.java b/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeTestEmbedded.java similarity index 99% rename from modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeTestBaseEmbedded.java rename to modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeTestEmbedded.java index 4123d9e16f..ee81c077bd 100644 --- a/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeTestBaseEmbedded.java +++ b/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeTestEmbedded.java @@ -52,7 +52,7 @@ import org.junit.jupiter.params.provider.MethodSource; * Integration tests for Compute functionality in embedded Ignite mode. */ @SuppressWarnings("resource") -class ItComputeTestBaseEmbedded extends ItComputeBaseTest { +class ItComputeTestEmbedded extends ItComputeBaseTest { @Override protected List units() { return List.of(); diff --git a/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItWorkerShutdownTest.java b/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItWorkerShutdownTest.java new file mode 100644 index 00..2dcac4163c --- /dev/null +++ b/modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItWorkerShutdownTest.java @@ -0,0 +1,562 @@ +/* + * 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 licen
(ignite-3) branch main updated: IGNITE-19944 ODBC 3.0: Propagate SQL errors from engine to driver (#3022)
This is an automated email from the ASF dual-hosted git repository. isapego 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 07e8a6b384 IGNITE-19944 ODBC 3.0: Propagate SQL errors from engine to driver (#3022) 07e8a6b384 is described below commit 07e8a6b384cc3c563255128fb36528a80756ab89 Author: Dmitriy Zabotlin AuthorDate: Wed Jan 10 17:42:01 2024 +0200 IGNITE-19944 ODBC 3.0: Propagate SQL errors from engine to driver (#3022) Co-authored-by: dzabotlin --- modules/api/build.gradle | 7 + .../java/org/apache/ignite/lang/ErrorGroups.java | 19 + .../build.gradle | 17 +- .../error/code/annotations/ErrorCodeGroup.java}| 31 +- .../code/generators/AbstractCodeGenerator.java}| 25 +- .../error/code/generators/CppGenerator.java| 128 + .../error/code/generators/CsharpGenerator.java | 107 + .../error/code/generators/GenericGenerator.java| 92 .../code/processor/ErrorCodeGroupDescriptor.java} | 40 +- .../code/processor/ErrorCodeGroupProcessor.java| 192 .../ErrorCodeGroupProcessorException.java} | 39 +- .../ignite/client/detail/cluster_connection.cpp| 2 +- modules/platforms/cpp/ignite/common/CMakeLists.txt | 1 + .../platforms/cpp/ignite/common/big_integer.cpp| 2 +- modules/platforms/cpp/ignite/common/error_codes.h | 198 modules/platforms/cpp/ignite/common/ignite_error.h | 32 +- .../platforms/cpp/ignite/common/ignite_result.h| 4 +- .../network/detail/linux/linux_async_client.cpp| 5 +- .../network/detail/linux/linux_async_client.h | 4 +- .../detail/linux/linux_async_client_pool.cpp | 8 +- .../detail/linux/linux_async_worker_thread.cpp | 6 +- .../network/detail/linux/tcp_socket_client.h | 6 +- .../platforms/cpp/ignite/network/detail/utils.h| 2 +- .../cpp/ignite/network/error_handling_filter.cpp | 4 +- modules/platforms/cpp/ignite/odbc/common_types.cpp | 180 +++ modules/platforms/cpp/ignite/odbc/common_types.h | 9 + .../cpp/ignite/odbc/diagnostic/diagnosable.h | 2 +- .../platforms/cpp/ignite/odbc/sql_connection.cpp | 2 +- .../platforms/cpp/ignite/odbc/sql_statement.cpp| 2 +- modules/platforms/cpp/ignite/protocol/utils.cpp| 4 +- .../platforms/cpp/tests/client-test/sql_test.cpp | 9 +- .../platforms/cpp/tests/odbc-test/error_test.cpp | 19 +- .../cpp/tests/odbc-test/transaction_test.cpp | 6 +- .../ErrorGroupsGenerator.cs| 148 -- .../platforms/dotnet/Apache.Ignite/ErrorCodes.g.cs | 531 + settings.gradle| 2 + 36 files changed, 1592 insertions(+), 293 deletions(-) diff --git a/modules/api/build.gradle b/modules/api/build.gradle index bb3ff39da3..63face865d 100644 --- a/modules/api/build.gradle +++ b/modules/api/build.gradle @@ -22,6 +22,9 @@ apply from: "$rootDir/buildscripts/java-test-fixtures.gradle" dependencies { +annotationProcessor project(':ignite-error-code-annotation-processor') + +implementation project(':ignite-error-code-annotation-processor') implementation libs.fastutil.core implementation libs.jetbrains.annotations @@ -34,4 +37,8 @@ dependencies { testFixturesImplementation libs.jetbrains.annotations } +compileJava { +options.headerOutputDirectory = file("${projectDir}/../platforms/") +} + description = 'ignite-api' 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 108ccb25b1..a9a1e36e4a 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 @@ -20,6 +20,7 @@ package org.apache.ignite.lang; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import java.util.Locale; +import org.apache.ignite.error.code.annotations.ErrorCodeGroup; /** * Defines error groups and its errors. @@ -112,6 +113,7 @@ public class ErrorGroups { } /** Common error group. */ +@ErrorCodeGroup public static class Common { /** Common error group. */ public static final ErrorGroup COMMON_ERR_GROUP = registerGroup("CMN", (short) 1); @@ -139,6 +141,7 @@ public class ErrorGroups { } /** Tables error group. */ +@ErrorCodeGroup public static class Table { /** Table error group. */ public static final ErrorGroup TABLE_ERR_GROUP = registerGroup("TBL", (short) 2); @@ -166,6 +169,7 @@ public class ErrorGroups { } /** Client error group. */ +@ErrorCodeGroup public static class Client { /** Client error group. */ public static final ErrorGro
(ignite-3) branch main updated: IGNITE-20879 Additional criterions for queries (#2933)
This is an automated email from the ASF dual-hosted git repository. anovikov 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 1263f6b92e IGNITE-20879 Additional criterions for queries (#2933) 1263f6b92e is described below commit 1263f6b92ed18b05d885961edd615e00a39929cc Author: Andrey Novikov AuthorDate: Wed Jan 10 22:47:26 2024 +0700 IGNITE-20879 Additional criterions for queries (#2933) --- .../table/criteria/{Criteria.java => Column.java} | 34 +- .../criteria/{Criteria.java => Condition.java} | 39 ++- .../org/apache/ignite/table/criteria/Criteria.java | 367 - .../ignite/table/criteria/CriteriaVisitor.java | 59 .../apache/ignite/table/criteria/Expression.java | 66 .../criteria/{Criteria.java => Operator.java} | 26 +- .../criteria/{Criteria.java => Parameter.java} | 34 +- .../internal/client/table/AbstractClientView.java | 78 + .../client/table/ClientRecordBinaryView.java | 32 +- .../internal/client/table/ClientRecordView.java| 32 +- .../internal/table/criteria/ColumnValidator.java | 64 .../internal/table/criteria/SqlSerializer.java | 240 ++ .../internal/ClusterPerClassIntegrationTest.java | 27 +- .../ignite/internal/table/ItCriteriaQueryTest.java | 230 ++--- .../ignite/internal/table/AbstractTableView.java | 19 ++ .../internal/table/RecordBinaryViewImpl.java | 17 +- .../ignite/internal/table/RecordViewImpl.java | 16 +- .../internal/table/criteria/SqlSerializerTest.java | 208 18 files changed, 1460 insertions(+), 128 deletions(-) diff --git a/modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java b/modules/api/src/main/java/org/apache/ignite/table/criteria/Column.java similarity index 55% copy from modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java copy to modules/api/src/main/java/org/apache/ignite/table/criteria/Column.java index 1734c30157..21c60daee3 100644 --- a/modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java +++ b/modules/api/src/main/java/org/apache/ignite/table/criteria/Column.java @@ -17,9 +17,37 @@ package org.apache.ignite.table.criteria; +import static org.apache.ignite.lang.util.IgniteNameUtils.parseSimpleName; + +import org.jetbrains.annotations.Nullable; + /** - * Represents a criteria query predicate. + * Represents a column reference for criteria query. */ -public interface Criteria { -// No-op. +public final class Column implements Criteria { +private final String name; + +/** + * Constructor. + * + * @param name A column name. + */ +Column(String name) { +this.name = parseSimpleName(name); +} + +/** + * Gets column name. + * + * @return A column name. + */ +public String getName() { +return name; +} + +/** {@inheritDoc} */ +@Override +public void accept(CriteriaVisitor v, @Nullable C context) { +v.visit(this, context); +} } diff --git a/modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java b/modules/api/src/main/java/org/apache/ignite/table/criteria/Condition.java similarity index 52% copy from modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java copy to modules/api/src/main/java/org/apache/ignite/table/criteria/Condition.java index 1734c30157..2bae02c9a8 100644 --- a/modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java +++ b/modules/api/src/main/java/org/apache/ignite/table/criteria/Condition.java @@ -18,8 +18,41 @@ package org.apache.ignite.table.criteria; /** - * Represents a criteria query predicate. + * Represents an condition with operator and elements for criteria query. + * + * @see Criteria */ -public interface Criteria { -// No-op. +public final class Condition { +private final Operator operator; + +private final Criteria[] elements; + +/** + * Constructor. + * + * @param operator Condition operator. + * @param elements Condition elements. + */ +Condition(Operator operator, Criteria... elements) { +this.operator = operator; +this.elements = elements; +} + +/** + * Get a condition operator. + * + * @return A condition operator. + */ +public Operator getOperator() { +return operator; +} + +/** + * Get a condition elements. + * + * @return A condition elements. + */ +public Criteria[] getElements() { +return elements; +} } diff --git a/modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java b/modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java index 1734c30157..1533fa908c 100644 --- a/modules/api/src/main/java/org/apache/ignite/table/criteria/Criteria.java +++ b/modules/api/src/ma