You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/02/17 16:22:56 UTC

[GitHub] [ignite-3] alievmirza opened a new pull request #674: IGNITE-16010 move setBaseline to cluster configuration

alievmirza opened a new pull request #674:
URL: https://github.com/apache/ignite-3/pull/674


   https://issues.apache.org/jira/browse/IGNITE-16010


-- 
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



[GitHub] [ignite-3] alievmirza commented on a change in pull request #674: IGNITE-16010 move setBaseline to cluster configuration

Posted by GitBox <gi...@apache.org>.
alievmirza commented on a change in pull request #674:
URL: https://github.com/apache/ignite-3/pull/674#discussion_r822723228



##########
File path: modules/baseline/src/main/java/org/apache/ignite/internal/baseline/BaselineManager.java
##########
@@ -31,32 +38,29 @@
 // TODO: https://issues.apache.org/jira/browse/IGNITE-14716 Adapt concept of baseline topology IEP-4.
 @SuppressWarnings({"FieldCanBeLocal", "unused"})
 public class BaselineManager implements IgniteComponent {
-    /** Configuration manager in order to handle and listen baseline specific configuration. */
-    private final ConfigurationManager configurationMgr;
-
-    /**
-     * MetaStorage manager in order to watch private distributed baseline specific configuration, cause ConfigurationManger handles only
-     * public configuration.
-     */
-    private final MetaStorageManager metastorageMgr;
+    /** Cluster configuration in order to handle and listen baseline specific configuration. */
+    private final ClusterConfiguration clusterConfiguration;
 
     /** Cluster network service in order to retrieve information about current cluster nodes. */
     private final ClusterService clusterSvc;
 
+    /** Busy lock to stop synchronously. */
+    private final IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock();
+
+    /** Prevents double stopping the component. */
+    AtomicBoolean stopGuard = new AtomicBoolean();

Review comment:
       it is possible, that for some tests we can stop some components manually, so it is better to have this guard to prevent repeated stops.  




-- 
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



[GitHub] [ignite-3] alievmirza commented on a change in pull request #674: IGNITE-16010 move setBaseline to cluster configuration

Posted by GitBox <gi...@apache.org>.
alievmirza commented on a change in pull request #674:
URL: https://github.com/apache/ignite-3/pull/674#discussion_r822727856



##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {
+                // TODO: Multi invoke supposed to be here https://issues.apache.org/jira/browse/IGNITE-16063

Review comment:
       This is out of scope of the current task and will be implemented in the https://issues.apache.org/jira/browse/IGNITE-16063




-- 
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



[GitHub] [ignite-3] sk0x50 commented on a change in pull request #674: IGNITE-16010 move setBaseline to cluster configuration

Posted by GitBox <gi...@apache.org>.
sk0x50 commented on a change in pull request #674:
URL: https://github.com/apache/ignite-3/pull/674#discussion_r823593390



##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {
+                // TODO: Multi invoke supposed to be here https://issues.apache.org/jira/browse/IGNITE-16063
+                metaStorageMgr.put(new ByteArray("some key"), new byte[0]);

Review comment:
       > I could change it, if we decide to merge it not only to the feature branch, but to the main also
   In any case, the name of a property should be meaningful. IMHO, `some key` is not good enough for the feature branch as well.

##########
File path: modules/baseline/src/main/java/org/apache/ignite/internal/baseline/BaselineManager.java
##########
@@ -31,32 +38,29 @@
 // TODO: https://issues.apache.org/jira/browse/IGNITE-14716 Adapt concept of baseline topology IEP-4.
 @SuppressWarnings({"FieldCanBeLocal", "unused"})
 public class BaselineManager implements IgniteComponent {
-    /** Configuration manager in order to handle and listen baseline specific configuration. */
-    private final ConfigurationManager configurationMgr;
-
-    /**
-     * MetaStorage manager in order to watch private distributed baseline specific configuration, cause ConfigurationManger handles only
-     * public configuration.
-     */
-    private final MetaStorageManager metastorageMgr;
+    /** Cluster configuration in order to handle and listen baseline specific configuration. */
+    private final ClusterConfiguration clusterConfiguration;
 
     /** Cluster network service in order to retrieve information about current cluster nodes. */
     private final ClusterService clusterSvc;
 
+    /** Busy lock to stop synchronously. */
+    private final IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock();
+
+    /** Prevents double stopping the component. */
+    AtomicBoolean stopGuard = new AtomicBoolean();

Review comment:
       I dont think, that is a good idea to tune concrete implementation for test purposes. In my understanding, this should be properly handled by test itself. Perhaps, we need to introduce something like `IgniteComponentAdapter` that should take care of starting/stopping a component multiple times.




-- 
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



[GitHub] [ignite-3] sk0x50 commented on a change in pull request #674: IGNITE-16010 move setBaseline to cluster configuration

Posted by GitBox <gi...@apache.org>.
sk0x50 commented on a change in pull request #674:
URL: https://github.com/apache/ignite-3/pull/674#discussion_r814817344



##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {

Review comment:
       This registration of the given listener looks weird to me. It seems that this can be done in `BaselineManager.start()`. What do you think?

##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {
+                // TODO: Multi invoke supposed to be here https://issues.apache.org/jira/browse/IGNITE-16063
+                metaStorageMgr.put(new ByteArray("some key"), new byte[0]);

Review comment:
       It would be nice to change the name of the key even though it is a "temporary" name. Perhaps, "baseline.nodes".

##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {
+                // TODO: Multi invoke supposed to be here https://issues.apache.org/jira/browse/IGNITE-16063

Review comment:
       Multi invoke is already implemented and can be used.

##########
File path: modules/baseline/src/main/java/org/apache/ignite/internal/baseline/BaselineManager.java
##########
@@ -31,32 +38,29 @@
 // TODO: https://issues.apache.org/jira/browse/IGNITE-14716 Adapt concept of baseline topology IEP-4.
 @SuppressWarnings({"FieldCanBeLocal", "unused"})
 public class BaselineManager implements IgniteComponent {
-    /** Configuration manager in order to handle and listen baseline specific configuration. */
-    private final ConfigurationManager configurationMgr;
-
-    /**
-     * MetaStorage manager in order to watch private distributed baseline specific configuration, cause ConfigurationManger handles only
-     * public configuration.
-     */
-    private final MetaStorageManager metastorageMgr;
+    /** Cluster configuration in order to handle and listen baseline specific configuration. */
+    private final ClusterConfiguration clusterConfiguration;
 
     /** Cluster network service in order to retrieve information about current cluster nodes. */
     private final ClusterService clusterSvc;
 
+    /** Busy lock to stop synchronously. */
+    private final IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock();
+
+    /** Prevents double stopping the component. */
+    AtomicBoolean stopGuard = new AtomicBoolean();

Review comment:
       IMHO, I don't think, that this flag is needed.




-- 
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



[GitHub] [ignite-3] sk0x50 commented on a change in pull request #674: IGNITE-16010 move setBaseline to cluster configuration

Posted by GitBox <gi...@apache.org>.
sk0x50 commented on a change in pull request #674:
URL: https://github.com/apache/ignite-3/pull/674#discussion_r823594701



##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {

Review comment:
       Please add a comment here in order to be sure that this code will improved in the future. 




-- 
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



[GitHub] [ignite-3] alievmirza commented on a change in pull request #674: IGNITE-16010 move setBaseline to cluster configuration

Posted by GitBox <gi...@apache.org>.
alievmirza commented on a change in pull request #674:
URL: https://github.com/apache/ignite-3/pull/674#discussion_r822729226



##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {
+                // TODO: Multi invoke supposed to be here https://issues.apache.org/jira/browse/IGNITE-16063
+                metaStorageMgr.put(new ByteArray("some key"), new byte[0]);

Review comment:
       I could change it, if we decide to merge it not only to the feature branch, but to the main also




-- 
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



[GitHub] [ignite-3] alievmirza commented on a change in pull request #674: IGNITE-16010 move setBaseline to cluster configuration

Posted by GitBox <gi...@apache.org>.
alievmirza commented on a change in pull request #674:
URL: https://github.com/apache/ignite-3/pull/674#discussion_r822726836



##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {

Review comment:
       I moved it here because this listener must be registered after `notifyConfigurationListeners();` so we could react to baseline changes only after proper start. In general, this listener can be registered somewhere in the init phase, development of which is still in progress.




-- 
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



[GitHub] [ignite-3] sk0x50 commented on a change in pull request #674: IGNITE-16010 move setBaseline to cluster configuration

Posted by GitBox <gi...@apache.org>.
sk0x50 commented on a change in pull request #674:
URL: https://github.com/apache/ignite-3/pull/674#discussion_r823593390



##########
File path: modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -332,6 +333,13 @@ public void start(@Nullable String cfg) {
             // Deploy all registered watches because all components are ready and have registered their listeners.
             metaStorageMgr.deployWatches();
 
+            baselineMgr.listenBaselineChange(ctx -> {
+                // TODO: Multi invoke supposed to be here https://issues.apache.org/jira/browse/IGNITE-16063
+                metaStorageMgr.put(new ByteArray("some key"), new byte[0]);

Review comment:
       > I could change it, if we decide to merge it not only to the feature branch, but to the main also
   
   In any case, the name of a property should be meaningful. IMHO, `some key` is not good enough for the feature branch as well.




-- 
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