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

[GitHub] [incubator-celeborn] cfmcgrady opened a new pull request, #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

cfmcgrady opened a new pull request, #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932

   <!--
   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?
   
   The `ReusedExchange` operator has the potential to generate different types of fetch requests, including both non-range and range requests. Currently, an issue arises due to the synchronous deletion of the original file by the Celeborn worker upon completion of sorting. This issue leads to the failure of non-range requests following a range request for the same partition.
   
   the snippets to reproduce this bug
   ```scala
     val sparkConf = new SparkConf().setAppName("celeborn-test").setMaster("local[2]")
       .set("spark.shuffle.manager", "org.apache.spark.shuffle.celeborn.SparkShuffleManager")
       .set(s"spark.${CelebornConf.MASTER_ENDPOINTS.key}", masterInfo._1.rpcEnv.address.toString)
       .set("spark.sql.autoBroadcastJoinThreshold", "-1")
       .set("spark.sql.adaptive.skewJoin.skewedPartitionThresholdInBytes", "100")
       .set("spark.sql.adaptive.advisoryPartitionSizeInBytes", "100")
     val spark = SparkSession.builder()
       .config(sparkConf)
       .getOrCreate()
     spark.range(0, 1000, 1, 10)
       .selectExpr("id as k1", "id as v1")
       .createOrReplaceTempView("ta")
     spark.range(0, 1000, 1, 10)
       .selectExpr("id % 1 as k21", "id % 1 as k22", "id as v2")
       .createOrReplaceTempView("tb")
     spark.range(140)
       .select(
         col("id").cast("long").as("k3"),
         concat(col("id").cast("string"), lit("a")).as("v3"))
       .createOrReplaceTempView("tc")
   
     spark.sql(
       """
         |SELECT *
         |FROM ta
         |LEFT JOIN tb ON ta.k1 = tb.k21
         |LEFT JOIN tc ON tb.k22 = tc.k3
         |""".stripMargin)
       .createOrReplaceTempView("v1")
   
     spark.sql(
       """
         |SELECT * FROM v1 WHERE v3 IS NOT NULL
         |UNION
         |SELECT * FROM v1
         |""".stripMargin)
       .collect()
   ```
   
   This PR proposes a solution to address this problem. It introduces an asynchronous thread for the removal of the original file. Once the sorted file is generated for a given partition, this modification ensures that both non-range and range fetch requests will be able to and only fetch the sorted file once it is generated for a given partition.
   
   
   this activity diagram of `openStream`
   
   ![openStream](http://www.plantuml.com/plantuml/dpng/hLJ1RXiX4Btp5TDRVCa7U0_9eOfYgL8Fbdf7sO6WODWEixAgoFzU5Zn6MsHr3xdOQ7apRzvxm7DYJJoVlFesaROd3NF2NqZithG_68X15OJQ_vmm79bGdmOrwGnW5mFSLkaOYP4UBN9PZI_Euo6O29yAm1buS0b81uj0gCUd7V0x1dW8SPVtRuXKQi7aOh0Oa3HZ0__1LD40UqAUARI2oZRKRVG9M--6ZkIi2zh_WySmEgEaJ5Y-TgPk91_VFWhK1ViZhojCM6K7pf4-m6MdALh2b3hdIZCzZi1nALfgViyuO-tNYMfgIw4Xn7uA89nGSrstaAiooWCi6S9dun_ZCjNQtuAMAKIm8EHuF5Qp6dM19kGE2HKfA9bzGyEBY3rhLpmraVgGccmul-UlTxD_sf2tk2p_5xMNSaZb5Xso4lMVUz6SxsNcnEjrB35ijlVAA3YpmlMdUhlDpGwZVSBkqCif5VN0iMzQDzEWDXCtMgOPrzPVLDLxtpkHMqQ-3ddp_DwBDYWHjb3kRXbZksZbWwIRWz6-fIls5dnx6r-_lnpN-vL5D5gN6Ebgtz18owzuK5MzwZ1wf44bZfDwpf3bWLT_0G00)
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, only bug fix
   
   ### How was this patch tested?
   
   UT


-- 
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


[GitHub] [incubator-celeborn] FMX commented on a diff in pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

Posted by "FMX (via GitHub)" <gi...@apache.org>.
FMX commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1333829833


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/FetchHandler.scala:
##########
@@ -96,130 +95,140 @@ class FetchHandler(val conf: CelebornConf, val transportConf: TransportConf)
       case r: ChunkFetchRequest =>
         handleChunkFetchRequest(client, r)
       case r: RpcRequest =>
-        // process PbOpenStream RPC
-        var streamShuffleKey: String = null
-        var streamFileName: String = null
-        try {
-          val pbMsg = TransportMessage.fromByteBuffer(r.body().nioByteBuffer())
-          val pbOpenStream = pbMsg.getParsedPayload[PbOpenStream]
-          val (shuffleKey, fileName, startIndex, endIndex, initialCredit, readLocalShuffle) =
-            (
-              pbOpenStream.getShuffleKey,
-              pbOpenStream.getFileName,
-              pbOpenStream.getStartIndex,
-              pbOpenStream.getEndIndex,
-              pbOpenStream.getInitialCredit,
-              pbOpenStream.getReadLocalShuffle)
-          streamShuffleKey = shuffleKey
-          streamFileName = fileName
-          workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-          handleOpenStreamInternal(
-            client,
-            shuffleKey,
-            fileName,
-            startIndex,
-            endIndex,
-            initialCredit,
-            r,
-            false,
-            readLocalShuffle)
-        } catch {
-          case _: Exception =>
-            // process legacy OpenStream RPCs
-            logDebug("Open stream with legacy RPCs")
-            try {
-              val decodedMsg = Message.decode(r.body().nioByteBuffer())
-              val (shuffleKey, fileName) =
-                if (decodedMsg.`type`() == Type.OPEN_STREAM) {
-                  val openStream = decodedMsg.asInstanceOf[OpenStream]
-                  (
-                    new String(openStream.shuffleKey, StandardCharsets.UTF_8),
-                    new String(openStream.fileName, StandardCharsets.UTF_8))
-                } else {
-                  val openStreamWithCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit]
-                  (
-                    new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
-                    new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8))
-                }
-              streamShuffleKey = shuffleKey
-              streamFileName = fileName
-              var startIndex = 0
-              var endIndex = 0
-              var initialCredit = 0
-              getRawFileInfo(shuffleKey, fileName).getPartitionType match {
-                case PartitionType.REDUCE =>
-                  startIndex = decodedMsg.asInstanceOf[OpenStream].startMapIndex
-                  endIndex = decodedMsg.asInstanceOf[OpenStream].endMapIndex
-                case PartitionType.MAP =>
-                  initialCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit].initialCredit
-                  startIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].startIndex
-                  endIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].endIndex
-                case PartitionType.MAPGROUP =>
-              }
-              handleOpenStreamInternal(
-                client,
-                shuffleKey,
-                fileName,
-                startIndex,
-                endIndex,
-                initialCredit,
-                r,
-                true)
-            } catch {
-              case e: IOException =>
-                handleRpcIOException(client, r.requestId, streamShuffleKey, streamFileName, e)
-            }
-        } finally {
-          r.body().release()
-          workerSource.stopTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-        }
+        handleRpcRequest(client, r)
       case unknown: RequestMessage =>
         throw new IllegalArgumentException(s"Unknown message type id: ${unknown.`type`.id}")
     }
   }
 
