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

rgw/CloudTransition: Transition objects to cloud endpoint #35100

Merged
merged 16 commits into from Nov 18, 2021

Conversation

soumyakoduri
Copy link
Contributor

@soumyakoduri soumyakoduri commented May 18, 2020

This PR contains series of patches for CloudTiering/CloudTransition feature support (Experimental)

Feature Doc:
https://docs.google.com/document/d/1IoeITPCF64A5W-UA-9Y3Vp2oSfz3xVQHu31GTu3u3Ug/edit#heading=h.4o1xyas8s23x

Tier-config Options:

  • Tier storage class and the respective remote Cloud endpoint details can be configured via "zonegroup placement add <>" CLI.

  • Existing tier-type & tier-config options are used to configure the same. Below are the config options made available -

    {
    "access_key": ,
    "secret": ,
    "endpoint": ,
    "region": "",
    "host_style": <path | virtual>,
    "acls": [ { "type": <id | email | uri>,
    "source_id": <source_id>,
    "dest_id": <dest_id> } ... ],
    "target_path": <target_path>,
    "target_storage_class": ,
    "multipart_sync_threshold": {object_size},
    "multipart_min_part_size": {part_size},
    "retain_object": <true | false>
    }

Object Transition:

  1. Check whether the target_placement is tier-storage class
  2. If yes, depending on object size, transition object as plain object or in multiparts.
  • Few custom rgw xattrs will be added to target object (eg., x-amz-meta-rgwx-source: rgw)
  1. Post transition, either delete the original source object (default behavior) or mark the object as CloudTiered and update its head object Manifest with cloud-tier details.

Multisite:
To avoid multiple zones transitioning same object, each lc thread checks whether the target endpoint (cloud) already contains the object to be transitioned by issuing HEAD request and matching its mtime attr.

Test cases:
ceph/s3-tests#380

TODO:

  • Consolidate config and other common coroutine code with cloud-sync module.

To be handled in future:

  • Send presigned url or read-through for GetObject on cloud transitioned object.
  • Restore operation/policies to restore tiered object
  • federation between RGW and cloud/AWS

Signed-off-by: Soumya Koduri skoduri@redhat.com

@tchaikov tchaikov added the rgw label May 20, 2020
@soumyakoduri soumyakoduri changed the title WIP/CloudTiering: Update head objects and bi entries of the tiered objects WIP/CloudTiering: Tier objects to cloud endpoint Jun 2, 2020
@soumyakoduri
Copy link
Contributor Author

@yehudasa @mattbenjamin @cbodley @dang .. I have listed possible ways of configuring these cloud tier options (mainly to choose the right granularity - zonegroup/zone level) here - https://docs.google.com/document/d/1IoeITPCF64A5W-UA-9Y3Vp2oSfz3xVQHu31GTu3u3Ug/edit#heading=h.66scb8vgvd90

Please take a look and let me know your suggestions on which one seems fit for this use-case and if any changes/additions are required. Thanks!

@soumyakoduri soumyakoduri marked this pull request as draft July 1, 2020 11:11
@soumyakoduri soumyakoduri changed the title WIP/CloudTiering: Tier objects to cloud endpoint rgw/CloudTiering: Tier objects to cloud endpoint (Experimental) Jul 29, 2020
@soumyakoduri soumyakoduri force-pushed the cloudtiering branch 2 times, most recently from 2ca390f to 9702f58 Compare August 5, 2020 08:06
@stale
Copy link

stale bot commented Oct 22, 2020

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@stale stale bot added the stale label Oct 22, 2020
@soumyakoduri
Copy link
Contributor Author

unstale

@stale stale bot removed the stale label Oct 22, 2020
@soumyakoduri soumyakoduri force-pushed the cloudtiering branch 2 times, most recently from 374e5e4 to 4add987 Compare November 9, 2020 09:12
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@soumyakoduri soumyakoduri changed the title rgw/CloudTiering: Tier objects to cloud endpoint (Experimental) rgw/CloudTransition: Transition objects to cloud endpoint (Experimental) Dec 21, 2020
@soumyakoduri
Copy link
Contributor Author

jenkins render docs

@cbodley cbodley removed the cephadm label Nov 17, 2021
@cbodley
Copy link
Contributor

cbodley commented Nov 17, 2021

jenkins test dashboard cephadm

1 similar comment
@cbodley
Copy link
Contributor

cbodley commented Nov 17, 2021

jenkins test dashboard cephadm

As mentioned in https://docs.google.com/document/d/1IoeITPCF64A5W-UA-9Y3Vp2oSfz3xVQHu31GTu3u3Ug/edit,
the tier storage class will be configured at zonegroup level.

So the existing CLI "radosgw-admin zonegroup placement add  <id> --storage-class <class>" will be
used to add tier storage classes as well but with extra tier-config options mentioned below -

--tier-type : "cloud"
--tier-config : [<key,value>,]

These tier options are already defined to configure cloud sync module which are being reused here.

TODO:
* Add multipart options (if any , like part size, threshold)
* Document
* Test upgrade/downgrade

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
If the storage class configured is of cloud, transition
the objects to remote endpoint configured.

In case the object size is >mulitpart size limit (say 5M),
upload the object into multiparts.

As part of transition, map rgw attributes to http attrs,
including ACLs.

A new attribute (x-amz-meta-source: rgw) is added to denote
that the object is transitioned from RGW source.

Added two new options to tier-config to configure multipart size -
* multipart_sync_threshold - determines the limit of object size,
when exceeded transitioned in multiparts
* multipart_min_part_size - the minimum size of the multipart upload part

