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 2021/06/22 14:00:02 UTC

[GitHub] [ignite] xtern opened a new pull request #9186: IGNITE-14794 JMX management for snapshot restore operation

xtern opened a new pull request #9186:
URL: https://github.com/apache/ignite/pull/9186


   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 [TC.Bot: Check PR](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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Mmuzaf merged pull request #9186: IGNITE-14794 JMX management and metrics for snapshot restore operation

Posted by GitBox <gi...@apache.org>.
Mmuzaf merged pull request #9186:
URL: https://github.com/apache/ignite/pull/9186


   


-- 
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] Mmuzaf commented on a change in pull request #9186: IGNITE-14794 JMX management and metrics for snapshot restore operation

Posted by GitBox <gi...@apache.org>.
Mmuzaf commented on a change in pull request #9186:
URL: https://github.com/apache/ignite/pull/9186#discussion_r787993904



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
##########
@@ -554,14 +581,16 @@ private void ensureCacheAbsent(String name) {
                     ", caches=" + req.groups() + ']');
             }
 
-            SnapshotRestoreContext opCtx0 = prepareContext(req);
+            List<SnapshotMetadata> locMetas = snpMgr.readSnapshotMetadatas(req.snapshotName());
+
+            SnapshotRestoreContext opCtx0 = prepareContext(req, locMetas);
 
             synchronized (this) {
-                opCtx = opCtx0;
+                lastOpCtx = opCtx = opCtx0;
 
                 ClusterSnapshotFuture fut0 = fut;
 
-                if (fut0 != null)
+                if (fut0 != null && fut0.interruptEx != null)

Review comment:
       Why do we need this change? `null` is also fine here.




-- 
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] Mmuzaf commented on a change in pull request #9186: IGNITE-14794 JMX management and metrics for snapshot restore operation

Posted by GitBox <gi...@apache.org>.
Mmuzaf commented on a change in pull request #9186:
URL: https://github.com/apache/ignite/pull/9186#discussion_r786192752



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotMXBeanImpl.java
##########
@@ -47,4 +51,20 @@ public SnapshotMXBeanImpl(GridKernalContext ctx) {
     @Override public void cancelSnapshot(String snpName) {
         mgr.cancelSnapshot(snpName).get();
     }
+
+    /** {@inheritDoc} */
+    @Override public void restoreSnapshot(String name, String grpNames) {
+        Set<String> grpNamesSet = F.isEmpty(grpNames) ? null :

Review comment:
       I'd suggest moving this to internal API and create an overloaded method in the restore manager doing the same.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
##########
@@ -988,6 +1020,8 @@ private static GridAffinityAssignmentCache calculateAffinity(
                                             partFile.toFile(),
                                             snpFile.length());
 
+                                        opCtx0.processedParts.incrementAndGet();

Review comment:
       I suggest incrementing the counter on PartitinFututre completion.




-- 
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] Mmuzaf commented on a change in pull request #9186: IGNITE-14794 JMX management and metrics for snapshot restore operation

Posted by GitBox <gi...@apache.org>.
Mmuzaf commented on a change in pull request #9186:
URL: https://github.com/apache/ignite/pull/9186#discussion_r788058711



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotMXBeanTest.java
##########
@@ -81,14 +92,89 @@ public void testCancelSnapshot() throws Exception {
             mxBean::cancelSnapshot);
     }
 
-    /**
+    /** @throws Exception If fails. */
+    @Test
+    public void testRestoreSnapshot() throws Exception {
+        // TODO IGNITE-14999 Support dynamic restoration of encrypted snapshots.
+        if (encryption)
+            return;
+
+        IgniteEx ignite = startGridsWithSnapshot(2, CACHE_KEYS_RANGE, false);
+
+        DynamicMBean mReg0 = metricRegistry(grid(0).name(), null, SNAPSHOT_RESTORE_METRICS);
+        DynamicMBean mReg1 = metricRegistry(grid(1).name(), null, SNAPSHOT_RESTORE_METRICS);
+
+        assertEquals(0, (long)getMetric("endTime", mReg0));
+        assertEquals(0, (long)getMetric("endTime", mReg1));
+
+        getMxBean(ignite.name(), METRIC_GROUP, SnapshotMXBeanImpl.class, SnapshotMXBean.class)
+            .restoreSnapshot(SNAPSHOT_NAME, null);
+
+        assertTrue(GridTestUtils.waitForCondition(() -> (long)getMetric("endTime", mReg0) > 0, TIMEOUT));
+        assertTrue(GridTestUtils.waitForCondition(() -> (long)getMetric("endTime", mReg1) > 0, TIMEOUT));
+
+        assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE);

Review comment:
       Lets' add the assertion that the restore future is also completed.




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