RexXiong commented on code in PR #3604:
URL: https://github.com/apache/celeborn/pull/3604#discussion_r2845290014
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -436,6 +437,45 @@ final private[worker] class StorageManager(conf:
CelebornConf, workerSource: Abs
isSegmentGranularityVisible = false)
}
+ def ensureS3MultipartUploaderSharedState(): Unit = this.synchronized {
+ if (s3MultipartUploadHandlerSharedState != null)
+ return
+
+ val s3HadoopFs: FileSystem = hadoopFs.get(StorageInfo.Type.S3)
+ if (s3HadoopFs == null)
+ throw new IllegalStateException("S3 is not configured")
+
+ val uri = s3HadoopFs.getUri
+ val bucketName = uri.getHost
+ logInfo(s"Creating S3 client for $uri, bucketName is $bucketName")
+ s3MultipartUploadHandlerSharedState =
TierWriterHelper.getS3MultipartUploadHandlerSharedState(
+ s3HadoopFs,
+ bucketName,
+ conf.s3MultiplePartUploadMaxRetries,
+ conf.s3MultiplePartUploadBaseDelay,
+ conf.s3MultiplePartUploadMaxBackoff)
+ }
+
+ /**
+ * Ensure that the directory for the Shuffle exists.
+ * This method is not synchronized because from the protocol it is not
expected
Review Comment:
IMO, there could be situations where concurrent creation happens for the
same shuffleId. However, I agree that running this code concurrently should not
cause any issues.And If we add synchronization to
ensureS3DirectoryForShuffleKey, it will also block other shuffle directory
creations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]