You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "rickyma (via GitHub)" <gi...@apache.org> on 2024/04/01 05:36:52 UTC

[PR] [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer [incubator-uniffle]

rickyma opened a new pull request, #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611

   ### What changes were proposed in this pull request?
   
   1. Cancel server-side retry when reading data, and switch to client-side backoff retry; 
   2. Optimize lock contention issues when reading data, using CAS.
   
   ### Why are the changes needed?
   
   Fix https://github.com/apache/incubator-uniffle/issues/1606.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing UTs.
   


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for reading data(memory/local/index) for NO_BUFFER [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2029621577

   > Could you add a new UT for this pr?
   
   Existing UTs will cover the code in this PR. What I did is just move the retry logic from the server side to the client side.


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2031029448

   > > quorumTest
   > 
   > I think the test cases in the `QuorumTest` are only for testing the number of successful write replicas, and there is no test case for `retryMax` during writing. It's not easy to simulate the test for the same shuffle server(read or write), where the first request fails and the second request succeeds, right?
   
   You can see the test which I mentioned, we implemented a server can fail at first but succeed at the second attempt.


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for reading data(memory/local/index) for NO_BUFFER [incubator-uniffle]

Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1546156717


##########
internal-client/src/main/java/org/apache/uniffle/client/request/RssGetInMemoryShuffleDataRequest.java:
##########
@@ -65,4 +83,19 @@ public int getReadBufferSize() {
   public Roaring64NavigableMap getExpectedTaskIds() {
     return expectedTaskIds;
   }
+
+  @Override

Review Comment:
   The reason of make RetryRequest as an abstract class is to extra the following retryMax params and so on into the RetryRequest class, rather than scattering everywhere



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1547674121


##########
internal-client/src/main/java/org/apache/uniffle/client/request/RssGetShuffleIndexRequest.java:
##########
@@ -47,7 +47,7 @@ public RssGetShuffleIndexRequest(
   @VisibleForTesting
   public RssGetShuffleIndexRequest(
       String appId, int shuffleId, int partitionId, int partitionNumPerRange, int partitionNum) {
-    this(appId, shuffleId, partitionId, partitionNumPerRange, partitionNum, 1, 0);
+    this(appId, shuffleId, partitionId, partitionNumPerRange, partitionNum, 3, 1000);

Review Comment:
   Why do you change this?



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1546145683


##########
server/src/main/java/org/apache/uniffle/server/buffer/ShuffleBufferManager.java:
##########
@@ -424,35 +422,38 @@ private void releaseFlushMemory(long size) {
     ShuffleServerMetrics.gaugeInFlushBufferSize.set(inFlushSize.get());
   }
 
-  public boolean requireReadMemoryWithRetry(long size) {
+  public boolean requireReadMemory(long size) {
     ShuffleServerMetrics.counterTotalRequireReadMemoryNum.inc();
-    for (int i = 0; i < retryNum; i++) {
-      synchronized (this) {
-        if (readDataMemory.get() + size < readCapacity) {
-          readDataMemory.addAndGet(size);
+    boolean success = false;
+
+    do {
+      long currentReadDataMemory = readDataMemory.get();
+      long newReadDataMemory = currentReadDataMemory + size;
+      if (newReadDataMemory < readCapacity) {

Review Comment:
   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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for reading data(memory/local/index) for NO_BUFFER [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1546231681


##########
internal-client/src/main/java/org/apache/uniffle/client/request/RssGetInMemoryShuffleDataRequest.java:
##########
@@ -65,4 +83,19 @@ public int getReadBufferSize() {
   public Roaring64NavigableMap getExpectedTaskIds() {
     return expectedTaskIds;
   }
+
+  @Override

Review Comment:
   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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer [incubator-uniffle]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2029219650

   ## Test Results
    2 340 files  ±0   2 340 suites  ±0   4h 30m 48s :stopwatch: + 2m 25s
      908 tests ±0     907 :white_check_mark: ±0   1 :zzz: ±0  0 :x: ±0 
   10 541 runs  ±0  10 527 :white_check_mark: ±0  14 :zzz: ±0  0 :x: ±0 
   
   Results for commit 1a3719f4. ± Comparison against base commit cbf4f6f1.
   
   [test-results]:data:application/gzip;base64,H4sIAKlOCmYC/03MSw7CIBSF4a00jB1wKeXhZgzySIhtMRRGxr0LDUWG5+Pyf5Dzqz3QfSIzxbcJHdmncZscVfJhLwKMUFGovKd6IXFfjyNrfRL/08u/668OTvm1AO5gYwyxScx7bQJeKLR5RYsR3q1V6QVD9dxjVIdt86kMBGrmIB2lAMxpzu0iGXFGGDaDxFo/rVGCWYW+P77wLbwSAQAA
   


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1547671622


##########
integration-test/common/src/test/java/org/apache/uniffle/test/QuorumTest.java:
##########
@@ -316,6 +317,65 @@ public void rpcFailedTest() throws Exception {
     assertEquals(readClient.readShuffleBlockData(), null);
   }
 
+  @Test
+  public void testRpcRetryLogic() {

Review Comment:
   Could you put this test case into another class?



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1547967715


##########
internal-client/src/main/java/org/apache/uniffle/client/request/RssGetShuffleIndexRequest.java:
##########
@@ -47,7 +47,7 @@ public RssGetShuffleIndexRequest(
   @VisibleForTesting
   public RssGetShuffleIndexRequest(
       String appId, int shuffleId, int partitionId, int partitionNumPerRange, int partitionNum) {
-    this(appId, shuffleId, partitionId, partitionNumPerRange, partitionNum, 1, 0);
+    this(appId, shuffleId, partitionId, partitionNumPerRange, partitionNum, 3, 1000);

Review Comment:
   Reverted.



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1547969522


##########
integration-test/common/src/test/java/org/apache/uniffle/test/QuorumTest.java:
##########
@@ -316,6 +317,65 @@ public void rpcFailedTest() throws Exception {
     assertEquals(readClient.readShuffleBlockData(), null);
   }
 
+  @Test
+  public void testRpcRetryLogic() {

Review Comment:
   In `QuorumTest`, there is `rpcFailedTest` already. I think this is the best place to put `testRpcRetryLogic`. 



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2032142580

   Cannot reopen this PR after it's closed. I create a new one. https://github.com/apache/incubator-uniffle/pull/1616


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1546145533


##########
integration-test/common/src/test/java/org/apache/uniffle/test/ShuffleReadWriteBase.java:
##########
@@ -151,7 +151,7 @@ public static ShuffleDataResult readShuffleData(
       SegmentSplitter segmentSplitter) {
     RssGetShuffleIndexRequest rgsir =
         new RssGetShuffleIndexRequest(

Review Comment:
   Done.



##########
internal-client/src/main/java/org/apache/uniffle/client/request/RetryableRequest.java:
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.client.request;
+
+public interface RetryableRequest {

Review Comment:
   Done.



##########
server/src/main/java/org/apache/uniffle/server/buffer/ShuffleBufferManager.java:
##########
@@ -424,35 +422,38 @@ private void releaseFlushMemory(long size) {
     ShuffleServerMetrics.gaugeInFlushBufferSize.set(inFlushSize.get());
   }
 
-  public boolean requireReadMemoryWithRetry(long size) {
+  public boolean requireReadMemory(long size) {
     ShuffleServerMetrics.counterTotalRequireReadMemoryNum.inc();
-    for (int i = 0; i < retryNum; i++) {
-      synchronized (this) {
-        if (readDataMemory.get() + size < readCapacity) {
-          readDataMemory.addAndGet(size);
+    boolean success = false;

Review Comment:
   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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma closed pull request #1611: [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer
URL: https://github.com/apache/incubator-uniffle/pull/1611


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2031146110

   > > quorumTest
   > 
   > If I am correct, the code you related is a different situation. It fails to send to the 1st server, but will succeed when sending to the 2nd server. These are different servers, not the same server. So actually, this is not a retry logic, it's a fallover logic.
   
   You can extend ShuffleServer and then create your own ShuffleServer to override some methods. 


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer [incubator-uniffle]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2029201452

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `3.52941%` with `164 lines` in your changes are missing coverage. Please review.
   > Project coverage is 54.71%. Comparing base [(`cbf4f6f`)](https://app.codecov.io/gh/apache/incubator-uniffle/commit/cbf4f6f1e2e0d7b0b5e03b169f62c602fac30278?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`1a3719f`)](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ffle/client/impl/grpc/ShuffleServerGrpcClient.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NsaWVudC9pbXBsL2dycGMvU2h1ZmZsZVNlcnZlckdycGNDbGllbnQuamF2YQ==) | 0.00% | [62 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...client/impl/grpc/ShuffleServerGrpcNettyClient.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NsaWVudC9pbXBsL2dycGMvU2h1ZmZsZVNlcnZlckdycGNOZXR0eUNsaWVudC5qYXZh) | 0.00% | [36 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...he/uniffle/server/buffer/ShuffleBufferManager.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9idWZmZXIvU2h1ZmZsZUJ1ZmZlck1hbmFnZXIuamF2YQ==) | 0.00% | [12 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...pache/hadoop/mapreduce/task/reduce/RssShuffle.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2xpZW50LW1yL2NvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2hhZG9vcC9tYXByZWR1Y2UvdGFzay9yZWR1Y2UvUnNzU2h1ZmZsZS5qYXZh) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ient/request/RssGetInMemoryShuffleDataRequest.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NsaWVudC9yZXF1ZXN0L1Jzc0dldEluTWVtb3J5U2h1ZmZsZURhdGFSZXF1ZXN0LmphdmE=) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...iffle/client/request/RssGetShuffleDataRequest.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NsaWVudC9yZXF1ZXN0L1Jzc0dldFNodWZmbGVEYXRhUmVxdWVzdC5qYXZh) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ffle/client/request/RssGetShuffleIndexRequest.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwtY2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NsaWVudC9yZXF1ZXN0L1Jzc0dldFNodWZmbGVJbmRleFJlcXVlc3QuamF2YQ==) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...niffle/server/netty/ShuffleServerNettyHandler.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9uZXR0eS9TaHVmZmxlU2VydmVyTmV0dHlIYW5kbGVyLmphdmE=) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...orage/request/CreateShuffleReadHandlerRequest.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3RvcmFnZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvdW5pZmZsZS9zdG9yYWdlL3JlcXVlc3QvQ3JlYXRlU2h1ZmZsZVJlYWRIYW5kbGVyUmVxdWVzdC5qYXZh) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...uniffle/storage/factory/ShuffleHandlerFactory.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3RvcmFnZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvdW5pZmZsZS9zdG9yYWdlL2ZhY3RvcnkvU2h1ZmZsZUhhbmRsZXJGYWN0b3J5LmphdmE=) | 0.00% | [5 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | ... and [4 more](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1611      +/-   ##
   ============================================
   + Coverage     53.92%   54.71%   +0.79%     
   + Complexity     2864     2470     -394     
   ============================================
     Files           438      379      -59     
     Lines         24912    17709    -7203     
     Branches       2123     1608     -515     
   ============================================
   - Hits          13433     9690    -3743     
   + Misses        10636     7464    -3172     
   + Partials        843      555     -288     
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1611?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2031035048

   > quorumTest
   
   If I am correct, the code you related is a different situation. It fails to send to the 1st server, but will succeed when sending to the 2nd server.
   These are different servers, not the same server. So actually, this is not a retry logic, it's a fallover logic. 


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer [incubator-uniffle]

Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1546077059


##########
internal-client/src/main/java/org/apache/uniffle/client/request/RetryableRequest.java:
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.client.request;
+
+public interface RetryableRequest {

Review Comment:
   I think make RetryableRequest as an abstract class be better



##########
server/src/main/java/org/apache/uniffle/server/buffer/ShuffleBufferManager.java:
##########
@@ -424,35 +422,38 @@ private void releaseFlushMemory(long size) {
     ShuffleServerMetrics.gaugeInFlushBufferSize.set(inFlushSize.get());
   }
 
-  public boolean requireReadMemoryWithRetry(long size) {
+  public boolean requireReadMemory(long size) {
     ShuffleServerMetrics.counterTotalRequireReadMemoryNum.inc();
-    for (int i = 0; i < retryNum; i++) {
-      synchronized (this) {
-        if (readDataMemory.get() + size < readCapacity) {
-          readDataMemory.addAndGet(size);
+    boolean success = false;

Review Comment:
   `success` -> `isSuccessful` ? 



##########
integration-test/common/src/test/java/org/apache/uniffle/test/ShuffleReadWriteBase.java:
##########
@@ -151,7 +151,7 @@ public static ShuffleDataResult readShuffleData(
       SegmentSplitter segmentSplitter) {
     RssGetShuffleIndexRequest rgsir =
         new RssGetShuffleIndexRequest(

Review Comment:
   Why not creating the default RssGetShuffleIndexRequest construct with default retryMax=1, that will not effect the previous test cases



##########
server/src/main/java/org/apache/uniffle/server/buffer/ShuffleBufferManager.java:
##########
@@ -424,35 +422,38 @@ private void releaseFlushMemory(long size) {
     ShuffleServerMetrics.gaugeInFlushBufferSize.set(inFlushSize.get());
   }
 
-  public boolean requireReadMemoryWithRetry(long size) {
+  public boolean requireReadMemory(long size) {
     ShuffleServerMetrics.counterTotalRequireReadMemoryNum.inc();
-    for (int i = 0; i < retryNum; i++) {
-      synchronized (this) {
-        if (readDataMemory.get() + size < readCapacity) {
-          readDataMemory.addAndGet(size);
+    boolean success = false;
+
+    do {
+      long currentReadDataMemory = readDataMemory.get();
+      long newReadDataMemory = currentReadDataMemory + size;
+      if (newReadDataMemory < readCapacity) {

Review Comment:
   I perfer as following.
   
   ```
   if (newReadDataMemory >= readCapacity) {
      break;
   }
   if (readDataMemory.compareAndSet(currentReadDataMemory, newReadDataMemory)) {
             ShuffleServerMetrics.gaugeReadBufferUsedSize.inc(size);
             success = true;
             break;
    }
   ```
   
   



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#discussion_r1548792409


##########
internal-client/src/main/java/org/apache/uniffle/client/request/RssGetShuffleIndexRequest.java:
##########
@@ -47,7 +47,7 @@ public RssGetShuffleIndexRequest(
   @VisibleForTesting
   public RssGetShuffleIndexRequest(
       String appId, int shuffleId, int partitionId, int partitionNumPerRange, int partitionNum) {
-    this(appId, shuffleId, partitionId, partitionNumPerRange, partitionNum, 1, 0);
+    this(appId, shuffleId, partitionId, partitionNumPerRange, partitionNum, 3, 1000);

Review Comment:
   We can put them into a new class together.



-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for reading data(memory/local/index) for NO_BUFFER [incubator-uniffle]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2029619668

   Could you add a new UT for this pr?


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for reading data(memory/local/index) for NO_BUFFER [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma closed pull request #1611: [#1606] feat(client): Add retry mechanism for reading data(memory/local/index) for NO_BUFFER
URL: https://github.com/apache/incubator-uniffle/pull/1611


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma closed pull request #1611: [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index)
URL: https://github.com/apache/incubator-uniffle/pull/1611


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] improvement(client): Add retry mechanism for reading data(memory/local/index) when there is no buffer [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2029261009

   @jerqi @zuston PTAL.


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2030928039

   > > Could you add a new UT for this pr?
   > 
   > Existing UTs will cover the code in this PR. What I did is just move the retry logic from the server side to the client side.
   
   We should add the ut for the retry logic.


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


Re: [PR] [#1606] feat(client): Add retry mechanism for NO_BUFFER when reading data(memory/local/index) [incubator-uniffle]

Posted by "rickyma (via GitHub)" <gi...@apache.org>.
rickyma commented on PR #1611:
URL: https://github.com/apache/incubator-uniffle/pull/1611#issuecomment-2030997007

   > quorumTest
   
   I think the test cases in the `QuorumTest` are only for testing the number of successful write replicas, and there is no test case for `retryMax` during writing. It's not easy to simulate the test for the same shuffle server(read or write), where the first request fails and the second request succeeds, right?


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org