You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "Kalvin2077 (via GitHub)" <gi...@apache.org> on 2025/07/04 09:19:44 UTC

[PR] refactor remote storage configration usage. [celeborn]

Kalvin2077 opened a new pull request, #3353:
URL: https://github.com/apache/celeborn/pull/3353

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     - Make sure the PR title start w/ a JIRA ticket, e.g. '[CELEBORN-XXXX] Your PR title ...'.
     - Be sure to keep the PR description updated to reflect all changes.
     - Please write your PR title to summarize what this PR proposes.
     - If possible, provide a concise example to reproduce the issue for a faster review.
   -->
   
   ### What changes were proposed in this pull request?
   
   Refactoring similar code about configuration usage.
   
   ### Why are the changes needed?
   
   Improve scalability for possible new remote storage in the future.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Unit tests.
   
   


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#discussion_r2192760175


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -1241,6 +1241,30 @@ class CelebornConf(loadDefaults: Boolean) extends Cloneable with Logging with Se
     }.getOrElse("")
   }
 
+  def remoteStorageDirs: Option[Set[(StorageInfo.Type, String)]] = {
+    val supported = Seq(
+      (StorageInfo.Type.HDFS, HDFS_DIR, Utils.isHdfsPath _),
+      (StorageInfo.Type.S3, S3_DIR, Utils.isS3Path _),
+      (StorageInfo.Type.OSS, OSS_DIR, Utils.isOssPath _))
+
+    val activeNames = get(ACTIVE_STORAGE_TYPES)
+
+    val validDirs = supported.flatMap { case (ty, e, checker) =>
+      if (!activeNames.contains(ty.name)) None

Review Comment:
   Split activeNames to List then we can contain the exactly storage type



##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -86,27 +85,20 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs
         (new File(workdir, conf.workerWorkingDir), maxSpace, flusherThread, storageType)
       }
 
-    if (workingDirInfos.size <= 0 && !hasHDFSStorage && !hasS3Storage && !hasOssStorage) {
+    if (workingDirInfos.size <= 0 && remoteStorageDirs.isEmpty) {
       throw new IOException("Empty working directory configuration!")
     }
 
     DeviceInfo.getDeviceAndDiskInfos(workingDirInfos, conf)
   }
   val mountPoints = new util.HashSet[String](diskInfos.keySet())
-  val hdfsDiskInfo =
-    if (conf.hasHDFSStorage)
-      Option(new DiskInfo("HDFS", Long.MaxValue, 999999, 999999, 0, StorageInfo.Type.HDFS))
-    else None
-
-  val s3DiskInfo =
-    if (conf.hasS3Storage)
-      Option(new DiskInfo("S3", Long.MaxValue, 999999, 999999, 0, StorageInfo.Type.S3))
-    else None
 
-  val ossDiskInfo =
-    if (conf.hasOssStorage)
-      Option(new DiskInfo("OSS", Long.MaxValue, 999999, 999999, 0, StorageInfo.Type.OSS))
-    else None
+  val remoteDiskInfos: Option[Set[DiskInfo]] = remoteStorageDirs.flatMap { dirs =>
+    val diskInfoSet = dirs.flatMap { case (storageInfoType, _) =>

Review Comment:
   dirs.map is better?



##########
master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/AbstractMetaManager.java:
##########
@@ -287,20 +288,14 @@ public void updateWorkerHeartbeatMeta(
     long unhealthyDiskNum =
         disks.values().stream().filter(s -> !s.status().equals(DiskStatus.HEALTHY)).count();
     boolean exceed = unhealthyDiskNum * 1.0 / disks.size() >= unhealthyDiskRatioThreshold;
+    Option<scala.collection.immutable.Set<Tuple2<StorageInfo.Type, String>>> remoteStorageDirs =

Review Comment:
   Let's introduce a final variable for `conf.remoteStorageDirs().isDefined()`



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#discussion_r2234373915


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -165,6 +157,7 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs
     (flushers, totalThread)
   }
 
+  // TODO

Review Comment:
   Any update?



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "Kalvin2077 (via GitHub)" <gi...@apache.org>.
Kalvin2077 commented on code in PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#discussion_r2227852269


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -165,6 +157,7 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs
     (flushers, totalThread)
   }
 
+  // TODO

Review Comment:
   I once wanted to refactor the following code, but now I think it is too cumbersome. I will remove the `TODO` tag in the next commit. 
   Before that, I'll test the improvement of this PR on the cluster instead of only relying on unit tests.



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "Kalvin2077 (via GitHub)" <gi...@apache.org>.
Kalvin2077 commented on code in PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#discussion_r2227852269


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -165,6 +157,7 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs
     (flushers, totalThread)
   }
 
+  // TODO

Review Comment:
   I once wanted to refactor the following code, but now I think it is not necessary currently. I will remove the `TODO` tag in the next commit. 
   Before that, I'll test the improvement of this PR on the cluster instead of only relying on unit tests.



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "Kalvin2077 (via GitHub)" <gi...@apache.org>.
Kalvin2077 commented on code in PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#discussion_r2234787782


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -165,6 +157,7 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs
     (flushers, totalThread)
   }
 