+  private def handleRpcRequest(client: TransportClient, rpcRequest: RpcRequest): Unit = {

Review Comment:
   I think this change is unnecessary. There is a discussion about  about the code style of this block.



##########
common/src/main/java/org/apache/celeborn/common/meta/FileInfo.java:
##########
@@ -265,4 +277,33 @@ public boolean isPartitionSplitEnabled() {
   public void setPartitionSplitEnabled(boolean partitionSplitEnabled) {
     this.partitionSplitEnabled = partitionSplitEnabled;
   }
+
+  public void setSorted() {
+    synchronized (sorted) {
+      sorted.set(true);
+    }
+  }
+
+  public boolean addStream(long streamId) {
+    synchronized (sorted) {
+      if (sorted.get()) {
+        return false;
+      } else {
+        streams.add(streamId);
+        return true;
+      }
+    }
+  }
+
+  public void closeStream(long streamId) {
+    synchronized (sorted) {

Review Comment:
   ditto.



##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/PartitionFilesSorter.java:
##########
@@ -696,4 +722,68 @@ private void readBufferBySize(ByteBuffer buffer, int toRead) throws IOException
       }
     }
   }
+
+  public void cleanupExpiredShuffleKey(Set<String> expiredShuffleKeys) {
+    cleaner.cleanupExpiredShuffleKey(expiredShuffleKeys);
+  }
+}
+
+class PartitionFilesCleaner {
+  private static final Logger logger = LoggerFactory.getLogger(PartitionFilesCleaner.class);
+
+  private final LinkedBlockingQueue<PartitionFilesSorter.FileSorter> queue =
+      new LinkedBlockingQueue<>();
+  private final Lock lock = new ReentrantLock();
+  private final Condition notEmpty = lock.newCondition();
+
+  PartitionFilesCleaner() {
+    Thread cleaner =
+        new Thread(
+            () -> {
+              while (true) {
+                try {
+                  lock.lockInterruptibly();
+                  while (queue.isEmpty()) {
+                    notEmpty.await(500, TimeUnit.MILLISECONDS);
+                  }
+                  Iterator<PartitionFilesSorter.FileSorter> it = queue.iterator();
+                  while (it.hasNext()) {
+                    PartitionFilesSorter.FileSorter sorter = it.next();
+                    try {
+                      if (sorter.getOriginFileInfo().isStreamsEmpty()) {

Review Comment:
   If there is no non skew streams, the origin file can be deleted. I think it's good to record all stream in fileinfo, I'll need it in supporting memory storage.



##########
common/src/main/java/org/apache/celeborn/common/meta/FileInfo.java:
##########
@@ -265,4 +277,33 @@ public boolean isPartitionSplitEnabled() {
   public void setPartitionSplitEnabled(boolean partitionSplitEnabled) {
     this.partitionSplitEnabled = partitionSplitEnabled;
   }
+
+  public void setSorted() {
+    synchronized (sorted) {

Review Comment:
   This syncrhonize block is redundant.



-- 
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


[GitHub] [incubator-celeborn] cfmcgrady commented on a diff in pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1333863603


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/FetchHandler.scala:
##########
@@ -96,130 +95,140 @@ class FetchHandler(val conf: CelebornConf, val transportConf: TransportConf)
       case r: ChunkFetchRequest =>
         handleChunkFetchRequest(client, r)
       case r: RpcRequest =>
-        // process PbOpenStream RPC
-        var streamShuffleKey: String = null
-        var streamFileName: String = null
-        try {
-          val pbMsg = TransportMessage.fromByteBuffer(r.body().nioByteBuffer())
-          val pbOpenStream = pbMsg.getParsedPayload[PbOpenStream]
-          val (shuffleKey, fileName, startIndex, endIndex, initialCredit, readLocalShuffle) =
-            (
-              pbOpenStream.getShuffleKey,
-              pbOpenStream.getFileName,
-              pbOpenStream.getStartIndex,
-              pbOpenStream.getEndIndex,
-              pbOpenStream.getInitialCredit,
-              pbOpenStream.getReadLocalShuffle)
-          streamShuffleKey = shuffleKey
-          streamFileName = fileName
-          workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-          handleOpenStreamInternal(
-            client,
-            shuffleKey,
-            fileName,
-            startIndex,
-            endIndex,
-            initialCredit,
-            r,
-            false,
-            readLocalShuffle)
-        } catch {
-          case _: Exception =>
-            // process legacy OpenStream RPCs
-            logDebug("Open stream with legacy RPCs")
-            try {
-              val decodedMsg = Message.decode(r.body().nioByteBuffer())
-              val (shuffleKey, fileName) =
-                if (decodedMsg.`type`() == Type.OPEN_STREAM) {
-                  val openStream = decodedMsg.asInstanceOf[OpenStream]
-                  (
-                    new String(openStream.shuffleKey, StandardCharsets.UTF_8),
-                    new String(openStream.fileName, StandardCharsets.UTF_8))
-                } else {
-                  val openStreamWithCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit]
-                  (
-                    new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
-                    new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8))
-                }
-              streamShuffleKey = shuffleKey
-              streamFileName = fileName
-              var startIndex = 0
-              var endIndex = 0
-              var initialCredit = 0
-              getRawFileInfo(shuffleKey, fileName).getPartitionType match {
-                case PartitionType.REDUCE =>
-                  startIndex = decodedMsg.asInstanceOf[OpenStream].startMapIndex
-                  endIndex = decodedMsg.asInstanceOf[OpenStream].endMapIndex
-                case PartitionType.MAP =>
-                  initialCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit].initialCredit
-                  startIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].startIndex
-                  endIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].endIndex
-                case PartitionType.MAPGROUP =>
-              }
-              handleOpenStreamInternal(
-                client,
-                shuffleKey,
-                fileName,
-                startIndex,
-                endIndex,
-                initialCredit,
-                r,
-                true)
-            } catch {
-              case e: IOException =>
-                handleRpcIOException(client, r.requestId, streamShuffleKey, streamFileName, e)
-            }
-        } finally {
-          r.body().release()
-          workerSource.stopTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-        }
+        handleRpcRequest(client, r)
       case unknown: RequestMessage =>
         throw new IllegalArgumentException(s"Unknown message type id: ${unknown.`type`.id}")
     }
   }
 
+  private def handleRpcRequest(client: TransportClient, rpcRequest: RpcRequest): Unit = {

Review Comment:
   Emm...it's to improve the code readability.



-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1349823284


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/PartitionFilesSorter.java:
##########
@@ -166,31 +171,43 @@ public long getSortedSize() {
     return sortedFilesSize.get();
   }
 
+  // For non-range requests:
+  //   1. If the sorted file is not generated, it returns the original unsorted FileInfo.
+  //   2. If the sorted file is generated, it returns the sorted FileInfo.
+  //
+  // For range requests:
+  //   1. If the sorted file is not generated, it adds the FileSorter task to the sorting queue and
+  //      synchronously waits for the sorted FileInfo.
+  //   2. If the FileSorter task is already in the sorting queue but the sorted file has not been
+  //      generated, it awaits until a timeout occurs (default 220 seconds).
+  //   3. If the sorted file is generated, it returns the sorted FileInfo.
   public FileInfo getSortedFileInfo(
       String shuffleKey, String fileName, FileInfo fileInfo, int startMapIndex, int endMapIndex)
       throws IOException {
     String fileId = shuffleKey + "-" + fileName;
     UserIdentifier userIdentifier = fileInfo.getUserIdentifier();
-
+    // not a range read and the sorted file not generate now
+    if (endMapIndex == Integer.MAX_VALUE && !sortedShuffleFiles.containsKey(shuffleKey)) {

Review Comment:
   improved using Option 2.



-- 
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


[GitHub] [incubator-celeborn] cfmcgrady commented on pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

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

   the `openStream` has become complex enough.
   


-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1349822610


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/FetchHandler.scala:
##########
@@ -97,137 +95,142 @@ class FetchHandler(val conf: CelebornConf, val transportConf: TransportConf)
       case r: ChunkFetchRequest =>
         handleChunkFetchRequest(client, r)
       case r: RpcRequest =>
-        var streamShuffleKey: String = null
-        try {
-          val pbMsg = TransportMessage.fromByteBuffer(
-            r.body().nioByteBuffer()).getParsedPayload.asInstanceOf[GeneratedMessageV3]
-          pbMsg match {
-            case pb: PbBufferStreamEnd => handleEndStreamFromClient(pb.getStreamId)
-            case pb: PbReadAddCredit => handleReadAddCredit(pb.getCredit, pb.getStreamId)
-            case pb: PbOpenStream =>
-              val (shuffleKey, fileName, startIndex, endIndex, initialCredit, readLocalShuffle) =
-                (
-                  pb.getShuffleKey,
-                  pb.getFileName,
-                  pb.getStartIndex,
-                  pb.getEndIndex,
-                  pb.getInitialCredit,
-                  pb.getReadLocalShuffle)
-              streamShuffleKey = shuffleKey
-              workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-              handleOpenStreamInternal(
-                client,
-                shuffleKey,
-                fileName,
-                startIndex,
-                endIndex,
-                initialCredit,
-                r,
-                false,
-                readLocalShuffle)
-          }
-        } catch {
-          case _: Exception =>
-            logDebug("Legacy RPCs")
-            val decodedMsg = Message.decode(r.body().nioByteBuffer())
-            val msgType = decodedMsg.`type`()
-            if (msgType == Type.OPEN_STREAM || msgType == Type.OPEN_STREAM_WITH_CREDIT) {
-              var streamFileName: String = null
-              try {
-                val (shuffleKey, fileName) =
-                  if (msgType == Type.OPEN_STREAM) {
-                    val openStream = decodedMsg.asInstanceOf[OpenStream]
-                    (
-                      new String(openStream.shuffleKey, StandardCharsets.UTF_8),
-                      new String(openStream.fileName, StandardCharsets.UTF_8))
-                  } else {
-                    val openStreamWithCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit]
-                    (
-                      new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
-                      new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8))
-                  }
-                streamShuffleKey = shuffleKey
-                streamFileName = fileName
-                var startIndex = 0
-                var endIndex = 0
-                var initialCredit = 0
-                getRawFileInfo(shuffleKey, fileName).getPartitionType match {
-                  case PartitionType.REDUCE =>
-                    startIndex = decodedMsg.asInstanceOf[OpenStream].startMapIndex
-                    endIndex = decodedMsg.asInstanceOf[OpenStream].endMapIndex
-                  case PartitionType.MAP =>
-                    initialCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit].initialCredit
-                    startIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].startIndex
-                    endIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].endIndex
-                  case PartitionType.MAPGROUP =>
-                }
-                handleOpenStreamInternal(
-                  client,
-                  shuffleKey,
-                  fileName,
-                  startIndex,
-                  endIndex,
-                  initialCredit,
-                  r,
-                  true)
-              } catch {
-                case e: IOException =>
-                  handleRpcIOException(client, r.requestId, streamShuffleKey, streamFileName, e)
-              }
-            }
-        } finally {
-          r.body().release()
-          if (streamShuffleKey != null) {
-            workerSource.stopTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-          }
-        }
+        handleRpcRequest(client, r)
       case unknown: RequestMessage =>
         throw new IllegalArgumentException(s"Unknown message type id: ${unknown.`type`.id}")
     }
   }
 
+  private def handleRpcRequest(client: TransportClient, rpcRequest: RpcRequest): Unit = {
+    try {
+      var message: GeneratedMessageV3 = null
+      try {
+        message = TransportMessage.fromByteBuffer(rpcRequest.body().nioByteBuffer())
+          .getParsedPayload[GeneratedMessageV3]
+      } catch {
+        case exception: CelebornIOException =>
+          logWarning("Handle request with legacy RPCs", exception)
+          return handleLegacyRpcMessage(client, rpcRequest)
+      }
+      message match {
+        case openStream: PbOpenStream =>
+          handleOpenStreamInternal(
+            client,
+            openStream.getShuffleKey,
+            openStream.getFileName,
+            openStream.getStartIndex,
+            openStream.getEndIndex,
+            openStream.getInitialCredit,
+            rpcRequest.requestId,
+            isLegacy = false,
+            openStream.getReadLocalShuffle)
+        case bufferStreamEnd: PbBufferStreamEnd =>
+          handleEndStreamFromClient(bufferStreamEnd)
+        case readAddCredit: PbReadAddCredit =>
+          handleReadAddCredit(readAddCredit.getCredit, readAddCredit.getStreamId)
+        case message: GeneratedMessageV3 =>
+          logError(s"Unknown message $message")
+      }
+    } finally {
+      rpcRequest.body().release()
+    }
+  }
+
+  private def handleLegacyRpcMessage(client: TransportClient, rpcRequest: RpcRequest): Unit = {
+    try {
+      val message = Message.decode(rpcRequest.body().nioByteBuffer())
+      message.`type`() match {
+        case Message.Type.OPEN_STREAM =>
+          val openStream = message.asInstanceOf[OpenStream]
+          handleOpenStreamInternal(
+            client,
+            new String(openStream.shuffleKey, StandardCharsets.UTF_8),
+            new String(openStream.fileName, StandardCharsets.UTF_8),
+            openStream.startMapIndex,
+            openStream.endMapIndex,
+            initialCredit = 0,
+            rpcRequestId = rpcRequest.requestId,
+            isLegacy = true,
+            // legacy [[OpenStream]] doesn't support read local shuffle
+            readLocalShuffle = false)
+        case Message.Type.OPEN_STREAM_WITH_CREDIT =>
+          val openStreamWithCredit = message.asInstanceOf[OpenStreamWithCredit]
+          handleOpenStreamInternal(
+            client,
+            new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
+            new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8),
+            openStreamWithCredit.startIndex,
+            openStreamWithCredit.endIndex,
+            openStreamWithCredit.initialCredit,
+            rpcRequestId = rpcRequest.requestId,
+            isLegacy = true,
+            readLocalShuffle = false)
+        case _ =>
+          logError(s"Received an unknown message type id: ${message.`type`.id}")
+      }
+    } catch {
+      case e: Exception =>
+        logError("Catch an error when handle legacy rpc message.", e)
+    }
+
+  }
+
   private def handleOpenStreamInternal(
       client: TransportClient,
       shuffleKey: String,
       fileName: String,
       startIndex: Int,
       endIndex: Int,
       initialCredit: Int,
-      request: RpcRequest,
+      rpcRequestId: Long,
       isLegacy: Boolean,
       readLocalShuffle: Boolean = false): Unit = {
+    workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, shuffleKey)
     try {
       var fileInfo = getRawFileInfo(shuffleKey, fileName)
       fileInfo.getPartitionType match {
         case PartitionType.REDUCE =>
-          if (endIndex != Integer.MAX_VALUE) {
+          val streamId = chunkStreamManager.nextStreamId()
+          fileInfo = partitionsSorter.getSortedFileInfo(
+            shuffleKey,
+            fileName,
+            fileInfo,
+            startIndex,
+            endIndex)
+          // non-range openStream request
+          if (endIndex == Int.MaxValue && !fileInfo.addStream(streamId)) {

Review Comment:
   we also need to return the sorted file information for range openStream requests.



-- 
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


[GitHub] [incubator-celeborn] cfmcgrady commented on a diff in pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1333861542


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/PartitionFilesSorter.java:
##########
@@ -696,4 +722,68 @@ private void readBufferBySize(ByteBuffer buffer, int toRead) throws IOException
       }
     }
   }
+
+  public void cleanupExpiredShuffleKey(Set<String> expiredShuffleKeys) {
+    cleaner.cleanupExpiredShuffleKey(expiredShuffleKeys);
+  }
+}
+
+class PartitionFilesCleaner {
+  private static final Logger logger = LoggerFactory.getLogger(PartitionFilesCleaner.class);
+
+  private final LinkedBlockingQueue<PartitionFilesSorter.FileSorter> queue =
+      new LinkedBlockingQueue<>();
+  private final Lock lock = new ReentrantLock();
+  private final Condition notEmpty = lock.newCondition();
+
+  PartitionFilesCleaner() {
+    Thread cleaner =
+        new Thread(
+            () -> {
+              while (true) {
+                try {
+                  lock.lockInterruptibly();
+                  while (queue.isEmpty()) {
+                    notEmpty.await(500, TimeUnit.MILLISECONDS);
+                  }
+                  Iterator<PartitionFilesSorter.FileSorter> it = queue.iterator();
+                  while (it.hasNext()) {
+                    PartitionFilesSorter.FileSorter sorter = it.next();
+                    try {
+                      if (sorter.getOriginFileInfo().isStreamsEmpty()) {

Review Comment:
   the relations between `stream` and `fileinfo`:
   
   for non-skew streams(non-range open stream request), it's `n` to `1`:
   
   ```
   non-range stream id1
   non-range stream id2  --->  original unsorted FileInfo A
   non-range stream id3
   ```
   
   for skew streams(range open stream request), it's `1` to `1`,  this is because we don't manage the sorted fileInfos within `StorageManager`:
   
   
   
   ```
   range stream id4  --->  sorted FileInfo B
   range stream id5  --->  sorted FileInfo C
   range stream id6  --->  sorted FileInfo D
   ```



-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

Posted by "waitinfuture (via GitHub)" <gi...@apache.org>.
waitinfuture commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1349485058


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/PartitionFilesSorter.java:
##########
@@ -166,31 +171,43 @@ public long getSortedSize() {
     return sortedFilesSize.get();
   }
 
+  // For non-range requests:
+  //   1. If the sorted file is not generated, it returns the original unsorted FileInfo.
+  //   2. If the sorted file is generated, it returns the sorted FileInfo.
+  //
+  // For range requests:
+  //   1. If the sorted file is not generated, it adds the FileSorter task to the sorting queue and
+  //      synchronously waits for the sorted FileInfo.
+  //   2. If the FileSorter task is already in the sorting queue but the sorted file has not been
+  //      generated, it awaits until a timeout occurs (default 220 seconds).
+  //   3. If the sorted file is generated, it returns the sorted FileInfo.
   public FileInfo getSortedFileInfo(
       String shuffleKey, String fileName, FileInfo fileInfo, int startMapIndex, int endMapIndex)
       throws IOException {
     String fileId = shuffleKey + "-" + fileName;
     UserIdentifier userIdentifier = fileInfo.getUserIdentifier();
-
+    // not a range read and the sorted file not generate now
+    if (endMapIndex == Integer.MAX_VALUE && !sortedShuffleFiles.containsKey(shuffleKey)) {

Review Comment:
   To check whether the sorted file has been generated, should also check the sorted set
   ```
       if (endMapIndex == Integer.MAX_VALUE && !sortedShuffleFiles.containsKey(shuffleKey) &&
         !sortedShuffleFiles.get(shuffleKey).contains(fileId)) {
         return fileInfo;
       }
   ```
   Or else, do not call `getSortedFileInfo` if endMapIndex is max int.



##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/FetchHandler.scala:
##########
@@ -97,137 +95,142 @@ class FetchHandler(val conf: CelebornConf, val transportConf: TransportConf)
       case r: ChunkFetchRequest =>
         handleChunkFetchRequest(client, r)
       case r: RpcRequest =>
-        var streamShuffleKey: String = null
-        try {
-          val pbMsg = TransportMessage.fromByteBuffer(
-            r.body().nioByteBuffer()).getParsedPayload.asInstanceOf[GeneratedMessageV3]
-          pbMsg match {
-            case pb: PbBufferStreamEnd => handleEndStreamFromClient(pb.getStreamId)
-            case pb: PbReadAddCredit => handleReadAddCredit(pb.getCredit, pb.getStreamId)
-            case pb: PbOpenStream =>
-              val (shuffleKey, fileName, startIndex, endIndex, initialCredit, readLocalShuffle) =
-                (
-                  pb.getShuffleKey,
-                  pb.getFileName,
-                  pb.getStartIndex,
-                  pb.getEndIndex,
-                  pb.getInitialCredit,
-                  pb.getReadLocalShuffle)
-              streamShuffleKey = shuffleKey
-              workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-              handleOpenStreamInternal(
-                client,
-                shuffleKey,
-                fileName,
-                startIndex,
-                endIndex,
-                initialCredit,
-                r,
-                false,
-                readLocalShuffle)
-          }
-        } catch {
-          case _: Exception =>
-            logDebug("Legacy RPCs")
-            val decodedMsg = Message.decode(r.body().nioByteBuffer())
-            val msgType = decodedMsg.`type`()
-            if (msgType == Type.OPEN_STREAM || msgType == Type.OPEN_STREAM_WITH_CREDIT) {
-              var streamFileName: String = null
-              try {
-                val (shuffleKey, fileName) =
-                  if (msgType == Type.OPEN_STREAM) {
-                    val openStream = decodedMsg.asInstanceOf[OpenStream]
-                    (
-                      new String(openStream.shuffleKey, StandardCharsets.UTF_8),
-                      new String(openStream.fileName, StandardCharsets.UTF_8))
-                  } else {
-                    val openStreamWithCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit]
-                    (
-                      new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
-                      new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8))
-                  }
-                streamShuffleKey = shuffleKey
-                streamFileName = fileName
-                var startIndex = 0
-                var endIndex = 0
-                var initialCredit = 0
-                getRawFileInfo(shuffleKey, fileName).getPartitionType match {
-                  case PartitionType.REDUCE =>
-                    startIndex = decodedMsg.asInstanceOf[OpenStream].startMapIndex
-                    endIndex = decodedMsg.asInstanceOf[OpenStream].endMapIndex
-                  case PartitionType.MAP =>
-                    initialCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit].initialCredit
-                    startIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].startIndex
-                    endIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].endIndex
-                  case PartitionType.MAPGROUP =>
-                }
-                handleOpenStreamInternal(
-                  client,
-                  shuffleKey,
-                  fileName,
-                  startIndex,
-                  endIndex,
-                  initialCredit,
-                  r,
-                  true)
-              } catch {
-                case e: IOException =>
-                  handleRpcIOException(client, r.requestId, streamShuffleKey, streamFileName, e)
-              }
-            }
-        } finally {
-          r.body().release()
-          if (streamShuffleKey != null) {
-            workerSource.stopTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-          }
-        }
+        handleRpcRequest(client, r)
       case unknown: RequestMessage =>
         throw new IllegalArgumentException(s"Unknown message type id: ${unknown.`type`.id}")
     }
   }
 
+  private def handleRpcRequest(client: TransportClient, rpcRequest: RpcRequest): Unit = {
+    try {
+      var message: GeneratedMessageV3 = null
+      try {
+        message = TransportMessage.fromByteBuffer(rpcRequest.body().nioByteBuffer())
+          .getParsedPayload[GeneratedMessageV3]
+      } catch {
+        case exception: CelebornIOException =>
+          logWarning("Handle request with legacy RPCs", exception)
+          return handleLegacyRpcMessage(client, rpcRequest)
+      }
+      message match {
+        case openStream: PbOpenStream =>
+          handleOpenStreamInternal(
+            client,
+            openStream.getShuffleKey,
+            openStream.getFileName,
+            openStream.getStartIndex,
+            openStream.getEndIndex,
+            openStream.getInitialCredit,
+            rpcRequest.requestId,
+            isLegacy = false,
+            openStream.getReadLocalShuffle)
+        case bufferStreamEnd: PbBufferStreamEnd =>
+          handleEndStreamFromClient(bufferStreamEnd)
+        case readAddCredit: PbReadAddCredit =>
+          handleReadAddCredit(readAddCredit.getCredit, readAddCredit.getStreamId)
+        case message: GeneratedMessageV3 =>
+          logError(s"Unknown message $message")
+      }
+    } finally {
+      rpcRequest.body().release()
+    }
+  }
+
+  private def handleLegacyRpcMessage(client: TransportClient, rpcRequest: RpcRequest): Unit = {
+    try {
+      val message = Message.decode(rpcRequest.body().nioByteBuffer())
+      message.`type`() match {
+        case Message.Type.OPEN_STREAM =>
+          val openStream = message.asInstanceOf[OpenStream]
+          handleOpenStreamInternal(
+            client,
+            new String(openStream.shuffleKey, StandardCharsets.UTF_8),
+            new String(openStream.fileName, StandardCharsets.UTF_8),
+            openStream.startMapIndex,
+            openStream.endMapIndex,
+            initialCredit = 0,
+            rpcRequestId = rpcRequest.requestId,
+            isLegacy = true,
+            // legacy [[OpenStream]] doesn't support read local shuffle
+            readLocalShuffle = false)
+        case Message.Type.OPEN_STREAM_WITH_CREDIT =>
+          val openStreamWithCredit = message.asInstanceOf[OpenStreamWithCredit]
+          handleOpenStreamInternal(
+            client,
+            new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
+            new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8),
+            openStreamWithCredit.startIndex,
+            openStreamWithCredit.endIndex,
+            openStreamWithCredit.initialCredit,
+            rpcRequestId = rpcRequest.requestId,
+            isLegacy = true,
+            readLocalShuffle = false)
+        case _ =>
+          logError(s"Received an unknown message type id: ${message.`type`.id}")
+      }
+    } catch {
+      case e: Exception =>
+        logError("Catch an error when handle legacy rpc message.", e)
+    }
+
+  }
+
   private def handleOpenStreamInternal(
       client: TransportClient,
       shuffleKey: String,
       fileName: String,
       startIndex: Int,
       endIndex: Int,
       initialCredit: Int,
-      request: RpcRequest,
+      rpcRequestId: Long,
       isLegacy: Boolean,
       readLocalShuffle: Boolean = false): Unit = {
+    workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, shuffleKey)
     try {
       var fileInfo = getRawFileInfo(shuffleKey, fileName)
       fileInfo.getPartitionType match {
         case PartitionType.REDUCE =>
-          if (endIndex != Integer.MAX_VALUE) {
+          val streamId = chunkStreamManager.nextStreamId()
+          fileInfo = partitionsSorter.getSortedFileInfo(
+            shuffleKey,
+            fileName,
+            fileInfo,
+            startIndex,
+            endIndex)
+          // non-range openStream request
+          if (endIndex == Int.MaxValue && !fileInfo.addStream(streamId)) {

Review Comment:
   `getSortedFileInfo` may return the sorted file info even though `endIndex == Int.MaxValue`.  IMO here we can just call original fileInfo's `addStream` like following:
   ```
         var fileInfo = getRawFileInfo(shuffleKey, fileName)
         fileInfo.getPartitionType match {
           case PartitionType.REDUCE =>
             val streamId = chunkStreamManager.nextStreamId()
             // non-range openStream request
             if (endIndex == Int.MaxValue && !fileInfo.addStream(streamId)) {
               // This branch is entered when the original unsorted file has been deleted by another
               // range's openStream request. retry fetching the sorted FileInfo.
               fileInfo = partitionsSorter.getSortedFileInfo(
                 shuffleKey,
                 fileName,
                 fileInfo,
                 startIndex,
                 endIndex)
               assert(Utils.isSortedPath(fileInfo.getFilePath))
             }
   ```



-- 
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


[GitHub] [incubator-celeborn] cfmcgrady commented on pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

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

   As suggested https://github.com/apache/incubator-celeborn/pull/1907#pullrequestreview-1629951713, implemented a new approach that moves the state (stream ids) responsible for deleting unsorted files into the `FileInfo` class. cc @waitinfuture @FMX 
   
   


-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

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

   > encountered another problem while running the `ReusedExchangeSuite` after making this change. Although the suite passed.
   > 
   > seems the worker can't exit correctly.
   > 
   > ```
   > 23/10/09 09:57:26,422 ERROR [fetch-server-52-2] ResourceLeakDetector: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
   > Recent access records: 
   > Created at:
   > 	io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:403)
   > 	io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
   > 	io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179)
   > 	io.netty.buffer.AbstractByteBufAllocator.ioBuffer(AbstractByteBufAllocator.java:140)
   > 	io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator$MaxMessageHandle.allocate(DefaultMaxMessagesRecvByteBufAllocator.java:120)
   > 	io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:150)
   > 	io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
   > 	io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
   > 	io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
   > 	io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
   > 	io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
   > 	io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   > 	io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   > 	java.lang.Thread.run(Thread.java:750)
   > 23/10/09 09:57:26,422 ERROR [data-client-79-4] ResourceLeakDetector: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
   > Recent access records: 
   > Created at:
   > 	io.netty.buffer.AbstractByteBufAllocator.compositeDirectBuffer(AbstractByteBufAllocator.java:224)
   > 	io.netty.buffer.AbstractByteBufAllocator.compositeBuffer(AbstractByteBufAllocator.java:202)
   > 	org.apache.celeborn.common.network.util.TransportFrameDecoder.decodeNext(TransportFrameDecoder.java:143)
   > 	org.apache.celeborn.common.network.util.TransportFrameDecoder.channelRead(TransportFrameDecoder.java:66)
   > 	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
   > 	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   > 	io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   > 	io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
   > 	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
   > 	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   > 	io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
   > 	io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
   > 	io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
   > 	io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
   > 	io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
   > 	io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
   > 	io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
   > 	io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   > 	io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   > 	java.lang.Thread.run(Thread.java:750)
   > 
   > 
   > 23/10/09 09:57:32,109 ERROR [shutdown-hook-0] MasterClient: Send rpc with failure, has tried 0, max try 15!
   > org.apache.celeborn.common.exception.CelebornException: Exception thrown in awaitResult: 
   > 	at org.apache.celeborn.common.util.ThreadUtils$.awaitResult(ThreadUtils.scala:229)
   > 	at org.apache.celeborn.common.rpc.RpcTimeout.awaitResult(RpcTimeout.scala:74)
   > 	at org.apache.celeborn.common.client.MasterClient.sendMessageInner(MasterClient.java:151)
   > 	at org.apache.celeborn.common.client.MasterClient.askSync(MasterClient.java:123)
   > 	at org.apache.celeborn.service.deploy.worker.Worker.exitImmediately(Worker.scala:691)
   > 	at org.apache.celeborn.service.deploy.worker.Worker$$anon$5.run(Worker.scala:714)
   > 	at java.lang.Thread.run(Thread.java:750)
   > 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   > 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   > 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   > 	at java.lang.Thread.run(Thread.java:750)
   > Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@6cbccb6c rejected from java.util.concurrent.ScheduledThreadPoolExecutor@13bac7f3[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
   > 	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
   > 	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
   > 	at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326)
   > 	at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
   > 	at org.apache.celeborn.common.rpc.netty.NettyRpcEnv.ask(NettyRpcEnv.scala:244)
   > 	at org.apache.celeborn.common.rpc.netty.NettyRpcEndpointRef.ask(NettyRpcEnv.scala:418)
   > 	at org.apache.celeborn.common.client.MasterClient.sendMessageInner(MasterClient.java:150)
   > 	... 9 more
   > 23/10/09 09:57:32,110 ERROR [shutdown-hook-0] Worker: Fail report to master, need wait PartitionLocation auto release: 
   > 
   >  Partition Location Info:
   >  primary: Map(local-1696816632431-1 -> {}, local-1696816632431-2 -> {}, local-1696816632431-0 -> {}, local-1696816632431-5 -> {}, local-1696816632431-3 -> {}, local-1696816632431-4 -> {})
   >  replica: Map()
   > 
   > org.apache.celeborn.common.exception.CelebornException: Exception thrown in awaitResult: 
   > 	at org.apache.celeborn.common.util.ThreadUtils$.awaitResult(ThreadUtils.scala:229)
   > 	at org.apache.celeborn.common.rpc.RpcTimeout.awaitResult(RpcTimeout.scala:74)
   > 	at org.apache.celeborn.common.client.MasterClient.sendMessageInner(MasterClient.java:151)
   > 	at org.apache.celeborn.common.client.MasterClient.askSync(MasterClient.java:123)
   > 	at org.apache.celeborn.service.deploy.worker.Worker.exitImmediately(Worker.scala:691)
   > 	at org.apache.celeborn.service.deploy.worker.Worker$$anon$5.run(Worker.scala:714)
   > 	at java.lang.Thread.run(Thread.java:750)
   > 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   > 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   > 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   > 	at java.lang.Thread.run(Thread.java:750)
   > Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@6cbccb6c rejected from java.util.concurrent.ScheduledThreadPoolExecutor@13bac7f3[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
   > 	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
   > 	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
   > 	at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326)
   > 	at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
   > 	at org.apache.celeborn.common.rpc.netty.NettyRpcEnv.ask(NettyRpcEnv.scala:244)
   > 	at org.apache.celeborn.common.rpc.netty.NettyRpcEndpointRef.ask(NettyRpcEnv.scala:418)
   > 	at org.apache.celeborn.common.client.MasterClient.sendMessageInner(MasterClient.java:150)
   > 	... 9 more
   > ```
   > 
   > I'll investigate further later on.
   
   Hi, I've seen this several times. IMO, this exception occurs when a fetch handler decodes some RPC messages while the server is ending. As you can see this exception occurs close to the shutdown hook's log.


-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

Posted by "waitinfuture (via GitHub)" <gi...@apache.org>.
waitinfuture closed pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug
URL: https://github.com/apache/incubator-celeborn/pull/1932


-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

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

   encountered another problem while running the `ReusedExchangeSuite` after making this change. Although the suite passed.
   
   seems the worker can't exit correctly.
   
   ```
   23/10/09 09:57:26,422 ERROR [fetch-server-52-2] ResourceLeakDetector: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
   Recent access records: 
   Created at:
   	io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:403)
   	io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
   	io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179)
   	io.netty.buffer.AbstractByteBufAllocator.ioBuffer(AbstractByteBufAllocator.java:140)
   	io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator$MaxMessageHandle.allocate(DefaultMaxMessagesRecvByteBufAllocator.java:120)
   	io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:150)
   	io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
   	io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
   	io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
   	io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
   	io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
   	io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	java.lang.Thread.run(Thread.java:750)
   23/10/09 09:57:26,422 ERROR [data-client-79-4] ResourceLeakDetector: LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
   Recent access records: 
   Created at:
   	io.netty.buffer.AbstractByteBufAllocator.compositeDirectBuffer(AbstractByteBufAllocator.java:224)
   	io.netty.buffer.AbstractByteBufAllocator.compositeBuffer(AbstractByteBufAllocator.java:202)
   	org.apache.celeborn.common.network.util.TransportFrameDecoder.decodeNext(TransportFrameDecoder.java:143)
   	org.apache.celeborn.common.network.util.TransportFrameDecoder.channelRead(TransportFrameDecoder.java:66)
   	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
   	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
   	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
   	io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
   	io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
   	io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
   	io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
   	io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
   	io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
   	io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
   	io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	java.lang.Thread.run(Thread.java:750)
   
   
   23/10/09 09:57:32,109 ERROR [shutdown-hook-0] MasterClient: Send rpc with failure, has tried 0, max try 15!
   org.apache.celeborn.common.exception.CelebornException: Exception thrown in awaitResult: 
   	at org.apache.celeborn.common.util.ThreadUtils$.awaitResult(ThreadUtils.scala:229)
   	at org.apache.celeborn.common.rpc.RpcTimeout.awaitResult(RpcTimeout.scala:74)
   	at org.apache.celeborn.common.client.MasterClient.sendMessageInner(MasterClient.java:151)
   	at org.apache.celeborn.common.client.MasterClient.askSync(MasterClient.java:123)
   	at org.apache.celeborn.service.deploy.worker.Worker.exitImmediately(Worker.scala:691)
   	at org.apache.celeborn.service.deploy.worker.Worker$$anon$5.run(Worker.scala:714)
   	at java.lang.Thread.run(Thread.java:750)
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:750)
   Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@6cbccb6c rejected from java.util.concurrent.ScheduledThreadPoolExecutor@13bac7f3[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
   	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
   	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
   	at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326)
   	at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
   	at org.apache.celeborn.common.rpc.netty.NettyRpcEnv.ask(NettyRpcEnv.scala:244)
   	at org.apache.celeborn.common.rpc.netty.NettyRpcEndpointRef.ask(NettyRpcEnv.scala:418)
   	at org.apache.celeborn.common.client.MasterClient.sendMessageInner(MasterClient.java:150)
   	... 9 more
   23/10/09 09:57:32,110 ERROR [shutdown-hook-0] Worker: Fail report to master, need wait PartitionLocation auto release: 
   
    Partition Location Info:
    primary: Map(local-1696816632431-1 -> {}, local-1696816632431-2 -> {}, local-1696816632431-0 -> {}, local-1696816632431-5 -> {}, local-1696816632431-3 -> {}, local-1696816632431-4 -> {})
    replica: Map()
   
   org.apache.celeborn.common.exception.CelebornException: Exception thrown in awaitResult: 
   	at org.apache.celeborn.common.util.ThreadUtils$.awaitResult(ThreadUtils.scala:229)
   	at org.apache.celeborn.common.rpc.RpcTimeout.awaitResult(RpcTimeout.scala:74)
   	at org.apache.celeborn.common.client.MasterClient.sendMessageInner(MasterClient.java:151)
   	at org.apache.celeborn.common.client.MasterClient.askSync(MasterClient.java:123)
   	at org.apache.celeborn.service.deploy.worker.Worker.exitImmediately(Worker.scala:691)
   	at org.apache.celeborn.service.deploy.worker.Worker$$anon$5.run(Worker.scala:714)
   	at java.lang.Thread.run(Thread.java:750)
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:750)
   Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@6cbccb6c rejected from java.util.concurrent.ScheduledThreadPoolExecutor@13bac7f3[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
   	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
   	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
   	at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326)
   	at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
   	at org.apache.celeborn.common.rpc.netty.NettyRpcEnv.ask(NettyRpcEnv.scala:244)
   	at org.apache.celeborn.common.rpc.netty.NettyRpcEndpointRef.ask(NettyRpcEnv.scala:418)
   	at org.apache.celeborn.common.client.MasterClient.sendMessageInner(MasterClient.java:150)
   	... 9 more
   
   ```
   
   I'll investigate further later on.


-- 
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


[GitHub] [incubator-celeborn] cfmcgrady commented on a diff in pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1333856840


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/PartitionFilesSorter.java:
##########
@@ -696,4 +722,68 @@ private void readBufferBySize(ByteBuffer buffer, int toRead) throws IOException
       }
     }
   }
+
+  public void cleanupExpiredShuffleKey(Set<String> expiredShuffleKeys) {
+    cleaner.cleanupExpiredShuffleKey(expiredShuffleKeys);
+  }
+}
+
+class PartitionFilesCleaner {
+  private static final Logger logger = LoggerFactory.getLogger(PartitionFilesCleaner.class);
+
+  private final LinkedBlockingQueue<PartitionFilesSorter.FileSorter> queue =
+      new LinkedBlockingQueue<>();
+  private final Lock lock = new ReentrantLock();
+  private final Condition notEmpty = lock.newCondition();
+
+  PartitionFilesCleaner() {
+    Thread cleaner =
+        new Thread(
+            () -> {
+              while (true) {
+                try {
+                  lock.lockInterruptibly();
+                  while (queue.isEmpty()) {
+                    notEmpty.await(500, TimeUnit.MILLISECONDS);
+                  }
+                  Iterator<PartitionFilesSorter.FileSorter> it = queue.iterator();
+                  while (it.hasNext()) {
+                    PartitionFilesSorter.FileSorter sorter = it.next();
+                    try {
+                      if (sorter.getOriginFileInfo().isStreamsEmpty()) {

Review Comment:
   > If there is no non skew streams, the origin file can be deleted.
   it's not, only when the range open stream request(skew stream) will trigger `FileSorter.sort()`, and then the `FileSorter` instance will be added to the cleanup queue.
   
   > I think it's good to record all stream in fileinfo, I'll need it in supporting memory storage.
   yeah, I also read the proposal you posted on the mailing list, in the current implementation, record all activity streams in the fileinfo already done.
   
   



##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/PartitionFilesSorter.java:
##########
@@ -696,4 +722,68 @@ private void readBufferBySize(ByteBuffer buffer, int toRead) throws IOException
       }
     }
   }
+
+  public void cleanupExpiredShuffleKey(Set<String> expiredShuffleKeys) {
+    cleaner.cleanupExpiredShuffleKey(expiredShuffleKeys);
+  }
+}
+
+class PartitionFilesCleaner {
+  private static final Logger logger = LoggerFactory.getLogger(PartitionFilesCleaner.class);
+
+  private final LinkedBlockingQueue<PartitionFilesSorter.FileSorter> queue =
+      new LinkedBlockingQueue<>();
+  private final Lock lock = new ReentrantLock();
+  private final Condition notEmpty = lock.newCondition();
+
+  PartitionFilesCleaner() {
+    Thread cleaner =
+        new Thread(
+            () -> {
+              while (true) {
+                try {
+                  lock.lockInterruptibly();
+                  while (queue.isEmpty()) {
+                    notEmpty.await(500, TimeUnit.MILLISECONDS);
+                  }
+                  Iterator<PartitionFilesSorter.FileSorter> it = queue.iterator();
+                  while (it.hasNext()) {
+                    PartitionFilesSorter.FileSorter sorter = it.next();
+                    try {
+                      if (sorter.getOriginFileInfo().isStreamsEmpty()) {

Review Comment:
   > If there is no non skew streams, the origin file can be deleted.
   
   it's not, only when the range open stream request(skew stream) will trigger `FileSorter.sort()`, and then the `FileSorter` instance will be added to the cleanup queue.
   
   > I think it's good to record all stream in fileinfo, I'll need it in supporting memory storage.
   
   yeah, I also read the proposal you posted on the mailing list, in the current implementation, record all activity streams in the fileinfo already done.
   
   



-- 
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


[GitHub] [incubator-celeborn] cfmcgrady commented on a diff in pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1333967382


##########
common/src/main/java/org/apache/celeborn/common/meta/FileInfo.java:
##########
@@ -265,4 +277,33 @@ public boolean isPartitionSplitEnabled() {
   public void setPartitionSplitEnabled(boolean partitionSplitEnabled) {
     this.partitionSplitEnabled = partitionSplitEnabled;
   }
+
+  public void setSorted() {
+    synchronized (sorted) {

Review Comment:
   it's for blocking the `addStream`



-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

Posted by "cfmcgrady (via GitHub)" <gi...@apache.org>.
cfmcgrady commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1349822712


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/FetchHandler.scala:
##########
@@ -97,137 +95,142 @@ class FetchHandler(val conf: CelebornConf, val transportConf: TransportConf)
       case r: ChunkFetchRequest =>
         handleChunkFetchRequest(client, r)
       case r: RpcRequest =>
-        var streamShuffleKey: String = null
-        try {
-          val pbMsg = TransportMessage.fromByteBuffer(
-            r.body().nioByteBuffer()).getParsedPayload.asInstanceOf[GeneratedMessageV3]
-          pbMsg match {
-            case pb: PbBufferStreamEnd => handleEndStreamFromClient(pb.getStreamId)
-            case pb: PbReadAddCredit => handleReadAddCredit(pb.getCredit, pb.getStreamId)
-            case pb: PbOpenStream =>
-              val (shuffleKey, fileName, startIndex, endIndex, initialCredit, readLocalShuffle) =
-                (
-                  pb.getShuffleKey,
-                  pb.getFileName,
-                  pb.getStartIndex,
-                  pb.getEndIndex,
-                  pb.getInitialCredit,
-                  pb.getReadLocalShuffle)
-              streamShuffleKey = shuffleKey
-              workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-              handleOpenStreamInternal(
-                client,
-                shuffleKey,
-                fileName,
-                startIndex,
-                endIndex,
-                initialCredit,
-                r,
-                false,
-                readLocalShuffle)
-          }
-        } catch {
-          case _: Exception =>
-            logDebug("Legacy RPCs")
-            val decodedMsg = Message.decode(r.body().nioByteBuffer())
-            val msgType = decodedMsg.`type`()
-            if (msgType == Type.OPEN_STREAM || msgType == Type.OPEN_STREAM_WITH_CREDIT) {
-              var streamFileName: String = null
-              try {
-                val (shuffleKey, fileName) =
-                  if (msgType == Type.OPEN_STREAM) {
-                    val openStream = decodedMsg.asInstanceOf[OpenStream]
-                    (
-                      new String(openStream.shuffleKey, StandardCharsets.UTF_8),
-                      new String(openStream.fileName, StandardCharsets.UTF_8))
-                  } else {
-                    val openStreamWithCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit]
-                    (
-                      new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
-                      new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8))
-                  }
-                streamShuffleKey = shuffleKey
-                streamFileName = fileName
-                var startIndex = 0
-                var endIndex = 0
-                var initialCredit = 0
-                getRawFileInfo(shuffleKey, fileName).getPartitionType match {
-                  case PartitionType.REDUCE =>
-                    startIndex = decodedMsg.asInstanceOf[OpenStream].startMapIndex
-                    endIndex = decodedMsg.asInstanceOf[OpenStream].endMapIndex
-                  case PartitionType.MAP =>
-                    initialCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit].initialCredit
-                    startIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].startIndex
-                    endIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].endIndex
-                  case PartitionType.MAPGROUP =>
-                }
-                handleOpenStreamInternal(
-                  client,
-                  shuffleKey,
-                  fileName,
-                  startIndex,
-                  endIndex,
-                  initialCredit,
-                  r,
-                  true)
-              } catch {
-                case e: IOException =>
-                  handleRpcIOException(client, r.requestId, streamShuffleKey, streamFileName, e)
-              }
-            }
-        } finally {
-          r.body().release()
-          if (streamShuffleKey != null) {
-            workerSource.stopTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-          }
-        }
+        handleRpcRequest(client, r)
       case unknown: RequestMessage =>
         throw new IllegalArgumentException(s"Unknown message type id: ${unknown.`type`.id}")
     }
   }
 
+  private def handleRpcRequest(client: TransportClient, rpcRequest: RpcRequest): Unit = {
+    try {
+      var message: GeneratedMessageV3 = null
+      try {
+        message = TransportMessage.fromByteBuffer(rpcRequest.body().nioByteBuffer())
+          .getParsedPayload[GeneratedMessageV3]
+      } catch {
+        case exception: CelebornIOException =>
+          logWarning("Handle request with legacy RPCs", exception)
+          return handleLegacyRpcMessage(client, rpcRequest)
+      }
+      message match {
+        case openStream: PbOpenStream =>
+          handleOpenStreamInternal(
+            client,
+            openStream.getShuffleKey,
+            openStream.getFileName,
+            openStream.getStartIndex,
+            openStream.getEndIndex,
+            openStream.getInitialCredit,
+            rpcRequest.requestId,
+            isLegacy = false,
+            openStream.getReadLocalShuffle)
+        case bufferStreamEnd: PbBufferStreamEnd =>
+          handleEndStreamFromClient(bufferStreamEnd)
+        case readAddCredit: PbReadAddCredit =>
+          handleReadAddCredit(readAddCredit.getCredit, readAddCredit.getStreamId)
+        case message: GeneratedMessageV3 =>
+          logError(s"Unknown message $message")
+      }
+    } finally {
+      rpcRequest.body().release()
+    }
+  }
+
+  private def handleLegacyRpcMessage(client: TransportClient, rpcRequest: RpcRequest): Unit = {
+    try {
+      val message = Message.decode(rpcRequest.body().nioByteBuffer())
+      message.`type`() match {
+        case Message.Type.OPEN_STREAM =>
+          val openStream = message.asInstanceOf[OpenStream]
+          handleOpenStreamInternal(
+            client,
+            new String(openStream.shuffleKey, StandardCharsets.UTF_8),
+            new String(openStream.fileName, StandardCharsets.UTF_8),
+            openStream.startMapIndex,
+            openStream.endMapIndex,
+            initialCredit = 0,
+            rpcRequestId = rpcRequest.requestId,
+            isLegacy = true,
+            // legacy [[OpenStream]] doesn't support read local shuffle
+            readLocalShuffle = false)
+        case Message.Type.OPEN_STREAM_WITH_CREDIT =>
+          val openStreamWithCredit = message.asInstanceOf[OpenStreamWithCredit]
+          handleOpenStreamInternal(
+            client,
+            new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
+            new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8),
+            openStreamWithCredit.startIndex,
+            openStreamWithCredit.endIndex,
+            openStreamWithCredit.initialCredit,
+            rpcRequestId = rpcRequest.requestId,
+            isLegacy = true,
+            readLocalShuffle = false)
+        case _ =>
+          logError(s"Received an unknown message type id: ${message.`type`.id}")
+      }
+    } catch {
+      case e: Exception =>
+        logError("Catch an error when handle legacy rpc message.", e)
+    }
+
+  }
+
   private def handleOpenStreamInternal(
       client: TransportClient,
       shuffleKey: String,
       fileName: String,
       startIndex: Int,
       endIndex: Int,
       initialCredit: Int,
-      request: RpcRequest,
+      rpcRequestId: Long,
       isLegacy: Boolean,
       readLocalShuffle: Boolean = false): Unit = {
+    workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, shuffleKey)
     try {
       var fileInfo = getRawFileInfo(shuffleKey, fileName)
       fileInfo.getPartitionType match {
         case PartitionType.REDUCE =>
-          if (endIndex != Integer.MAX_VALUE) {
+          val streamId = chunkStreamManager.nextStreamId()
+          fileInfo = partitionsSorter.getSortedFileInfo(
+            shuffleKey,
+            fileName,
+            fileInfo,
+            startIndex,
+            endIndex)
+          // non-range openStream request
+          if (endIndex == Int.MaxValue && !fileInfo.addStream(streamId)) {

Review Comment:
   addressed in https://github.com/apache/incubator-celeborn/pull/1932/commits/6c86e0149c161c37aa40a7f96f44f9a44f73bf5d



-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

Posted by "waitinfuture (via GitHub)" <gi...@apache.org>.
waitinfuture commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1349482086


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/FetchHandler.scala:
##########
@@ -96,130 +95,140 @@ class FetchHandler(val conf: CelebornConf, val transportConf: TransportConf)
       case r: ChunkFetchRequest =>
         handleChunkFetchRequest(client, r)
       case r: RpcRequest =>
-        // process PbOpenStream RPC
-        var streamShuffleKey: String = null
-        var streamFileName: String = null
-        try {
-          val pbMsg = TransportMessage.fromByteBuffer(r.body().nioByteBuffer())
-          val pbOpenStream = pbMsg.getParsedPayload[PbOpenStream]
-          val (shuffleKey, fileName, startIndex, endIndex, initialCredit, readLocalShuffle) =
-            (
-              pbOpenStream.getShuffleKey,
-              pbOpenStream.getFileName,
-              pbOpenStream.getStartIndex,
-              pbOpenStream.getEndIndex,
-              pbOpenStream.getInitialCredit,
-              pbOpenStream.getReadLocalShuffle)
-          streamShuffleKey = shuffleKey
-          streamFileName = fileName
-          workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-          handleOpenStreamInternal(
-            client,
-            shuffleKey,
-            fileName,
-            startIndex,
-            endIndex,
-            initialCredit,
-            r,
-            false,
-            readLocalShuffle)
-        } catch {
-          case _: Exception =>
-            // process legacy OpenStream RPCs
-            logDebug("Open stream with legacy RPCs")
-            try {
-              val decodedMsg = Message.decode(r.body().nioByteBuffer())
-              val (shuffleKey, fileName) =
-                if (decodedMsg.`type`() == Type.OPEN_STREAM) {
-                  val openStream = decodedMsg.asInstanceOf[OpenStream]
-                  (
-                    new String(openStream.shuffleKey, StandardCharsets.UTF_8),
-                    new String(openStream.fileName, StandardCharsets.UTF_8))
-                } else {
-                  val openStreamWithCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit]
-                  (
-                    new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
-                    new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8))
-                }
-              streamShuffleKey = shuffleKey
-              streamFileName = fileName
-              var startIndex = 0
-              var endIndex = 0
-              var initialCredit = 0
-              getRawFileInfo(shuffleKey, fileName).getPartitionType match {
-                case PartitionType.REDUCE =>
-                  startIndex = decodedMsg.asInstanceOf[OpenStream].startMapIndex
-                  endIndex = decodedMsg.asInstanceOf[OpenStream].endMapIndex
-                case PartitionType.MAP =>
-                  initialCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit].initialCredit
-                  startIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].startIndex
-                  endIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].endIndex
-                case PartitionType.MAPGROUP =>
-              }
-              handleOpenStreamInternal(
-                client,
-                shuffleKey,
-                fileName,
-                startIndex,
-                endIndex,
-                initialCredit,
-                r,
-                true)
-            } catch {
-              case e: IOException =>
-                handleRpcIOException(client, r.requestId, streamShuffleKey, streamFileName, e)
-            }
-        } finally {
-          r.body().release()
-          workerSource.stopTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-        }
+        handleRpcRequest(client, r)
       case unknown: RequestMessage =>
         throw new IllegalArgumentException(s"Unknown message type id: ${unknown.`type`.id}")
     }
   }
 
+  private def handleRpcRequest(client: TransportClient, rpcRequest: RpcRequest): Unit = {

Review Comment:
   IMO the refactor is good for readability.



##########
common/src/main/java/org/apache/celeborn/common/meta/FileInfo.java:
##########
@@ -265,4 +277,33 @@ public boolean isPartitionSplitEnabled() {
   public void setPartitionSplitEnabled(boolean partitionSplitEnabled) {
     this.partitionSplitEnabled = partitionSplitEnabled;
   }
+
+  public void setSorted() {
+    synchronized (sorted) {

Review Comment:
   I agree with @FMX , the synchronization in `addStream` and `isStreamsEmpty` are necessary because these two methods need to be sequential, but it's unnecessary to synchronize in `setSorted` and `closeStream`.



-- 
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-980] Asynchronously delete original files to fix `ReusedExchange` bug [incubator-celeborn]

Posted by "waitinfuture (via GitHub)" <gi...@apache.org>.
waitinfuture commented on code in PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#discussion_r1349485398


##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/FetchHandler.scala:
##########
@@ -97,137 +95,142 @@ class FetchHandler(val conf: CelebornConf, val transportConf: TransportConf)
       case r: ChunkFetchRequest =>
         handleChunkFetchRequest(client, r)
       case r: RpcRequest =>
-        var streamShuffleKey: String = null
-        try {
-          val pbMsg = TransportMessage.fromByteBuffer(
-            r.body().nioByteBuffer()).getParsedPayload.asInstanceOf[GeneratedMessageV3]
-          pbMsg match {
-            case pb: PbBufferStreamEnd => handleEndStreamFromClient(pb.getStreamId)
-            case pb: PbReadAddCredit => handleReadAddCredit(pb.getCredit, pb.getStreamId)
-            case pb: PbOpenStream =>
-              val (shuffleKey, fileName, startIndex, endIndex, initialCredit, readLocalShuffle) =
-                (
-                  pb.getShuffleKey,
-                  pb.getFileName,
-                  pb.getStartIndex,
-                  pb.getEndIndex,
-                  pb.getInitialCredit,
-                  pb.getReadLocalShuffle)
-              streamShuffleKey = shuffleKey
-              workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-              handleOpenStreamInternal(
-                client,
-                shuffleKey,
-                fileName,
-                startIndex,
-                endIndex,
-                initialCredit,
-                r,
-                false,
-                readLocalShuffle)
-          }
-        } catch {
-          case _: Exception =>
-            logDebug("Legacy RPCs")
-            val decodedMsg = Message.decode(r.body().nioByteBuffer())
-            val msgType = decodedMsg.`type`()
-            if (msgType == Type.OPEN_STREAM || msgType == Type.OPEN_STREAM_WITH_CREDIT) {
-              var streamFileName: String = null
-              try {
-                val (shuffleKey, fileName) =
-                  if (msgType == Type.OPEN_STREAM) {
-                    val openStream = decodedMsg.asInstanceOf[OpenStream]
-                    (
-                      new String(openStream.shuffleKey, StandardCharsets.UTF_8),
-                      new String(openStream.fileName, StandardCharsets.UTF_8))
-                  } else {
-                    val openStreamWithCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit]
-                    (
-                      new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
-                      new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8))
-                  }
-                streamShuffleKey = shuffleKey
-                streamFileName = fileName
-                var startIndex = 0
-                var endIndex = 0
-                var initialCredit = 0
-                getRawFileInfo(shuffleKey, fileName).getPartitionType match {
-                  case PartitionType.REDUCE =>
-                    startIndex = decodedMsg.asInstanceOf[OpenStream].startMapIndex
-                    endIndex = decodedMsg.asInstanceOf[OpenStream].endMapIndex
-                  case PartitionType.MAP =>
-                    initialCredit = decodedMsg.asInstanceOf[OpenStreamWithCredit].initialCredit
-                    startIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].startIndex
-                    endIndex = decodedMsg.asInstanceOf[OpenStreamWithCredit].endIndex
-                  case PartitionType.MAPGROUP =>
-                }
-                handleOpenStreamInternal(
-                  client,
-                  shuffleKey,
-                  fileName,
-                  startIndex,
-                  endIndex,
-                  initialCredit,
-                  r,
-                  true)
-              } catch {
-                case e: IOException =>
-                  handleRpcIOException(client, r.requestId, streamShuffleKey, streamFileName, e)
-              }
-            }
-        } finally {
-          r.body().release()
-          if (streamShuffleKey != null) {
-            workerSource.stopTimer(WorkerSource.OPEN_STREAM_TIME, streamShuffleKey)
-          }
-        }
+        handleRpcRequest(client, r)
       case unknown: RequestMessage =>
         throw new IllegalArgumentException(s"Unknown message type id: ${unknown.`type`.id}")
     }
   }
 
+  private def handleRpcRequest(client: TransportClient, rpcRequest: RpcRequest): Unit = {
+    try {
+      var message: GeneratedMessageV3 = null
+      try {
+        message = TransportMessage.fromByteBuffer(rpcRequest.body().nioByteBuffer())
+          .getParsedPayload[GeneratedMessageV3]
+      } catch {
+        case exception: CelebornIOException =>
+          logWarning("Handle request with legacy RPCs", exception)
+          return handleLegacyRpcMessage(client, rpcRequest)
+      }
+      message match {
+        case openStream: PbOpenStream =>
+          handleOpenStreamInternal(
+            client,
+            openStream.getShuffleKey,
+            openStream.getFileName,
+            openStream.getStartIndex,
+            openStream.getEndIndex,
+            openStream.getInitialCredit,
+            rpcRequest.requestId,
+            isLegacy = false,
+            openStream.getReadLocalShuffle)
+        case bufferStreamEnd: PbBufferStreamEnd =>
+          handleEndStreamFromClient(bufferStreamEnd)
+        case readAddCredit: PbReadAddCredit =>
+          handleReadAddCredit(readAddCredit.getCredit, readAddCredit.getStreamId)
+        case message: GeneratedMessageV3 =>
+          logError(s"Unknown message $message")
+      }
+    } finally {
+      rpcRequest.body().release()
+    }
+  }
+
+  private def handleLegacyRpcMessage(client: TransportClient, rpcRequest: RpcRequest): Unit = {
+    try {
+      val message = Message.decode(rpcRequest.body().nioByteBuffer())
+      message.`type`() match {
+        case Message.Type.OPEN_STREAM =>
+          val openStream = message.asInstanceOf[OpenStream]
+          handleOpenStreamInternal(
+            client,
+            new String(openStream.shuffleKey, StandardCharsets.UTF_8),
+            new String(openStream.fileName, StandardCharsets.UTF_8),
+            openStream.startMapIndex,
+            openStream.endMapIndex,
+            initialCredit = 0,
+            rpcRequestId = rpcRequest.requestId,
+            isLegacy = true,
+            // legacy [[OpenStream]] doesn't support read local shuffle
+            readLocalShuffle = false)
+        case Message.Type.OPEN_STREAM_WITH_CREDIT =>
+          val openStreamWithCredit = message.asInstanceOf[OpenStreamWithCredit]
+          handleOpenStreamInternal(
+            client,
+            new String(openStreamWithCredit.shuffleKey, StandardCharsets.UTF_8),
+            new String(openStreamWithCredit.fileName, StandardCharsets.UTF_8),
+            openStreamWithCredit.startIndex,
+            openStreamWithCredit.endIndex,
+            openStreamWithCredit.initialCredit,
+            rpcRequestId = rpcRequest.requestId,
+            isLegacy = true,
+            readLocalShuffle = false)
+        case _ =>
+          logError(s"Received an unknown message type id: ${message.`type`.id}")
+      }
+    } catch {
+      case e: Exception =>
+        logError("Catch an error when handle legacy rpc message.", e)
+    }
+
+  }
+
   private def handleOpenStreamInternal(
       client: TransportClient,
       shuffleKey: String,
       fileName: String,
       startIndex: Int,
       endIndex: Int,
       initialCredit: Int,
-      request: RpcRequest,
+      rpcRequestId: Long,
       isLegacy: Boolean,
       readLocalShuffle: Boolean = false): Unit = {
+    workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME, shuffleKey)
     try {
       var fileInfo = getRawFileInfo(shuffleKey, fileName)
       fileInfo.getPartitionType match {
         case PartitionType.REDUCE =>
-          if (endIndex != Integer.MAX_VALUE) {
+          val streamId = chunkStreamManager.nextStreamId()
+          fileInfo = partitionsSorter.getSortedFileInfo(
+            shuffleKey,
+            fileName,
+            fileInfo,
+            startIndex,
+            endIndex)
+          // non-range openStream request
+          if (endIndex == Int.MaxValue && !fileInfo.addStream(streamId)) {

Review Comment:
   `getSortedFileInfo` may return the sorted file info even though `endIndex == Int.MaxValue`.  IMO here we can just call original fileInfo's `addStream` like following:
   ```
         var fileInfo = getRawFileInfo(shuffleKey, fileName)
         fileInfo.getPartitionType match {
           case PartitionType.REDUCE =>
             val streamId = chunkStreamManager.nextStreamId()
             // non-range openStream request
             if (endIndex == Int.MaxValue && !fileInfo.addStream(streamId)) {
               // This branch is entered when the original unsorted file has been sorted by another
               // range's openStream request. retry fetching the sorted FileInfo.
               fileInfo = partitionsSorter.getSortedFileInfo(
                 shuffleKey,
                 fileName,
                 fileInfo,
                 startIndex,
                 endIndex)
               assert(Utils.isSortedPath(fileInfo.getFilePath))
             }
   ```



-- 
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


[GitHub] [incubator-celeborn] codecov[bot] commented on pull request #1932: [CELEBORN-980] Asynchronously delete original files to fix `ReusedExchange` bug

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #1932:
URL: https://github.com/apache/incubator-celeborn/pull/1932#issuecomment-1729060391

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#1932](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (bedcb26) into [main](https://app.codecov.io/gh/apache/incubator-celeborn/commit/b21069866db16b7a489658f6b2a40a6a9673a051?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (b210698) will **increase** coverage by `0.33%`.
   > Report is 7 commits behind head on main.
   > The diff coverage is `58.63%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##             main    #1932      +/-   ##
   ==========================================
   + Coverage   46.82%   47.15%   +0.33%     
   ==========================================
     Files         164      164              
     Lines       10280    10307      +27     
     Branches      938      940       +2     
   ==========================================
   + Hits         4813     4859      +46     
   + Misses       5156     5131      -25     
   - Partials      311      317       +6     
   ```
   
   
   | [Files Changed](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...eleborn/common/network/client/TransportClient.java](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9jZWxlYm9ybi9jb21tb24vbmV0d29yay9jbGllbnQvVHJhbnNwb3J0Q2xpZW50LmphdmE=) | `39.86% <0.00%> (-1.49%)` | :arrow_down: |
   | [...eborn/common/network/protocol/BufferStreamEnd.java](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9jZWxlYm9ybi9jb21tb24vbmV0d29yay9wcm90b2NvbC9CdWZmZXJTdHJlYW1FbmQuamF2YQ==) | `0.00% <ø> (-30.00%)` | :arrow_down: |
   | [.../scala/org/apache/celeborn/common/util/Utils.scala](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvY2VsZWJvcm4vY29tbW9uL3V0aWwvVXRpbHMuc2NhbGE=) | `16.70% <0.00%> (-0.03%)` | :arrow_down: |
   | [...java/org/apache/celeborn/common/meta/FileInfo.java](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9jZWxlYm9ybi9jb21tb24vbWV0YS9GaWxlSW5mby5qYXZh) | `47.00% <64.71%> (+3.63%)` | :arrow_up: |
   | [...born/common/network/protocol/TransportMessage.java](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9jZWxlYm9ybi9jb21tb24vbmV0d29yay9wcm90b2NvbC9UcmFuc3BvcnRNZXNzYWdlLmphdmE=) | `80.00% <100.00%> (+7.59%)` | :arrow_up: |
   | [...he/celeborn/common/util/ShuffleBlockInfoUtils.java](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9jZWxlYm9ybi9jb21tb24vdXRpbC9TaHVmZmxlQmxvY2tJbmZvVXRpbHMuamF2YQ==) | `86.85% <100.00%> (+1.13%)` | :arrow_up: |
   
   ... and [8 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-celeborn/pull/1932/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
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