You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "FewJuho (via GitHub)" <gi...@apache.org> on 2024/10/16 13:49:23 UTC

[PR] IGNITE-18979 Add snapshot creation time in SnapshotView [ignite]

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

   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.

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-18979 Add snapshot creation time in SnapshotView [ignite]

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


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotMetadata.java:
##########
@@ -52,6 +52,9 @@ public class IncrementalSnapshotMetadata implements Serializable {
     /** Name of the folder that contains snapshot data. */
     private final String folderName;
 
+    /** Creation timestamp in milliseconds since Unix epoch. */
+    private final long creationTimeMillis;

Review Comment:
   `creationTime`



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotCheckBeforeRestoreTest.java:
##########
@@ -307,7 +308,7 @@ public void testIncrementIndexMismatch() throws Exception {
             meta.snapshotName(),
             meta.incrementIndex() + 1,
             meta.consistentId(),
-            null,
+            null, meta.creationTimeMillis(),

Review Comment:
   Set arg on new line



##########
docs/_docs/monitoring-metrics/system-views.adoc:
##########
@@ -1009,4 +1009,5 @@ The SNAPSHOT view exposes information about local snapshots.
 | SNAPSHOT_RECORD_SEGMENT | BIGINT | Index of WAL segment containing snapshot's WAL record.
 | INCREMENT_INDEX | INTEGER | Incremental snapshot index.
 | TYPE | VARCHAR | Type of snapshot - full or incremental.
+| CREATION_TIME | long | Snapshot creation time.

Review Comment:
   Type naming should be consistent in the snapshot view block.



##########
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/SnapshotView.java:
##########
@@ -143,6 +147,14 @@ public String type() {
         return type.name();
     }
 
+    /**
+     *  @return Creation timestamp in milliseconds since Unix epoch.
+     */
+    @Order(7)
+    public Long creationTimeMillis() {
+        return creationTimeMillis != null && creationTimeMillis != 0 ? creationTimeMillis : null;

Review Comment:
   it never can be null. 



-- 
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-18979 Add snapshot creation time in SnapshotView [ignite]

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

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11597) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=11597&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=11597&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=11597&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=11597&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=11597&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11597)
   
   


-- 
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-18979 Add snapshot creation time in SnapshotView [ignite]

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


##########
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/SnapshotView.java:
##########
@@ -143,6 +147,14 @@ public String type() {
         return type.name();
     }
 
+    /**
+     *  @return Creation timestamp in milliseconds since Unix epoch.
+     */
+    @Order(7)
+    public Long creationTimeMillis() {
+        return creationTimeMillis != null && creationTimeMillis != 0 ? creationTimeMillis : null;

Review Comment:
   it can be null in case of backward compatibility. when SnapshotView tries to output outdated snapshot without creationTime metadata this field stores zero value and it should be prints as null 



-- 
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-18979 Add snapshot creation time in SnapshotView [ignite]

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


##########
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/SnapshotView.java:
##########
@@ -143,6 +147,14 @@ public String type() {
         return type.name();
     }
 
+    /**
+     *  @return Creation timestamp in milliseconds since Unix epoch.
+     */
+    @Order(7)
+    public Long creationTimeMillis() {
+        return creationTimeMillis != null && creationTimeMillis != 0 ? creationTimeMillis : null;

Review Comment:
   it can be null in case of backward compatibility. when SnapshotView tries to output outdated snapshot without creationTime metadata this field stores zero value and it should be prints as null 



-- 
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-18979 Add snapshot creation time in SnapshotView [ignite]

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

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11597) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=11597&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=11597&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=11597&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=11597&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=11597&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=11597)
   
   


-- 
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-18979 Add snapshot creation time in SnapshotView [ignite]

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


-- 
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-18979 Add snapshot creation time in SnapshotView [ignite]

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


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotCheckBeforeRestoreTest.java:
##########
@@ -275,7 +275,7 @@ public void testNoIncrementalSnapshotMetaNotFound() throws Exception {
             meta.snapshotName() + "1",
             meta.incrementIndex(),
             meta.consistentId(),
-            null,
+            null, meta.creationTimeMillis(),

Review Comment:
   each argument in this call is placed on new line



##########
modules/core/src/main/java/org/apache/ignite/internal/managers/systemview/walker/SnapshotViewWalker.java:
##########
@@ -47,10 +48,11 @@ public class SnapshotViewWalker implements SystemViewRowAttributeWalker<Snapshot
         v.accept(4, "snapshotRecordSegment", Long.class, row.snapshotRecordSegment());
         v.accept(5, "incrementIndex", Integer.class, row.incrementIndex());
         v.accept(6, "type", String.class, row.type());
+        v.accept(7, "creationTimeMillis", Long.class, row.creationTimeMillis());

Review Comment:
   Add info about the field to ignite docs.



##########
modules/core/src/main/java/org/apache/ignite/internal/managers/systemview/walker/SnapshotViewWalker.java:
##########
@@ -36,6 +36,7 @@ public class SnapshotViewWalker implements SystemViewRowAttributeWalker<Snapshot
         v.accept(4, "snapshotRecordSegment", Long.class);
         v.accept(5, "incrementIndex", Integer.class);
         v.accept(6, "type", String.class);
+        v.accept(7, "creationTimeMillis", Long.class);

Review Comment:
   Names of similar fields in other views don't contain "Millis" suffix



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IncrementalSnapshotMetadata.java:
##########
@@ -62,20 +66,23 @@ public class IncrementalSnapshotMetadata implements Serializable {
      * @param consId Consistent id of a node to which this metadata relates.
      * @param folderName Directory name which stores the data files.
      * @param incSnpRec Pointer to {@link IncrementalSnapshotFinishRecord}.
+     * @param creationTimeMillis Timestamp of the snapshot creation.
      */
     public IncrementalSnapshotMetadata(
         UUID rqId,
         String snpName,
         int incIdx,
         String consId,
         String folderName,
+        @Nullable long creationTimeMillis,

Review Comment:
   primitive types couldn't be nullable



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