+  // TODO

Review Comment:
   I has test it with only HDFS and the Celeborn can shuffle normally.
   
   The following is the test configuration:
   
   ```
   ...
   ...
   # celeborn.worker.storage.dirs /mnt/disk1/celeborn:disktype=SSD,/mnt/disk2/celeborn:disktype=SSD,/mnt/disk3/celeborn:disktype=SSD,/mnt/disk4/celeborn:disktype=SSD
   celeborn.storage.availableTypes HDFS
   celeborn.storage.hdfs.dir hdfs://master-1-1:9000/user/emr-user/celeborn
   
   celeborn.logConf.enabled true
   ```
   
   The following is the debug log from one executor:
   
   ```
   Log Type: stderr
   
   Log Upload Time: Mon Jul 28 12:39:53 +0800 2025
   
   Log Length: 19805
   
   Showing 4096 bytes of 19805 total. Click [here](http://master-1-1.c-53a05cc9683197a2.cn-hangzhou.emr.aliyuncs.com:19888/jobhistory/logs/core-1-2.c-53a05cc9683197a2.cn-hangzhou.emr.aliyuncs.com:8041/container_1753667665029_0009_01_000002/container_1753667665029_0009_01_000002/emr-user/stderr/?start=0&start.time=0&end.time=9223372036854775807) for the full log.
   
   age 0.0 (TID 12)] Executor: Finished task 12.0 in stage 0.0 (TID 12). 2498 bytes result sent to driver
   25/07/28 12:39:41 INFO [dispatcher-Executor] YarnCoarseGrainedExecutorBackend: Got assigned task 14
   25/07/28 12:39:41 INFO [Executor task launch worker for task 14.0 in stage 0.0 (TID 14)] Executor: Running task 14.0 in stage 0.0 (TID 14)
   25/07/28 12:39:41 INFO [Executor task launch worker for task 14.0 in stage 0.0 (TID 14)] HadoopRDD: Input split: hdfs://master-1-1.c-53a05cc9683197a2.cn-hangzhou.emr.aliyuncs.com:9000/user/hive/warehouse/mock.db/orders/part-00001-ec695775-417c-43d1-aeb9-89ea5766571b-c000:20394822+3399137
   25/07/28 12:39:41 INFO [Executor task launch worker for task 14.0 in stage 0.0 (TID 14)] SortBasedShuffleWriter: Memory used 40.0 MiB
   25/07/28 12:39:41 INFO [Executor task launch worker for task 14.0 in stage 0.0 (TID 14)] Executor: Finished task 14.0 in stage 0.0 (TID 14). 2498 bytes result sent to driver
   25/07/28 12:39:41 INFO [dispatcher-Executor] YarnCoarseGrainedExecutorBackend: Got assigned task 17
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] Executor: Running task 1.0 in stage 2.0 (TID 17)
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] MapOutputTrackerWorker: Updating epoch to 1 and clearing cache
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] TorrentBroadcast: Started reading broadcast variable 2 with 1 pieces (estimated total size 4.0 MiB)
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] MemoryStore: Block broadcast_2_piece0 stored as bytes in memory (estimated size 19.9 KiB, free 925.7 MiB)
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] TorrentBroadcast: Reading broadcast variable 2 took 9 ms
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] MemoryStore: Block broadcast_2 stored as values in memory (estimated size 42.2 KiB, free 925.7 MiB)
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] ShuffleClientImpl: Shuffle 0 request reducer file group success using 2486 ms, result partition size 200.
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] CelebornShuffleReader: BatchOpenStream for 101 cost 33ms
   25/07/28 12:39:44 INFO [celeborn-create-stream-thread-8] CelebornHadoopUtils: Celeborn overrides some HDFS settings defined in Hadoop configuration files, including 'fs.hdfs.impl.disable.cache=false' and 'dfs.replication=2'. It can be overridden again in Celeborn configuration with the additional prefix 'celeborn.hadoop.', e.g. 'celeborn.hadoop.dfs.replication=3'
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] CodeGenerator: Code generated in 41.724212 ms
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] CelebornShuffleReader: inputStream for partition: 99 is null, sleeping 5ms
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] CelebornShuffleReader: inputStream for partition: 99 is not null, sleep 2 times for 10 ms
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] Executor: Finished task 1.0 in stage 2.0 (TID 17). 838094 bytes result sent to driver
   25/07/28 12:39:51 INFO [dispatcher-Executor] YarnCoarseGrainedExecutorBackend: Driver commanded a shutdown
   25/07/28 12:39:51 INFO [CoarseGrainedExecutorBackend-stop-executor] RpcMetricsTracker: RPC statistics for endpoint-verifier (time unit: ns)
   current queue size = 1
   max queue length = 1
   ```
   
   PTAL @RexXiong @SteNicholas 
   



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#issuecomment-3126238231

   Thanks, merge to main(v0.7.0)


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "Kalvin2077 (via GitHub)" <gi...@apache.org>.
Kalvin2077 commented on PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#issuecomment-3050848965

   PTAL @RexXiong 


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#discussion_r2227804522


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -165,6 +157,7 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs
     (flushers, totalThread)
   }
 
