[
https://issues.apache.org/jira/browse/HDDS-15212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chi-Hsuan Huang updated HDDS-15212:
-----------------------------------
Summary: Fix empty EC policy in content summary of EC bucket root (was:
Align getFileStatus(bucketPath) with listStatus(volumePath) for EC bucket root)
> Fix empty EC policy in content summary of 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
> Labels: pull-request-available
>
> Follow-up to HDDS-14043, which fixed {{ozone fs -ls -e}}
> {{UnsupportedOperationException}} by populating
> {{ContentSummary.getErasureCodingPolicy()}} on {{ofs://}} and {{o3fs://}}.
> For a bucket root, OM GetFileStatus returns an {{OzoneFileStatus}} without
> {{keyInfo}}. The client decodes it as a synthetic RATIS/ONE key, so
> {{toFileStatusAdapter}} reports an empty EC policy even when the bucket's
> default replication is EC. Only the volume listing path
> ({{BasicRootedOzoneClientAdapterImpl#getFileStatusAdapterForBucket}}) reads
> {{ozoneBucket.getReplicationConfig()}}.
> ||Operation||Reports EC scheme for EC bucket?||
> |{{fs.listStatus(volumePath)}} (each bucket entry)|Yes, {{isErasureCoded()}}
> is true|
> |{{fs.getFileStatus(bucketPath)}}|No|
> |{{fs.getContentSummary(bucketPath)}}|No, reports ""|
> User-visible symptom: both shell commands go through
> {{getContentSummary(bucketPath)}}, so neither shows the EC scheme of an EC
> bucket.
> * {{ozone fs -count -e /vol1/ecbucket1/}} prints {{EC:}} with an empty
> policy, same as for a RATIS bucket.
> * {{ozone fs -ls -e /vol1/}} prints no EC column for the bucket entries
> either. Hadoop's {{Ls}} calls {{getContentSummary(item.path)}} for each
> listed entry instead of using the listed status.
> The same gap exists in the o3fs adapter ({{BasicOzoneClientAdapterImpl}}),
> where {{fs.getContentSummary(new Path("/"))}} hits the same path.
> h2. Suggested fix
> Since HDDS-15925, OFS {{getFileStatus}} no longer fetches the bucket, so
> filling the policy in there would add an InfoBucket RPC to every bucket root
> {{getFileStatus}}. Instead:
> * OFS: in {{BasicRootedOzoneFileSystem#getContentSummary}}, when the path is
> a bucket, take the EC policy from the bucket's default replication config.
> That is one InfoBucket per bucket summary, small next to the recursive
> listing it already does.
> * o3fs: the adapter already holds the bucket, so
> {{BasicOzoneClientAdapterImpl#getFileStatus}} can fill in the policy for the
> root without an extra RPC.
> 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
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]