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

openapi definitions for shard shashots API #2571

Merged
merged 2 commits into from
Sep 4, 2023
Merged

Conversation

generall
Copy link
Member

@generall generall commented Sep 2, 2023

  • OpenAPI definitions
  • OPenAPI tests
  • minor consistency changes

@generall generall requested a review from ffuugoo September 2, 2023 20:07
Comment on lines 157 to 165
response = request_with_validation(
api='/collections/{collection_name}/shards/{shard_id}/snapshots/recover',
method="PUT",
path_params={'shard_id': 0, 'collection_name': "somethingthatdoesnotexist"},
body={
"location": "file://localhost/whatever.snapshot",
}
)
assert response.status_code == 404
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to not use file:// URLs for shard snapshot recovery, and so explicitly check that locations is either HTTP(S) URL or a plain path. file:// should return error 400.

See:

content:
application/json:
schema:
$ref: "#/components/schemas/SnapshotRecover"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recover_shard_snapshot uses ShardSnapshotRecover, which is a bit different from SnapshotRecover, because we decided not to use file:// URLs for shard snapshot API.

See:

@generall generall requested a review from ffuugoo September 4, 2023 12:27
Copy link
Contributor

@ffuugoo ffuugoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@generall generall merged commit 326ef54 into dev Sep 4, 2023
@generall generall deleted the shard-snapshots-openapi branch September 4, 2023 12:54
generall added a commit that referenced this pull request Sep 4, 2023
* openapi definitions for shard shashots API

* review fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants