denis-chudov commented on a change in pull request #608:
URL: https://github.com/apache/ignite-3/pull/608#discussion_r800491550



##########
File path: 
modules/raft/src/integrationTest/java/org/apache/ignite/raft/jraft/core/ItCliServiceTest.java
##########
@@ -43,6 +43,7 @@
 import java.util.function.BooleanSupplier;
 import org.apache.ignite.internal.testframework.WorkDirectory;
 import org.apache.ignite.internal.testframework.WorkDirectoryExtension;
+import org.apache.ignite.internal.util.IgniteUtils;

Review comment:
       unused import

##########
File path: 
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -327,11 +331,55 @@ public void start(@Nullable String cfg) {
                 doStartComponent(name, startedComponents, component);
             }
 
+            CompletableFuture<Void> upToDateMetastorageRevisionFut = new 
CompletableFuture<>();
+
+            metaStorageMgr.listen(MetastorageEvent.REVISION_APPLIED, new 
EventListener<MetastorageEventParameters>() {
+                @Override
+                public boolean notify(@NotNull MetastorageEventParameters 
parameters, @Nullable Throwable exception) {
+                    if (exception != null) {
+                        
upToDateMetastorageRevisionFut.completeExceptionally(exception);
+
+                        return true;
+                    }
+
+                    long metastorageRevision = 
metaStorageMgr.revision().join();
+
+                    assert metastorageRevision >= parameters.getRevision() : 
IgniteStringFormatter.format(
+                            "Metastorage revision must greater than the node 
applied revision [msRev={}, appliedRev={}",

Review comment:
       "must be greater"
   "node applied revision" - maybe - "local node applied revision"?

##########
File path: 
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -327,11 +331,55 @@ public void start(@Nullable String cfg) {
                 doStartComponent(name, startedComponents, component);
             }
 
+            CompletableFuture<Void> upToDateMetastorageRevisionFut = new 
CompletableFuture<>();
+
+            metaStorageMgr.listen(MetastorageEvent.REVISION_APPLIED, new 
EventListener<MetastorageEventParameters>() {

Review comment:
       I'd recommend moving the listener body to separate method

##########
File path: 
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java
##########
@@ -346,6 +394,17 @@ public void start(@Nullable String cfg) {
         }
     }
 
+    /**
+     * Checks the node up to date by metadata.
+     *
+     * @param metastorageRevision Metastorage revision.
+     * @param appliedRevision Last applied node revision.
+     * @return True when the applied revision is greater enough to node 
recovery complete, false otherwise.
+     */
+    private boolean isMetadataUpToDate(long metastorageRevision, long 
appliedRevision) {
+        return metastorageRevision - 100 < appliedRevision;

Review comment:
       maybe we need IgniteSystemProperty instead of `100`




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to