+  // TODO

Review Comment:
   TODO what?



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "Kalvin2077 (via GitHub)" <gi...@apache.org>.
Kalvin2077 commented on code in PR #3353:
URL: https://github.com/apache/celeborn/pull/3353#discussion_r2234787782


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala:
##########
@@ -165,6 +157,7 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs
     (flushers, totalThread)
   }
 
+  // TODO

Review Comment:
   I has tested it with only HDFS and the Celeborn can shuffle normally.
   
   The following is the test configuration:
   
   ```
   ...
   ...
   # celeborn.worker.storage.dirs /mnt/disk1/celeborn:disktype=SSD,/mnt/disk2/celeborn:disktype=SSD,/mnt/disk3/celeborn:disktype=SSD,/mnt/disk4/celeborn:disktype=SSD
   celeborn.storage.availableTypes HDFS
   celeborn.storage.hdfs.dir hdfs://master-1-1:9000/user/emr-user/celeborn
   
   celeborn.logConf.enabled true
   ```
   
   The following is the debug log from one executor:
   
   ```
   Log Type: stderr
   
   Log Upload Time: Mon Jul 28 12:39:53 +0800 2025
   
   Log Length: 19805
   
   Showing 4096 bytes of 19805 total. Click [here](http://master-1-1.c-53a05cc9683197a2.cn-hangzhou.emr.aliyuncs.com:19888/jobhistory/logs/core-1-2.c-53a05cc9683197a2.cn-hangzhou.emr.aliyuncs.com:8041/container_1753667665029_0009_01_000002/container_1753667665029_0009_01_000002/emr-user/stderr/?start=0&start.time=0&end.time=9223372036854775807) for the full log.
   
   age 0.0 (TID 12)] Executor: Finished task 12.0 in stage 0.0 (TID 12). 2498 bytes result sent to driver
   25/07/28 12:39:41 INFO [dispatcher-Executor] YarnCoarseGrainedExecutorBackend: Got assigned task 14
   25/07/28 12:39:41 INFO [Executor task launch worker for task 14.0 in stage 0.0 (TID 14)] Executor: Running task 14.0 in stage 0.0 (TID 14)
   25/07/28 12:39:41 INFO [Executor task launch worker for task 14.0 in stage 0.0 (TID 14)] HadoopRDD: Input split: hdfs://master-1-1.c-53a05cc9683197a2.cn-hangzhou.emr.aliyuncs.com:9000/user/hive/warehouse/mock.db/orders/part-00001-ec695775-417c-43d1-aeb9-89ea5766571b-c000:20394822+3399137
   25/07/28 12:39:41 INFO [Executor task launch worker for task 14.0 in stage 0.0 (TID 14)] SortBasedShuffleWriter: Memory used 40.0 MiB
   25/07/28 12:39:41 INFO [Executor task launch worker for task 14.0 in stage 0.0 (TID 14)] Executor: Finished task 14.0 in stage 0.0 (TID 14). 2498 bytes result sent to driver
   25/07/28 12:39:41 INFO [dispatcher-Executor] YarnCoarseGrainedExecutorBackend: Got assigned task 17
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] Executor: Running task 1.0 in stage 2.0 (TID 17)
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] MapOutputTrackerWorker: Updating epoch to 1 and clearing cache
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] TorrentBroadcast: Started reading broadcast variable 2 with 1 pieces (estimated total size 4.0 MiB)
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] MemoryStore: Block broadcast_2_piece0 stored as bytes in memory (estimated size 19.9 KiB, free 925.7 MiB)
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] TorrentBroadcast: Reading broadcast variable 2 took 9 ms
   25/07/28 12:39:41 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] MemoryStore: Block broadcast_2 stored as values in memory (estimated size 42.2 KiB, free 925.7 MiB)
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] ShuffleClientImpl: Shuffle 0 request reducer file group success using 2486 ms, result partition size 200.
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] CelebornShuffleReader: BatchOpenStream for 101 cost 33ms
   25/07/28 12:39:44 INFO [celeborn-create-stream-thread-8] CelebornHadoopUtils: Celeborn overrides some HDFS settings defined in Hadoop configuration files, including 'fs.hdfs.impl.disable.cache=false' and 'dfs.replication=2'. It can be overridden again in Celeborn configuration with the additional prefix 'celeborn.hadoop.', e.g. 'celeborn.hadoop.dfs.replication=3'
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] CodeGenerator: Code generated in 41.724212 ms
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] CelebornShuffleReader: inputStream for partition: 99 is null, sleeping 5ms
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] CelebornShuffleReader: inputStream for partition: 99 is not null, sleep 2 times for 10 ms
   25/07/28 12:39:44 INFO [Executor task launch worker for task 1.0 in stage 2.0 (TID 17)] Executor: Finished task 1.0 in stage 2.0 (TID 17). 838094 bytes result sent to driver
   25/07/28 12:39:51 INFO [dispatcher-Executor] YarnCoarseGrainedExecutorBackend: Driver commanded a shutdown
   25/07/28 12:39:51 INFO [CoarseGrainedExecutorBackend-stop-executor] RpcMetricsTracker: RPC statistics for endpoint-verifier (time unit: ns)
   current queue size = 1
   max queue length = 1
   ```
   
   PTAL @RexXiong @SteNicholas 
   



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CELEBORN-2053] Refactor remote storage configration usage. [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong closed pull request #3353: [CELEBORN-2053] Refactor remote storage configration usage.
URL: https://github.com/apache/celeborn/pull/3353


-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org