You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Vladsz83 (via GitHub)" <gi...@apache.org> on 2026/05/08 14:15:09 UTC

[PR] Fix snp creation metrics - test [ignite]

Vladsz83 opened a new pull request, #13119:
URL: https://github.com/apache/ignite/pull/13119

   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-28668 Keep snapshot creation metrics on each node [ignite]

Posted by "NSAmelchev (via GitHub)" <gi...@apache.org>.
NSAmelchev commented on code in PR #13119:
URL: https://github.com/apache/ignite/pull/13119#discussion_r3443206374


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java:
##########
@@ -849,81 +849,70 @@ public void testClusterSnapshotWithExplicitPathError() throws Exception {
     /** @throws Exception If fails. */
     @Test
     public void testClusterSnapshotMetrics() throws Exception {
-        String newSnapshotName = SNAPSHOT_NAME + "_new";
         CountDownLatch deltaApply = new CountDownLatch(1);
         CountDownLatch deltaBlock = new CountDownLatch(1);
         IgniteEx ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE);
 
-        MetricRegistry mreg0 = ignite.context().metric().registry(SNAPSHOT_METRICS);
-
-        LongMetric startTime = mreg0.findMetric("LastSnapshotStartTime");
-        LongMetric endTime = mreg0.findMetric("LastSnapshotEndTime");
-        ObjectGauge<String> snpName = mreg0.findMetric("LastSnapshotName");
-        ObjectGauge<String> errMsg = mreg0.findMetric("LastSnapshotErrorMessage");
-        ObjectGauge<List<String>> snpList = mreg0.findMetric("LocalSnapshotNames");
-
         // Snapshot process will be blocked when delta partition files processing starts.
         snp(ignite).localSnapshotSenderFactory(
             blockingLocalSnapshotSender(ignite, deltaApply, deltaBlock));
 
-        assertEquals("Snapshot start time must be undefined prior to snapshot operation started.",
-            0, startTime.value());
-        assertEquals("Snapshot end time must be undefined to snapshot operation started.",
-            0, endTime.value());
-        assertTrue("Snapshot name must not exist prior to snapshot operation started.", snpName.value().isEmpty());
-        assertTrue("Snapshot error message must null prior to snapshot operation started.", errMsg.value().isEmpty());
-        assertTrue("Snapshots on local node must not exist", snpList.value().isEmpty());
+        for (Ignite g : G.allGrids()) {
+            MetricRegistry mreg = ((IgniteEx)g).context().metric().registry(SNAPSHOT_METRICS);
+
+            LongMetric startTime = mreg.findMetric("LastSnapshotStartTime");
+            LongMetric endTime = mreg.findMetric("LastSnapshotEndTime");
+            ObjectGauge<String> snpName = mreg.findMetric("LastSnapshotName");
+            ObjectGauge<String> errMsg = mreg.findMetric("LastSnapshotErrorMessage");
+            ObjectGauge<List<String>> snpList = mreg.findMetric("LocalSnapshotNames");
+
+            assertEquals("Snapshot start time must be undefined prior to snapshot operation started.",
+                0, startTime.value());
+            assertEquals("Snapshot end time must be undefined to snapshot operation started.",
+                0, endTime.value());
+            assertTrue("Snapshot name must not exist prior to snapshot operation started.", snpName.value().isEmpty());
+            assertTrue("Snapshot error message must null prior to snapshot operation started.", errMsg.value().isEmpty());
+            assertTrue("Snapshots on local node must not exist", snpList.value().isEmpty());
+        }
 
         long cutoffStartTime = U.currentTimeMillis();
 
-        IgniteFuture<Void> fut0 = snp(ignite).createSnapshot(SNAPSHOT_NAME, null, false, onlyPrimary);
+        IgniteFuture<Void> fut = snp(ignite).createSnapshot(SNAPSHOT_NAME, null, false, onlyPrimary);
 
         U.await(deltaApply);
 
-        assertTrue("Snapshot start time must be set prior to snapshot operation started " +
-            "[startTime=" + startTime.value() + ", cutoffTime=" + cutoffStartTime + ']',
-            startTime.value() >= cutoffStartTime);
-        assertEquals("Snapshot end time must be zero prior to snapshot operation started.",
-            0, endTime.value());
-        assertEquals("Snapshot name must be set prior to snapshot operation started.",
-            SNAPSHOT_NAME, snpName.value());
-        assertTrue("Snapshot error message must null prior to snapshot operation started.",
-            errMsg.value().isEmpty());
-
-        IgniteFuture<Void> fut1 = snp(grid(1)).createSnapshot(newSnapshotName, null, false, onlyPrimary);
-
-        assertThrowsWithCause((Callable<Object>)fut1::get, IgniteException.class);
+        for (Ignite g : G.allGrids()) {
+            MetricRegistry mreg = ((IgniteEx)g).context().metric().registry(SNAPSHOT_METRICS);
+
+            LongMetric startTime = mreg.findMetric("LastSnapshotStartTime");
+            LongMetric endTime = mreg.findMetric("LastSnapshotEndTime");
+            ObjectGauge<String> snpName = mreg.findMetric("LastSnapshotName");
+            ObjectGauge<String> errMsg = mreg.findMetric("LastSnapshotErrorMessage");
+
+            assertTrue("Snapshot start time must be set prior to snapshot operation started " +
+                    "[startTime=" + startTime.value() + ", cutoffTime=" + cutoffStartTime + ']',
+                startTime.value() >= cutoffStartTime);
+            assertEquals("Snapshot end time must be zero prior to snapshot operation started.",
+                0, endTime.value());
+            assertEquals("Snapshot name must be set prior to snapshot operation started.",
+                SNAPSHOT_NAME, snpName.value());
+            assertTrue("Snapshot error message must null prior to snapshot operation started.",
+                errMsg.value().isEmpty());
+        }
 
-        MetricRegistry mreg1 = grid(1).context().metric().registry(SNAPSHOT_METRICS);
+        deltaBlock.countDown();
 
-        LongMetric startTime1 = mreg1.findMetric("LastSnapshotStartTime");
-        LongMetric endTime1 = mreg1.findMetric("LastSnapshotEndTime");
-        ObjectGauge<String> snpName1 = mreg1.findMetric("LastSnapshotName");
-        ObjectGauge<String> errMsg1 = mreg1.findMetric("LastSnapshotErrorMessage");
+        fut.get();
 
-        assertTrue("Snapshot start time must be greater than zero for finished snapshot.",
-            startTime1.value() > 0);
-        assertEquals("Snapshot end time must zero for failed on start snapshots.",
-            0, endTime1.value());
-        assertEquals("Snapshot name must be set when snapshot operation already finished.",
-            newSnapshotName, snpName1.value());
-        assertNotNull("Concurrent snapshot operation must failed.",
-            errMsg1.value());
+        for (Ignite g : G.allGrids()) {
+            MetricRegistry mreg = ((IgniteEx)g).context().metric().registry(SNAPSHOT_METRICS);
 
-        deltaBlock.countDown();
+            LongMetric startTime = mreg.findMetric("LastSnapshotStartTime");
+            LongMetric endTime = mreg.findMetric("LastSnapshotEndTime");
 
-        fut0.get();
-
-        assertTrue("Snapshot start time must be greater than zero for finished snapshot.",
-            startTime.value() > 0);
-        assertTrue("Snapshot end time must be greater than zero for finished snapshot.",
-            endTime.value() > 0);
-        assertEquals("Snapshot name must be set when snapshot operation already finished.",
-            SNAPSHOT_NAME, snpName.value());
-        assertTrue("Concurrent snapshot operation must finished successfully.",
-            errMsg.value().isEmpty());
-        assertEquals("Only the first snapshot must be created and stored on disk.",
-            Collections.singletonList(SNAPSHOT_NAME), snpList.value());
+            waitForCondition(() -> endTime.value() != 0L && startTime.value() != 0 && endTime.value() > startTime.value(),

Review Comment:
   Ignored result of `waitForCondition`



-- 
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-28668 Keep snapshot creation metrics on each node [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13119:
URL: https://github.com/apache/ignite/pull/13119#issuecomment-4874045169

   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java`
   


-- 
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-28668 Keep snapshot creation metrics on each node [ignite]

Posted by "NSAmelchev (via GitHub)" <gi...@apache.org>.
NSAmelchev merged PR #13119:
URL: https://github.com/apache/ignite/pull/13119


-- 
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-28668 Keep snapshot creation metrics on each node [ignite]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13119:
URL: https://github.com/apache/ignite/pull/13119#issuecomment-4850492063

   ## Possible compatibility issues. Please, check rolling upgrade cases
   
   This PR modifies protected classes (with **Order** annotation).
   Changes to these classes can break rolling upgrade compatibility.
   
   **Affected files:**
   - `modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java`
   


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