From 7dcbd18ebf10ce87e1324b67680213df2e49a00d Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Thu, 17 Jun 2021 17:32:43 +0800 Subject: [PATCH 1/4] Proposal: Redesign Features Signed-off-by: Xuanwo --- rfcs/0-redesign-features.md | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 rfcs/0-redesign-features.md diff --git a/rfcs/0-redesign-features.md b/rfcs/0-redesign-features.md new file mode 100644 index 0000000..2490bf0 --- /dev/null +++ b/rfcs/0-redesign-features.md @@ -0,0 +1,44 @@ +--- +author: Xuanwo +status: draft +updated_at: 2021-06-17 +--- + +# Proposal: Redesign Features + +## Background + +N/A + +## Proposal + +Define features one by one and remove all autogenerated check. + +For now, we will introduce following features, other features should be introduced by new GSPs. + +### LoosePair + +Replace `LooseOperation` features. + +### VirtualDir + +Replace `VirtualOperationCreateDir`, + +## Rationale + +N/A + +## Compatibility + +Related fields `ServiceFeatures` and `StorageFeatures` will be deprecated, like: + +- `LooseOperationAll` +- `LooseOperationRead` +- `VirtualOperationAll` +- `VirtualOperationCreateDir` +- `VirtualPairWriteContentMd5` +- ... + +## Implementation + + \ No newline at end of file From d0f9a00a7b6d65285879cbdf9dff27d1d74582dc Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Thu, 17 Jun 2021 17:34:06 +0800 Subject: [PATCH 2/4] Assign numbers Signed-off-by: Xuanwo --- rfcs/{0-redesign-features.md => 109-redesign-features.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename rfcs/{0-redesign-features.md => 109-redesign-features.md} (95%) diff --git a/rfcs/0-redesign-features.md b/rfcs/109-redesign-features.md similarity index 95% rename from rfcs/0-redesign-features.md rename to rfcs/109-redesign-features.md index 2490bf0..3b7a100 100644 --- a/rfcs/0-redesign-features.md +++ b/rfcs/109-redesign-features.md @@ -4,7 +4,7 @@ status: draft updated_at: 2021-06-17 --- -# Proposal: Redesign Features +# GSP-109: Redesign Features ## Background From 994fc1d872573528aceca3a9d9e554fcaad8ccb9 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 21 Jun 2021 15:32:36 +0800 Subject: [PATCH 3/4] Add more details Signed-off-by: Xuanwo --- rfcs/109-redesign-features.md | 71 ++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/rfcs/109-redesign-features.md b/rfcs/109-redesign-features.md index 3b7a100..d90f874 100644 --- a/rfcs/109-redesign-features.md +++ b/rfcs/109-redesign-features.md @@ -8,21 +8,75 @@ updated_at: 2021-06-17 ## Background -N/A +[GSP-87](https://github.com/beyondstorage/specs/pull/87) introduces a new concept `Feature`. However, it's proved to be too complicated that both hard to understand and to implemented. + +In GSP-87, we added new struct `ServiceFeatures` and `StorageFeatures`: + +```go +type ServiceFeatures struct { + LooseOperationAll bool + LooseOperationCreate bool + LooseOperationDelete bool + LooseOperationGet bool + LooseOperationList bool + + VirtualOperationAll bool + + VirtualPairAll bool +} + +type StorageFeatures struct { + LooseOperationAll bool + LooseOperationCompleteMultipart bool + LooseOperationCreate bool + LooseOperationCreateMultipart bool + LooseOperationDelete bool + LooseOperationList bool + LooseOperationListMultipart bool + LooseOperationMetadata bool + LooseOperationRead bool + LooseOperationStat bool + LooseOperationWrite bool + LooseOperationWriteMultipart bool + + VirtualOperationAll bool + + VirtualPairAll bool +} +``` + +There are the following problems: + +- `LooseOperationXxx` is too verbose and there is no user who requires this feature. +- `VirtualOperationWriteDir` make developer-only care about it in `CreateDir`, but it's not correct: to implement `VirtualDir` support, the developer should check them everywhere. ## Proposal -Define features one by one and remove all autogenerated check. +Define features one by one and remove all autogenerated check, that means service implementer should check all features manually when required. -For now, we will introduce following features, other features should be introduced by new GSPs. +For now, we will introduce the following features, other features should be introduced by new GSPs. ### LoosePair -Replace `LooseOperation` features. +We will introduce a new feature called `LoosePair` to replace `LooseOperation` features. + +If this feature is enabled, the service will not return an error for not support pairs. ### VirtualDir -Replace `VirtualOperationCreateDir`, +We will introduce a new feature called `VirtualDir` to Replace `VirtualOperationCreateDir`. + +Any operation that is related to dir SHOULD check `VirtualDir` in services that don't have native support for dir. + +- `stat`: SHOULD check `VirtualDir` before set Dir ObjectMode +- `create`: SHOULD check `VirtualDir` before accept Dir ObjectMode +- `list`: SHOULD check `VirtualDir` before set Dir ObjectMode +- `delete`: SHOULD check `VirtualDir` before delete a dir Object. +- ... + +### VirtualObjectMetadata + +We will introduce a new feature called `VirtualObjectMetadata` to allow the service to handle object metadata even when it doesn't have native support. ## Rationale @@ -39,6 +93,11 @@ Related fields `ServiceFeatures` and `StorageFeatures` will be deprecated, like: - `VirtualPairWriteContentMd5` - ... +The check logic will be removed but related fields will be marked as deprecated. + ## Implementation - \ No newline at end of file +- Mark fields as deprecated +- Remove not used check logic +- Add features in specs and go-storage +- Implement feature checks in all service From 75fa500fc2dbda0dd7db6930a8aab0f0823926e5 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 21 Jun 2021 17:19:36 +0800 Subject: [PATCH 4/4] address comment Signed-off-by: Xuanwo --- rfcs/109-redesign-features.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rfcs/109-redesign-features.md b/rfcs/109-redesign-features.md index d90f874..0f8c217 100644 --- a/rfcs/109-redesign-features.md +++ b/rfcs/109-redesign-features.md @@ -78,6 +78,8 @@ Any operation that is related to dir SHOULD check `VirtualDir` in services that We will introduce a new feature called `VirtualObjectMetadata` to allow the service to handle object metadata even when it doesn't have native support. +This feature will replace `VirtualPairXxxYxxx` features like `VirutalPairWriteContentMd5` or `VirtualPairWriteContentType`. `VirtualPairXxxYxxx` used to added in GSP-87, but never implemented. In this proposal, we unify all of them into `VirtualObjectMetadata`. + ## Rationale N/A