Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-19034

VisorSnapshotStatusTask returns empty result for restoring snapshot until snapshot check is completed

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • Docs Required, Release Notes Required

    Description

      Currently, snapshot check is performed under the hood during restoring of a snapshot. For big snapshots check operation execution can take a long time.
      In such case, if you call two similar commands, they will return different results:
      Deprecated command restore --status shows, that snapshot operation is in progress:

      Command [SNAPSHOT] started
      Arguments: --snapshot restore test_snapshot --status 
      --------------------------------------------------------------------------------
      Command deprecated. Use '--snapshot status' instead.
      Snapshot cache group restore operation is running [snapshot=test_snapshot]
      Command [SNAPSHOT] finished with code: 0
      

      But actual command --snapshot status does not show that any snapshot operation is running:

      Command [SNAPSHOT] started
      Arguments: --snapshot status 
      --------------------------------------------------------------------------------
      There is no create or restore snapshot operation in progress.
      Command [SNAPSHOT] finished with code: 0
      

      VisorSnapshotStatusTask.java rely on snapshot restore metrics[1]. This metrics are extracted from SnapshotRestoreProcess#lastOpCtx [2], which is updated in SnapshotRestoreProcess#prepare [3], but this method called after snapshot check is finished [4, 5].

      Here is a reproducer: SnapshotStatusReproducerTest.patch

      Links:

      1. https://github.com/apache/ignite/blob/a8e16899514348ed7b9404e7d122ed430f8e1acd/modules/core/src/main/java/org/apache/ignite/internal/visor/snapshot/VisorSnapshotStatusTask.java#L141
      2. https://github.com/apache/ignite/blob/a8e16899514348ed7b9404e7d122ed430f8e1acd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java#L245
      3. https://github.com/apache/ignite/blob/a8e16899514348ed7b9404e7d122ed430f8e1acd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java#L670
      4. https://github.com/apache/ignite/blob/a8e16899514348ed7b9404e7d122ed430f8e1acd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java#L414
      5. https://github.com/apache/ignite/blob/a8e16899514348ed7b9404e7d122ed430f8e1acd/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java#L205

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            NSAmelchev Nikita Amelchev
            shishkovilja Ilya Shishkov

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h
                2h

                Slack

                  Issue deployment