Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Get status for all sanpshot or all snapshot on repository not working #13079

Closed
disaster37 opened this issue Apr 4, 2024 · 5 comments
Closed
Labels
bug Something isn't working Storage:Snapshots

Comments

@disaster37
Copy link

Describe the bug

The official doc explain how we can get status for all snapshot or all snapshot on repository.
The doc is here: https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-status/

But, in fact it always return empty list.

Related component

Plugins

To Reproduce

I have tested on Opensearch 2.12.0 from official docker image.

  1. Create snapshot repository with name snapshot
  2. Create snapshot on repository with name test
  3. GET _snapshot/_status return empty list
  4. GET _snapshot/snapshot/_status return empty list
  5. GET _snapshot/snapshot/test/_status work as expected

Expected behavior

When GET _snapshot/snapshot/_status or GET _snapshot/_status get a list of snapshot available.

I currently get empty list:

{
  "snapshots": []
}

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@gaobinlong
Copy link
Collaborator

Is the snapshot you created still running when you call GET _snapshot/snapshot/_status or GET _snapshot/_status? If not, there's no problem, because if you do not specify the snapshot name when calling the api, it will only return the snapshots which are in progress, if no running snapshots then the result is empty, this behavior is by design, I think the documentation describe this clearly.

@peternied
Copy link
Member

[Triage - attendees 1 2 3 4 5 6]
@disaster37 Thanks for creating this issue, it might be helpful to update/modified a test case around snapshots to reproduce this scenario cleanly.

@disaster37
Copy link
Author

disaster37 commented Jun 5, 2024

  1. Create fresh Opensearch cluster base on 2.14.0
  2. Create new index from devtools
POST test/_doc
{
  "@timestamp": "2022-07-07",
  "name": "1"
}
  1. Create local repository
PUT _snapshot/test
{
"type": "fs",
    "settings": {
      "location": "/mnt/snapshot"
    }
}
  1. Create a snapshot
PUT _snapshot/test/snap-test
{
  "indices": "test",
  "ignore_unavailable": true,
  "include_global_state": false,
  "partial": false
}

The issue:
GET _snapshot/_status
It return

{
  "snapshots": []
}

I hope to look here my snapshot snap-test.

GET _snapshot/test/_status
It return

{
  "snapshots": []
}

I hope to look here my snapshot snap-test.

Finally
GET _snapshot/test/snap-test/_status

Return that I expect

{
  "snapshots": [
    {
      "snapshot": "snap-test",
      "repository": "test",
      "uuid": "owjuC2cWSRWTZZYu44RjZQ",
      "state": "SUCCESS",
      "include_global_state": false,
      "shards_stats": {
        "initializing": 0,
        "started": 0,
        "finalizing": 0,
        "done": 1,
        "failed": 0,
        "total": 1
      },
      "stats": {
        "incremental": {
          "file_count": 4,
          "size_in_bytes": 4295
        },
        "total": {
          "file_count": 4,
          "size_in_bytes": 4295
        },
        "start_time_in_millis": 1717598081260,
        "time_in_millis": 0
      },
      "indices": {
        "test": {
          "shards_stats": {
            "initializing": 0,
            "started": 0,
            "finalizing": 0,
            "done": 1,
            "failed": 0,
            "total": 1
          },
          "stats": {
            "incremental": {
              "file_count": 4,
              "size_in_bytes": 4295
            },
            "total": {
              "file_count": 4,
              "size_in_bytes": 4295
            },
            "start_time_in_millis": 1717598081282,
            "time_in_millis": 0
          },
          "shards": {
            "0": {
              "stage": "DONE",
              "stats": {
                "incremental": {
                  "file_count": 4,
                  "size_in_bytes": 4295
                },
                "total": {
                  "file_count": 4,
                  "size_in_bytes": 4295
                },
                "start_time_in_millis": 1717598081282,
                "time_in_millis": 0
              }
            }
          }
        }
      }
    }
  ]
}

@gaobinlong
Copy link
Collaborator

@disaster37 GET _snapshot/_status and GET _snapshot/<repository>/_status only returns the status of the running snapshots, seems the snapshot snap-test completes very soon, so you cannot get it by GET _snapshot/_status and GET _snapshot/<repository>/_status, you can create an long-running snapshot to verify that.

@disaster37
Copy link
Author

Hum. OK thx for the answer.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Storage Project Board Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Storage:Snapshots
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants