rickyma commented on code in PR #1889:
URL: 
https://github.com/apache/incubator-uniffle/pull/1889#discussion_r1674239616


##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java:
##########
@@ -482,6 +499,15 @@ public void updateCachedBlockIds(
     if (shuffleBufferManager.isHugePartition(partitionSize)) {
       shuffleTaskInfo.markHugePartition(shuffleId, partitionId);
     }
+    if (shuffleBufferManager.isPartitionExceededMaxSize(partitionSize)) {
+      throw new NotRetryException(

Review Comment:
   ExceedPartitionSizeLimitException



##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java:
##########
@@ -526,6 +552,13 @@ public long requireBuffer(
         LOG.error(errorMessage);
         throw new NoBufferForHugePartitionException(errorMessage);
       }
+      if 
(shuffleBufferManager.isPartitionExceededMaxSize(partitionUsedDataSize)) {
+        throw new NoRegisterException(

Review Comment:
   ExceedPartitionSizeLimitException



##########
server/src/main/java/org/apache/uniffle/server/ShuffleServerConf.java:
##########
@@ -492,6 +492,13 @@ public class ShuffleServerConf extends RssBaseConf {
                   + HUGE_PARTITION_SIZE_THRESHOLD.key()
                   + "'");
 
+  public static final ConfigOption<Long> MAX_PARTITION_SIZE_THRESHOLD =
+      ConfigOptions.key("rss.server.max-partition.size.threshold")
+          .longType()
+          .defaultValue(Long.MAX_VALUE)
+          .withDescription(
+              "Threshold of max partition size, once exceeding threshold, 
client will receive an error.");

Review Comment:
   This option sets the maximum allowable partition size threshold. If the 
partition size exceeds this threshold, the client will receive an error message 
and the transmission of shuffle data will be terminated. This helps to 
significantly improve the stability of the cluster by preventing partitions 
from becoming too large.



##########
server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java:
##########
@@ -308,6 +310,21 @@ protected static int getMaxConcurrencyWriting(
   public StatusCode cacheShuffleData(
       String appId, int shuffleId, boolean isPreAllocated, 
ShufflePartitionedData spd) {
     refreshAppId(appId);
+    long partitionSize = getPartitionDataSize(appId, shuffleId, 
spd.getPartitionId());
+    long deltaSize = 0L;
+    for (ShufflePartitionedBlock spb : spd.getBlockList()) {

Review Comment:
   You can use `spd.getTotalBlockSize()`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to