Project

General

Profile

Actions

Feature #61199

open

Support redirect_zone at bucket level

Added by Yixin Jin 12 months ago. Updated 11 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Currently, zone has an option to specify redirect_zone. Once it is set, when a get op on an object that doesn't exist, it tries to redirect the request to that zone.

With the latest sync policy feature, it is possible that one bucket has content in one zone but not in another. They may choose the residence of their content in different zones. Zone-level redirect_zone is nice but it is applied to requests for all buckets in that zone. I believe it would be very useless to extend this feature (redirect_zone) to bucket level so that when a bucket's content is moved from one zone to another, any accidental request that goes to the old zone can be redirected to the new zone.

In addition, in a multisite environment, when a bucket's content don't exist in all zones, CopyObject with x-copy-source may fail when it arrives at the zone that doesn't have the content of source bucket. With bucket-level redirect_zone, however, we can avoid this shortfall by using the existing capability of doing remote copy. My own prototype of this feature in Quincy branch shows that it is highly doable. The only issue is the difficulty of getting the source object policy in RGWCopyObj::verify_permission().

Actions #1

Updated by Soumya Koduri 11 months ago

I have couple of questions . Request to clarify -

With the latest sync policy feature, it is possible that one bucket has content in one zone but not in another. They may choose the residence of their content in different zones. Zone-level redirect_zone is nice but it is applied to requests for all buckets in that zone. I believe it would be very useless to extend this feature (redirect_zone) to bucket level so that when a bucket's content is moved from one zone to another, any accidental request that goes to the old zone can be redirected to the new zone.

IIU, `zone redirect` command allows to configure redirect-zone for a given zone. That means, we could optionally configure this for selective zones and different zones can have different source/redirect-zone configured. Will the same apply for new `bucket redirect` command..i.e, can we configure a different redirect-zone for a selective <bucket,zone> map? Or will it apply to all the zones when configured for a bucket?

In addition, in a multisite environment, when a bucket's content don't exist in all zones, CopyObject with x-copy-source may fail when it arrives at the zone that doesn't have the content of source bucket. With bucket-level redirect_zone, however, we can avoid this shortfall by using the existing capability of doing remote copy. My own prototype of this feature in Quincy branch shows that it is highly doable. The only issue is the difficulty of getting the source object policy in RGWCopyObj::verify_permission().

Does this mean the RGW server just reads the remote object from the redirect-zone & directly writes into the destination object as specified in the `CopyObject` request? or does it first create the local copy of the remote object (with the same name) and then write into destination object path requested?

Actions #2

Updated by Yixin Jin 11 months ago

Soumya Koduri wrote:

I have couple of questions . Request to clarify -

With the latest sync policy feature, it is possible that one bucket has content in one zone but not in another. They may choose the residence of their content in different zones. Zone-level redirect_zone is nice but it is applied to requests for all buckets in that zone. I believe it would be very useless to extend this feature (redirect_zone) to bucket level so that when a bucket's content is moved from one zone to another, any accidental request that goes to the old zone can be redirected to the new zone.

IIU, `zone redirect` command allows to configure redirect-zone for a given zone. That means, we could optionally configure this for selective zones and different zones can have different source/redirect-zone configured. Will the same apply for new `bucket redirect` command..i.e, can we configure a different redirect-zone for a selective <bucket,zone> map? Or will it apply to all the zones when configured for a bucket?

The bucket-level redirect-zone is applied to the bucket in all zones, regardless how redirect-zone is configured in zones. My prototype actually makes bucket-level redirect-zone to override zone-level one. It means if it is configured at a bucket, the zone-level redirect-zone is ignored.

In addition, in a multisite environment, when a bucket's content don't exist in all zones, CopyObject with x-copy-source may fail when it arrives at the zone that doesn't have the content of source bucket. With bucket-level redirect_zone, however, we can avoid this shortfall by using the existing capability of doing remote copy. My own prototype of this feature in Quincy branch shows that it is highly doable. The only issue is the difficulty of getting the source object policy in RGWCopyObj::verify_permission().

Does this mean the RGW server just reads the remote object from the redirect-zone & directly writes into the destination object as specified in the `CopyObject` request? or does it first create the local copy of the remote object (with the same name) and then write into destination object path requested?

Yes to the first question. My prototype just relies on fetch_remote_obj() called in RGWRados::copy_obj() to accomplish the task.

Actions

Also available in: Atom PDF