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] Inconsistent responses between GET /_snapshot/_status and GET /_snapshot/{repository}/_status #16961

Closed
dblock opened this issue Jan 6, 2025 · 2 comments
Labels

Comments

@dblock
Copy link
Member

dblock commented Jan 6, 2025

Describe the bug

Coming from opensearch-project/opensearch-api-specification#756 we create a snapshot in my-fs-repository and are seeing the following.

  1. GET /_snapshot/_status returns the snapshot.
[INFO] {
  "snapshots": [
    {
      "snapshot": "my-test-snapshot",
      "repository": "my-fs-repository",
      "uuid": "1-K65GWuQmOsGGwfp3oq7A",
      "state": "STARTED",
      "include_global_state": false,
      "shards_stats": {
        "initializing": 0,
        "started": 0,
        "finalizing": 3,
        "done": 1,
        "failed": 0,
        "total": 4
      },
      "stats": {
        ...
  ]
}
  1. GET /_snapshot/{repository}/_status immediately after sometimes does not.
[INFO] => GET /_snapshot/my-fs-repository/_status ({}) [application/json] 
[INFO] <= 200 (application/json; charset=UTF-8) | {
  "snapshots": []
}
[INFO] {
  "snapshots": []
}
  1. GET /_snapshot/my-fs-repository/my-test-snapshot/_status immediately after returns the data as above.

Related component

Storage:Snapshots

To Reproduce

  1. Check out https://github.com/opensearch-project/opensearch-api-specification
  2. From tests/snapshot run docker compose up
  3. npm run test:spec -- --tests tests/snapshot

Seems to be reproduced 75% of the time in CI.

Expected behavior

Consistent API behavior.

Additional Details

2.18

@Xtansia
Copy link
Contributor

Xtansia commented Jan 6, 2025

I believe GET /_snapshot/_status and GET /_snapshot/{repository}/_status only return actively running snapshots, where as GET /_snapshot/{repository}/{snapshot}/_status returns the snapshot regardless of status. So I think it might just be that the snapshot completed between request 1. and 2..

@dblock
Copy link
Member Author

dblock commented Jan 6, 2025

That's a strange API :( I think you're right, closing.

@dblock dblock closed this as completed Jan 6, 2025
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Storage Project Board Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants