[
https://issues.apache.org/jira/browse/HDDS-15212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chi-Hsuan Huang reassigned HDDS-15212:
--------------------------------------
Assignee: Chi-Hsuan Huang
> Align getFileStatus(bucketPath) with listStatus(volumePath) for EC bucket root
> ------------------------------------------------------------------------------
>
> Key: HDDS-15212
> URL: https://issues.apache.org/jira/browse/HDDS-15212
> Project: Apache Ozone
> Issue Type: Improvement
> Reporter: Chi-Hsuan Huang
> Assignee: Chi-Hsuan Huang
> Priority: Minor
>
> Follow\-up to HDDS\-14043, which fixed {{ozone fs \-ls \-e}}
> {{UnsupportedOperationException}} by populating
> {{ContentSummary.getErasureCodingPolicy\(\)}} on {{ofs://}} and {{o3fs://}}.
> That PR also fixed the synthetic\-bucket\-adapter
> \({{BasicRootedOzoneClientAdapterImpl#getFileStatusAdapterForBucket}}\) so
> that when _listing_ a volume, each EC\-configured bucket entry reports its EC
> scheme name. However, the parallel direct\-query path is not aligned:
> ||Operation||Reports EC scheme for EC bucket?||Why||
> |{{fs.listStatus\(volumePath\)}} \(each bucket entry\)|Yes|Goes through
> {{getFileStatusAdapterForBucket\(bucket, uri\)}}, which reads
> {{ozoneBucket.getReplicationConfig\(\)}} directly.|
> |{{fs.getFileStatus\(bucketPath\)}}|_No — reports ""_|Goes through
> {{getFileStatusForKeyOrSnapshot}} → {{bucket.getFileStatus\(""\)}} → regular
> {{toFileStatusAdapter}}, which reads the synthesized {{OmKeyInfo}}'s
> replication config \(OM defaults to RATIS, does not propagate the bucket's
> default EC config\).|
> |{{fs.getContentSummary\(bucketPath\)}}|_No — reports ""_|Same path as above.|
> User\-visible symptom: {{ozone fs \-count \-e /vol1/ecbucket1/}} reports an
> empty EC policy column for an EC\-configured bucket, even though {{ozone fs
> \-ls \-e /vol1/}} lists the same bucket with its scheme.
> The same gap exists in the o3fs \(non\-rooted\) adapter
> \({{BasicOzoneClientAdapterImpl}}\), where {{o3fs://}} mounts a single bucket
> and {{fs.getFileStatus\(new Path\("/"\)\)}} hits the same synthetic\-keyInfo
> path.
> h2. Suggested fix
> Detect {{key.isEmpty\(\)}} \(i.e. the request is for the bucket directory
> itself\) in:
> * {{BasicRootedOzoneClientAdapterImpl#getFileStatusForKeyOrSnapshot}}
> * {{BasicOzoneClientAdapterImpl#getFileStatus}}
> When the bucket has an EC default replication config, override the
> {{ecPolicy}} field on the resulting {{FileStatusAdapter}} with
> {{bucket.getReplicationConfig\(\).getReplication\(\)}}. Cleanest approach: an
> overload of {{toFileStatusAdapter\(..., String ecPolicyOverride\)}} that uses
> the override when non\-null. Don't substitute
> {{getFileStatusAdapterForBucket}} wholesale, because it derives
> owner/group/modification\-time differently from the regular keyInfo path and
> that would silently change visible metadata on bucket paths.
> h2. Test coverage
> * New test in {{AbstractRootedOzoneFileSystemTest}}: create an EC\-configured
> bucket, assert
> {{fs.getContentSummary\(bucketPath\).getErasureCodingPolicy\(\)}} returns the
> EC scheme name. This assertion was prototyped during HDDS\-14043 review and
> removed when the gap was identified — see
> [https://github.com/apache/ozone/pull/10209|https://github.com/apache/ozone/pull/10209].
> * Parallel test in {{AbstractOzoneFileSystemTest}} for the {{o3fs://}} root.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]