-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-3612. Allow mounting bucket under other volume #1104
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
Conversation
|
Thanks @bharatviswa504 for the review. I have updated the patch based on your comments.
Link can be deleted regardless of the existence or emptiness of the real bucket it points to. So no need to check resolved bucket. |
This is the semantics for link buckets, because this is not a delete link, it is same delete bucket op which OM has received. |
...one-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMAllocateBlockRequest.java
Show resolved
Hide resolved
|
Overall LGTM. |
|
@adoroszlai Any comments on left over 2 questions. |
The same "delete bucket" op works for deleting links. Since links cannot have direct entries, the emptiness check will not find any, hence delete is always allowed. We don't resolve the bucket the link points to, because its emptiness does not affect whether we can delete the link. Please let me know if I misunderstood the question. |
|
@adoroszlai, thanks for working on this feature. I did some simple tests locally and looks good. A few questions about the expected behavior,
|
Thanks @ChenSammi for that.
Yes.
Previously each user had its own S3 volume and only by sharing the AWS access key could others use it. Now if you create a bucket link, other users can access it as long as ACL permits (similar to other Ozone objects).
Yes. When following links eg. to create a key, only read permission is checked on the link. The source bucket is still checked for the permission required for the specific operation (eg. key list, create, or delete).
I'm not familiar with quotas, but I guess links should work like empty buckets in this respect. Keys are created in the source bucket, so they should not affect space usage in the link's volume. |
@adoroszlai , thanks for the explanation. |
Makes sense to me. Thanks for the explanation. |
|
I have one suggestion, can we make this mount configurable option, as this is required only when old S3 buckets needs to be exposed via O3fs/ofs. In this way, we can avoid extra bucket checks. (I know that it is in-memory cache, but still I feel if some one does not require this feature, it is totally disabled). I think we can make that check in 2 places. One in create bucket/and other in resolveBucketLink. Fine to do in another Jira also. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 LGTM, with one comment.
Thank You @adoroszlai for the PR.
I take back this comment. This feature helps to expose buckets created via shell/ofs to S3. So making it configurable is not needed. (As by default if user decides to expose any bucket created via shell, it can be exposed without any restart.) Thank You @arp7 for the offline discussion. |
Thanks for the suggestion, sounds good to me. I think if we want to disable it by default, then it should be done as part of this task. If it's enabled by default, then it's fine to add the config later in separate task. Let me know what should be the default value. CC @arp7 @elek |
OK. |
|
Thanks @adoroszlai for the contribution and @bharatviswa504 for the review. |
|
Thanks @arp7, @elek for high-level review, @bharatviswa504 for the detailed reviews, @ChenSammi for testing and committing it. |
* master: HDDS-3855. Add upgrade smoketest (apache#1142) HDDS-3964. Ratis config key mismatch (apache#1204) HDDS-3612. Allow mounting bucket under other volume (apache#1104) HDDS-3926. OM Token Identifier table should use in-house serialization. (apache#1182) HDDS-3824: OM read requests should make SCM#refreshPipeline outside BUCKET_LOCK (apache#1164)
…erface * upstream/master: HDDS-3855. Add upgrade smoketest (apache#1142) HDDS-3964. Ratis config key mismatch (apache#1204) HDDS-3612. Allow mounting bucket under other volume (apache#1104) HDDS-3926. OM Token Identifier table should use in-house serialization. (apache#1182) HDDS-3824: OM read requests should make SCM#refreshPipeline outside BUCKET_LOCK (apache#1164) HDDS-3966. Disable flaky TestOMRatisSnapshots
* master: HDDS-3984. Support filter and search the columns in recon UI (apache#1218) HDDS-3806. Support recognize aws v2 Authorization header. (apache#1098) HDDS-3955. Unable to list intermediate paths on keys created using S3G. (apache#1196) HDDS-3741. Reload old OM state if Install Snapshot from Leader fails (apache#1129) HDDS-3965. SCM failed to start up for duplicated pipeline detected. (apache#1210) HDDS-3855. Add upgrade smoketest (apache#1142) HDDS-3964. Ratis config key mismatch (apache#1204) HDDS-3612. Allow mounting bucket under other volume (apache#1104) HDDS-3926. OM Token Identifier table should use in-house serialization. (apache#1182) HDDS-3824: OM read requests should make SCM#refreshPipeline outside BUCKET_LOCK (apache#1164) HDDS-3966. Disable flaky TestOMRatisSnapshots
What changes were proposed in this pull request?
Implement bucket links.
Implementation details (from the design doc)
ozone sh bucket linkoperation creates a link bucket. Links are like regular buckets, stored in DB the same way, but with two new, optional pieces of information: source volume and bucket. (The bucket being referenced by the link is called "source", not "target", to follow symlink terminology.)BUCKET_ALREADY_EXISTSresult is returned.s3vvolume.Audit
Audit message for link creation mentions the bucket to which the link points (
sourceVolumeandsourceBucket):As well as audit messages for key operations issued on links:
Response for
ALLOCATE_KEYcontains the real (source) volume/bucket, soCOMMIT_KEYdoes not know about the link (but it is prepared to handle it anyway):Based on top of changes from #1091 and #1093.
https://issues.apache.org/jira/browse/HDDS-3612
How was this patch tested?
Added acceptance tests for testing bucket links via Ozone Shell.
Slightly tweaked existing S3 acceptance tests are executed on both normal buckets and bucket links.
Existing Ozone FS acceptance tests (reorganized in #1093) are also executed on links.
https://github.com/adoroszlai/hadoop-ozone/runs/792817258