You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "nizhikov (via GitHub)" <gi...@apache.org> on 2026/05/19 08:19:58 UTC
[PR] IGNITE-28657 Service local start order [ignite]
nizhikov opened a new pull request, #13150:
URL: https://github.com/apache/ignite/pull/13150
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see tab `PR Check` at [TC.Bot - Instance 1](https://tcbot2.sbt-ignite-dev.ru/prs.html) or [TC.Bot - Instance 2](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-28657 Service local start order [ignite]
Posted by "NSAmelchev (via GitHub)" <gi...@apache.org>.
NSAmelchev commented on code in PR #13150:
URL: https://github.com/apache/ignite/pull/13150#discussion_r3265177535
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceLocalStartOrderTest.java:
##########
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.service;
+
+import java.util.Arrays;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.services.Service;
+import org.apache.ignite.services.ServiceConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+/** */
+public class ServiceLocalStartOrderTest extends GridCommonAbstractTest {
+ /** */
+ private final int gridCnt = 3;
+
+ /** */
+ private boolean staticConfig;
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ if (staticConfig)
+ cfg.setServiceConfiguration(serviceConfigs());
+
+ return cfg;
+ }
+
+ /** */
+ @Test
+ public void testStaticConfigDeployment() throws Exception {
+ staticConfig = true;
+
+ startGrids(gridCnt);
+
+ check();
+ }
+
+ /** */
+ @Test
+ public void testRuntimeDeployment() throws Exception {
+ IgniteEx ignite = startGrids(gridCnt);
+
+ doTest(ignite);
+ }
+
+ /** */
+ @Test
+ public void testRuntimeDeploymentFromClient() throws Exception {
+ startGrids(gridCnt);
+
+ doTest(startClientGrid());
+ }
+
+ /** */
+ private void doTest(IgniteEx deployFrom) {
+ deployFrom.services().deployAll(Arrays.asList(serviceConfigs()));
+
+ check();
+ }
+
+ /** */
+ private void check() {
+ for (int i = 0; i < 5; i++) {
+ for (int node = 0; node < gridCnt; node++)
+ assertNotNull(grid(node).services().service(name(i)));
+ }
+ }
+
+ /** */
+ private ServiceConfiguration[] serviceConfigs() {
+ ServiceConfiguration[] cfgs = new ServiceConfiguration[5];
+
+ for (int i = 0; i < 5; i++) {
+ cfgs[i] = new ServiceConfiguration()
+ .setName(name(i))
+ .setService(new OrderedServiceImpl(i))
+ .setLocalStartOrder(i)
+ .setMaxPerNodeCount(1)
+ .setTotalCount(gridCnt);
+ }
+
+ return cfgs;
+ }
+
+ /** */
+ public static class OrderedServiceImpl implements OrderedService {
+ /** */
+ private final int order;
+
+ /** */
+ private boolean started;
+
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** */
+ public OrderedServiceImpl(int order) {
+ this.order = order;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void init() throws Exception {
+ for (int i = order - 1; i >= 0; i--) {
+ OrderedService srvs = ignite.services().service(name(i));
+
+ assertNotNull("Must be deployed previously: " + i, srvs);
+ assertTrue(srvs.started());
+ }
+
+ started = true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean started() {
+ return started;
+ }
+ }
+
+ /** */
+ public interface OrderedService extends Service {
+ /** */
+ boolean started();
+ }
+
+ /** */
+ public static String name(int i) {
Review Comment:
Can be `private`
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceLocalStartOrderTest.java:
##########
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.service;
+
+import java.util.Arrays;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.services.Service;
+import org.apache.ignite.services.ServiceConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+/** */
+public class ServiceLocalStartOrderTest extends GridCommonAbstractTest {
+ /** */
+ private final int gridCnt = 3;
+
+ /** */
+ private boolean staticConfig;
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ if (staticConfig)
+ cfg.setServiceConfiguration(serviceConfigs());
+
+ return cfg;
+ }
+
+ /** */
+ @Test
+ public void testStaticConfigDeployment() throws Exception {
+ staticConfig = true;
+
+ startGrids(gridCnt);
+
+ check();
+ }
+
+ /** */
+ @Test
+ public void testRuntimeDeployment() throws Exception {
+ IgniteEx ignite = startGrids(gridCnt);
+
+ doTest(ignite);
+ }
+
+ /** */
+ @Test
+ public void testRuntimeDeploymentFromClient() throws Exception {
+ startGrids(gridCnt);
+
+ doTest(startClientGrid());
+ }
+
+ /** */
+ private void doTest(IgniteEx deployFrom) {
+ deployFrom.services().deployAll(Arrays.asList(serviceConfigs()));
+
+ check();
+ }
+
+ /** */
+ private void check() {
+ for (int i = 0; i < 5; i++) {
+ for (int node = 0; node < gridCnt; node++)
+ assertNotNull(grid(node).services().service(name(i)));
+ }
+ }
+
+ /** */
+ private ServiceConfiguration[] serviceConfigs() {
+ ServiceConfiguration[] cfgs = new ServiceConfiguration[5];
+
+ for (int i = 0; i < 5; i++) {
+ cfgs[i] = new ServiceConfiguration()
+ .setName(name(i))
+ .setService(new OrderedServiceImpl(i))
+ .setLocalStartOrder(i)
+ .setMaxPerNodeCount(1)
+ .setTotalCount(gridCnt);
+ }
+
+ return cfgs;
+ }
+
+ /** */
+ public static class OrderedServiceImpl implements OrderedService {
+ /** */
+ private final int order;
+
+ /** */
+ private boolean started;
+
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** */
+ public OrderedServiceImpl(int order) {
+ this.order = order;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void init() throws Exception {
+ for (int i = order - 1; i >= 0; i--) {
+ OrderedService srvs = ignite.services().service(name(i));
+
+ assertNotNull("Must be deployed previously: " + i, srvs);
+ assertTrue(srvs.started());
+ }
+
+ started = true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean started() {
+ return started;
+ }
+ }
+
+ /** */
+ public interface OrderedService extends Service {
Review Comment:
Can be `private`
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceLocalStartOrderTest.java:
##########
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.service;
+
+import java.util.Arrays;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.services.Service;
+import org.apache.ignite.services.ServiceConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+/** */
+public class ServiceLocalStartOrderTest extends GridCommonAbstractTest {
+ /** */
+ private final int gridCnt = 3;
+
+ /** */
+ private boolean staticConfig;
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ if (staticConfig)
+ cfg.setServiceConfiguration(serviceConfigs());
+
+ return cfg;
+ }
+
+ /** */
+ @Test
+ public void testStaticConfigDeployment() throws Exception {
+ staticConfig = true;
+
+ startGrids(gridCnt);
+
+ check();
+ }
+
+ /** */
+ @Test
+ public void testRuntimeDeployment() throws Exception {
+ IgniteEx ignite = startGrids(gridCnt);
+
+ doTest(ignite);
+ }
+
+ /** */
+ @Test
+ public void testRuntimeDeploymentFromClient() throws Exception {
+ startGrids(gridCnt);
+
+ doTest(startClientGrid());
+ }
+
+ /** */
+ private void doTest(IgniteEx deployFrom) {
+ deployFrom.services().deployAll(Arrays.asList(serviceConfigs()));
+
+ check();
+ }
+
+ /** */
+ private void check() {
+ for (int i = 0; i < 5; i++) {
+ for (int node = 0; node < gridCnt; node++)
+ assertNotNull(grid(node).services().service(name(i)));
+ }
+ }
+
+ /** */
+ private ServiceConfiguration[] serviceConfigs() {
+ ServiceConfiguration[] cfgs = new ServiceConfiguration[5];
+
+ for (int i = 0; i < 5; i++) {
+ cfgs[i] = new ServiceConfiguration()
+ .setName(name(i))
+ .setService(new OrderedServiceImpl(i))
+ .setLocalStartOrder(i)
+ .setMaxPerNodeCount(1)
+ .setTotalCount(gridCnt);
+ }
+
+ return cfgs;
+ }
+
+ /** */
+ public static class OrderedServiceImpl implements OrderedService {
Review Comment:
Can be `private`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-28657 Service local start order [ignite]
Posted by "NSAmelchev (via GitHub)" <gi...@apache.org>.
NSAmelchev commented on code in PR #13150:
URL: https://github.com/apache/ignite/pull/13150#discussion_r3265344673
##########
modules/core/src/main/java/org/apache/ignite/IgniteServices.java:
##########
@@ -444,11 +444,14 @@ public void deployMultiple(String name, Service svc, int totalCnt, int maxPerNod
* of failed services will be thrown. It is guaranteed that all services that were provided to this method and are
* not present in the list of failed services are successfully deployed by the moment of the exception being thrown.
* Note that if exception is thrown, then partial deployment may have occurred.
+ * Note, start order guarantees not provided, by default.
+ * Node local start order can be forced. with the {@link ServiceConfiguration#setLocalStartOrder(int)}.
Review Comment:
```suggestion
* Node local start order can be forced with the {@link ServiceConfiguration#setLocalStartOrder(int)}.
```
##########
modules/core/src/main/java/org/apache/ignite/IgniteServices.java:
##########
@@ -463,11 +466,14 @@ public void deployMultiple(String name, Service svc, int totalCnt, int maxPerNod
* guaranteed that all services, that were provided to this method and are not present in the list of failed
* services, are successfully deployed by the moment of the exception being thrown. Note that if exception is
* thrown, then partial deployment may have occurred.
+ * Note, start order guarantees not provided, by default.
+ * Node local start order can be forced. with the {@link ServiceConfiguration#setLocalStartOrder(int)}.
Review Comment:
```suggestion
* Node local start order can be forced with the {@link ServiceConfiguration#setLocalStartOrder(int)}.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-28657 Service local start order [ignite]
Posted by "ignitetcbot (via GitHub)" <gi...@apache.org>.
ignitetcbot commented on PR #13150:
URL: https://github.com/apache/ignite/pull/13150#issuecomment-4486853611
<!-- tcbot-analysis-comment chainBuildId=9078691 rerunBuildIds=none -->
### TCBot Test Analysis
* TeamCity: [--> Run :: All Results](https://ci2.ignite.apache.org/viewLog.html?buildId=9078691&buildTypeId=IgniteTests24Java8_RunAll)
* Branch: `pull/13150/head`
* Base: `master`
* Tested commit: [2e76684](https://github.com/apache/ignite/pull/13150/commits/2e7668492a892676356ccc2264f71afe5a54552f)
#### Possible Blockers (3)
* [Disk Page Compressions 1](https://ci2.ignite.apache.org/viewLog.html?buildId=9078662): 1 tests
* `IgnitePdsCompressionTestSuite`: `IgniteClusterSnapshotSelfTest.testClusterSnapshotCoordinatorStopped[encryption=false, onlyPrimay=true]` - Test has low fail rate in base branch 0,0% and is not flaky
* [Disk Page Compressions 3](https://ci2.ignite.apache.org/viewLog.html?buildId=9078682): 1 tests
* `IgnitePdsCompressionTestSuite3`: `DistributedMetaStoragePersistentTest.testClientReconnect` - Test has low fail rate in base branch 0,0% and is not flaky
* [Service Grid](https://ci2.ignite.apache.org/viewLog.html?buildId=9078644): 1 tests
* `IgniteServiceGridTestSuite`: `ServiceLocalStartOrderTest.testStaticConfigDeployment` - History for base branch is absent.
#### New Tests (4)
* [Service Grid](https://ci2.ignite.apache.org/viewLog.html?buildId=9078644): 3 tests
* `IgniteServiceGridTestSuite`: `ServiceLocalStartOrderTest.testStaticConfigDeployment` - FAILED
* `IgniteServiceGridTestSuite`: `ServiceLocalStartOrderTest.testRuntimeDeploymentFromClient` - PASSED
* `IgniteServiceGridTestSuite`: `ServiceLocalStartOrderTest.testRuntimeDeployment` - PASSED
* [Cache 13](https://ci2.ignite.apache.org/viewLog.html?buildId=9078573): 1 tests
* `IgniteCacheTestSuite13`: `SystemViewCacheExpiryPolicyTest.testCacheViewExpiryPolicy[factory=javax.cache.configuration.FactoryBuilder$SingletonFactory@7e61e25c, actual=SingletonFactory [expiryPlc=EternalExpiryPolicy [create=ETERNAL]]]` - PASSED
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-28657 Service local start order [ignite]
Posted by "ignitetcbot (via GitHub)" <gi...@apache.org>.
ignitetcbot commented on PR #13150:
URL: https://github.com/apache/ignite/pull/13150#issuecomment-4488486887
<!-- tcbot-analysis-comment chainBuildId=9078691 rerunBuildIds=none -->
### TCBot Test Analysis
* TeamCity: [--> Run :: All Results](https://ci2.ignite.apache.org/viewLog.html?buildId=9078691&buildTypeId=IgniteTests24Java8_RunAll)
* Branch: `pull/13150/head`
* Base: `master`
* Tested commit: [2e76684](https://github.com/apache/ignite/pull/13150/commits/2e7668492a892676356ccc2264f71afe5a54552f)
#### Possible Blockers (0)
No blockers found.
#### New Tests (4)
* [Service Grid](https://ci2.ignite.apache.org/viewLog.html?buildId=9079036): 3 tests
* `IgniteServiceGridTestSuite`: `ServiceLocalStartOrderTest.testStaticConfigDeployment` - PASSED
* `IgniteServiceGridTestSuite`: `ServiceLocalStartOrderTest.testRuntimeDeploymentFromClient` - PASSED
* `IgniteServiceGridTestSuite`: `ServiceLocalStartOrderTest.testRuntimeDeployment` - PASSED
* [Cache 13](https://ci2.ignite.apache.org/viewLog.html?buildId=9078573): 1 tests
* `IgniteCacheTestSuite13`: `SystemViewCacheExpiryPolicyTest.testCacheViewExpiryPolicy[factory=javax.cache.configuration.FactoryBuilder$SingletonFactory@7e61e25c, actual=SingletonFactory [expiryPlc=EternalExpiryPolicy [create=ETERNAL]]]` - PASSED
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-28657 Service local start order [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov merged PR #13150:
URL: https://github.com/apache/ignite/pull/13150
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-28657 Service local start order [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #13150:
URL: https://github.com/apache/ignite/pull/13150#issuecomment-4486074733
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=13150) **Quality Gate failed**
Failed conditions
 [2 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=13150) (required ≤ 1)
<!-- sqra:qg_revision=5ab9100c5c415d3983c5ae70d21b8b66572276bda36d5afb5d6455598d33875c -->
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=13150)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org