Default values for both the options is 32M and minimum value supported
is 5M.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
After transitioning the object to cloud, following updates are done
to the existing object.

* In bi entry, change object category to CloudTiered
* Update cloud-tier details (like endpoint, keys etc) in Object Manifest
* Mark the tail objects expired to be deleted by gc

TODO:
* Update all the cloud config details including multiparts
* Check if any other object metadata needs to be changed
* Optimize to avoid using read_op again to read attrs.
* Check for mtime to resolve conflicts when multiple zones try to transition obj

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Added a new option "retain_object" in tier_config which determines
whether a cloud tiered object is deleted or if its head object is
retained. By default the value is false i.e, the objects get
deleted.

XXX: verify that if Object is locked (ATTR_RETENTION), transition is
not processed. Also check if the transition takes place separately for
each version.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Store the status of multipart upload parts to verify if the object
hasn't changed during the transition and if yes, abort the upload.

Also avoid re-creating target buckets -

Its not ideal to try creating target bucket for every object
transition to cloud. To avoid it caching the bucket creations in
a map with an expiry period set to '2*lc_debug_interval' for each
entry.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Add class to fetch headers from remote endpoint and verify if the object
is already tiered.

& Few other fixes stated below -

* Erase data in the head of cloud transitioned object
* 'placement rm' command should erase tier_config details
* A new option added in the object manifest to denote if the
  object is tiered in multiparts

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
As per https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
GET operation may fail with “InvalidObjectStateError” error if the
object is in GLACIER or DEEP_ARCHIVE storage class and not restored.
Same can apply for cloud tiered objects. However STAT/HEAD requests
shall return the metadata stored.

& misc fixes

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
…sses

Tier type storage classes should not be allowed to have data
pools

& few other fixes/cleanup stated below -

* If the tier_targets are not configured, do not dump them in
the 'zonegroup get' command.

* If not configured, by default a bucket of below name convention -
"rgwx-$zonegroup-$storage_class-cloud-bucket"

is created in the remote cloud endpoint to transition objects to.

* Rename config option 'tier_storage_class' to 'target_storage_class'.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Also to avoid object name collisions across various buckets
post cloud transition, add bucket name to the object prefix.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
If the object is versioned, to avoid objects getting overwritten
post transition to cloud, append object versionID to the target
object name

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Currently the transition is supported to cloud providers
that are compatible with AWS/S3. Hence change the tier-type to
cloud-s3 to configure the S3 style endpoint details.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
If an object is locked, skip its transition to cloud.

@todo: Do we need special checks for bucket versioning too?
If current, instead of deleting the data, do we need to create
a delete marker? What about the case if retain_object is set to true.

& misc rebase fixes

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
For versioned and locked objects, similar semantics as that of LifecycleExpiration are applied as stated below -

If the bucket versioning is enabled and the object transitioned to cloud is
 - current version, irrespective of what the config option "retain_object" value is, the object is not deleted but instead delete marker is created on the source rgw server.
 - noncurrent version, it is deleted or retained based on the config option "retain_object" value.

If the object is locked, and is
 - current version, it is transitioned to cloud post which it is made noncurrent with delete marker created.
 - noncurrent version, transition is skipped.

Also misc rebase fixes and cleanup -

* Rename config option to "retain_head_object"

to reflect its functionality to keep head object post transitioning
to cloud if enabled

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
With commit#81ad226, aws auth v4 rquires region name for remote
endpoint connection. Include the same in the tier parameters.

& misc fixes

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Similar to "get_resource()", add an API "send_resource()" to send
PUT/POST/DELETE Stream request on RGWRestConn

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
To avoid the overhead of using coroutines during lifecycle transition,
RGWRESTStream* APIs are used to transition objects to remote cloud.

Also handled few optimizations and cleanup stated below:
* Store the list of cloud target buckets as part of LCWorker instead
  of making it global. This list is maintained for the duration of
  RGWLC::process(), post which discarded.
* Refactor code to remove coroutine based class definitions which are no
  longer needed and use direct function calls instead.
* Check for cloud transitioned objects using tier-type and return error if
  accessed in RGWGetObj, RGWCopyObj and RGWPutObj ops.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
@cbodley
Copy link
Contributor

cbodley commented Nov 18, 2021

jenkins test windows

@cbodley cbodley merged commit 483b1b7 into ceph:master Nov 18, 2021
8 checks passed
soumyakoduri added a commit to soumyakoduri/s3-tests that referenced this pull request Dec 6, 2021
Feature PR: ceph/ceph#35100

Also ported lc testcases from boto2 to boto3

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
soumyakoduri added a commit to soumyakoduri/s3-tests that referenced this pull request Dec 6, 2021
Feature PR: ceph/ceph#35100

Also ported lc testcases from boto2 to boto3

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
soumyakoduri added a commit to soumyakoduri/s3-tests that referenced this pull request Feb 1, 2022
Feature PR: ceph/ceph#35100

Also ported lc testcases from boto2 to boto3

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
soumyakoduri added a commit to soumyakoduri/s3-tests that referenced this pull request Feb 1, 2022
Feature PR: ceph/ceph#35100

Also ported lc testcases from boto2 to boto3

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
cbodley pushed a commit to ceph/s3-tests that referenced this pull request Feb 4, 2022
Feature PR: ceph/ceph#35100

Also ported lc testcases from boto2 to boto3

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
soumyakoduri added a commit to soumyakoduri/s3-tests that referenced this pull request Mar 29, 2022
Feature PR: ceph/ceph#35100

Also ported lc testcases from boto2 to boto3

(cherry picked from commit 47292ae)
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants