[ 
https://issues.apache.org/jira/browse/HADOOP-20086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144336#comment-18144336
 ] 

ASF GitHub Bot commented on HADOOP-20086:
-----------------------------------------

gbloisi-openaire opened a new pull request, #8990:
URL: https://github.com/apache/hadoop/pull/8990

   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 
'HADOOP-17799. Your PR title ...'.
       3. The "Build" check on your PR mirrors CI that runs in your own fork. 
Enable GitHub Actions in your fork before your first push: 
https://github.com/apache/hadoop/blob/trunk/.github/pr-build-check.md
   -->
   
   ### Description of PR
   Add the option fs.s3a.committer.magic.tmp.path. When it is set, the magic 
committer keeps its job and job attempt directories, including the per-task 
.pendingset files, under that path (e.g. on HDFS) rather than under the 
destination in S3. Task commit and job commit then save, list and read 
.pendingset files without any S3 requests. If the option is unset, these 
directories stay under the destination.
   
   Task output is still written under the __magic path of the destination, as 
the S3A filesystem needs that path to turn writes into delayed multipart 
uploads. To keep the per-file .pending data out of S3 as well, also set 
fs.s3a.committer.magic.track.commits.in.memory.enabled.
   
   MagicS3GuardCommitter:
   * Get the filesystem of the job directories from their path, as 
getDestinationFS() only accepts S3A.
   * Create the job attempt directory in setupJob(), so that job commit can 
list it when no task has saved anything there. This was previously created 
implicitly by task output under the same path in S3.
   * Clean up the magic directory under the destination as well as the job 
directory in the configured path.
   * Skip the S3 create and delete of the task attempt directory when commits 
are tracked in memory, as nothing is saved there.
   
   AbstractS3ACommitter:
   * Add prepareTaskAttemptPath() as an extension point for task setup.
   * Remove the abstract getTempTaskAttemptPath(), now only defined by 
MagicS3GuardCommitter, and the unsupported override in StagingCommitter.
   * Make jobSetup protected.
   
   ### How was this patch tested?
   ITestMagicCommitProtocol now runs with and without the new option, using a 
local filesystem directory as the cluster filesystem. It adds a test that the 
.pendingset files are saved in the job attempt directory and not in S3. Run 
against LocalStack S3 and not yet against AWS S3 or HDFS.
   Tested in production cluster against an S3 service backed up by CEPH and 
fs.s3a.committer.magic.tmp.path pointing to a local hdfs folder.
   
   ### For code changes:
   
   - [x] Does the title of this PR start with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [x] Object storage: Have the integration tests been executed and the 
endpoint
         declared according to the connector-specific documentation? *Note: 
Automated CI
         testing doesn't cover all cases so manual testing with cloud storage 
is still
         required.*
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   ### AI Tooling
   
   If an AI tool was used:
   
   - [x] The PR includes the phrase "Contains content generated by <tool>"
         where <tool> is the name of the AI tool used.
   - [x] My use of AI contributions follows the ASF legal policy
         https://www.apache.org/legal/generative-tooling.html
   
   Contains content generated by Claude Code Opus 5.5.




> S3A magic committer: option to save job data in a cluster filesystem with 
> fs.s3a.committer.magic.tmp.path
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-20086
>                 URL: https://issues.apache.org/jira/browse/HADOOP-20086
>             Project: Hadoop Common
>          Issue Type: New Feature
>          Components: cloud-storage
>    Affects Versions: 3.5.0
>            Reporter: Giambattista Bloisi
>            Priority: Major
>
> The S3A magic committer keeps all its job data in S3, under {{__magic}} in 
> the destination. That includes the job and job attempt directories and the 
> {{.pendingset}} file each task saves when it commits. So every task commit 
> writes an object to S3, and job commit lists the job attempt directory in S3 
> and reads every {{.pendingset}} back from it.
> These are small objects on the commit path, which is where jobs are most 
> sensitive to latency. A job with many tasks makes many S3 PUT, LIST and GET 
> requests just for commit bookkeeping. On some S3-compatible stores this also 
> runs into request throttling or listing consistency limits. The data is 
> temporary and only used inside the job, so it doesn't need to be in S3; the 
> job's cluster filesystem (e.g. HDFS) is a better place for it.
> *Proposal:* add the option {{fs.s3a.committer.magic.tmp.path}}. When it is 
> set, the magic committer keeps its job and job attempt directories, including 
> the {{.pendingset}} files, under that path instead of under the destination. 
> Task commit and job commit then save, list and read {{.pendingset}} files 
> without any S3 requests. When it is unset, nothing changes.
> Task output is still written under {{__magic}} in the destination, as the S3A 
> filesystem needs that path to turn writes into delayed multipart uploads. To 
> keep the per-file {{.pending}} data out of S3 too, also set 
> {{fs.s3a.committer.magic.track.commits.in.memory.enabled}}.
> {code:xml}
> <property>
>   <name>fs.s3a.committer.magic.tmp.path</name>
>   <value>hdfs://cluster/tmp/s3a-magic</value>
> </property>
> <property>
>   <name>fs.s3a.committer.magic.track.commits.in.memory.enabled</name>
>   <value>true</value>
> </property>
> {code}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to