[ 
https://issues.apache.org/jira/browse/RATIS-2677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsz-wo Sze updated RATIS-2677:
------------------------------
    Description: 
{code}
//OrderedAsync
  private void sendRequestWithRetry(PendingOrderedRequest pending) {
    ...
    if (getSlidingWindow(request).isFirst(pending.getSeqNum())) {
      pending.setFirstRequest();
    }
    ...
  }
{code}
{code}

As pointed out by Teligen_ligc in [this 
email|https://lists.apache.org/thread/3vnv0ro2vvz8ckm08t7mm93yo2c1g4f1], the 
call setFirstRequest() above is not needed since it is already set by 
[SlidingWindow$Client.sendOrDelayRequest(..)|https://github.com/apache/ratis/blob/31427daaab2a4f7e95d3be0a0bd654683f7965c4/ratis-common/src/main/java/org/apache/ratis/util/SlidingWindow.java#L314].

- It is better to change setFirstRequest() in OrderedAsync to an assertion.
- We should also include isFirst info in the log messages.


  was:
{code}
//OrderedAsync
  private void sendRequestWithRetry(PendingOrderedRequest pending) {
    ...
    if (getSlidingWindow(request).isFirst(pending.getSeqNum())) {
      pending.setFirstRequest();
    }
    ...
  }
{code}
{code}

As pointed out by Teligen_ligc in [this 
email|https://lists.apache.org/thread/3vnv0ro2vvz8ckm08t7mm93yo2c1g4f1], the 
call setFirstRequest() above is not needed since it is already set by 
[SlidingWindow$Client.sendOrDelayRequest(..)|https://github.com/apache/ratis/blob/31427daaab2a4f7e95d3be0a0bd654683f7965c4/ratis-common/src/main/java/org/apache/ratis/util/SlidingWindow.java#L314].



> In OrderedAsync, setFirstRequest() is not needed.
> -------------------------------------------------
>
>                 Key: RATIS-2677
>                 URL: https://issues.apache.org/jira/browse/RATIS-2677
>             Project: Ratis
>          Issue Type: Improvement
>          Components: client
>            Reporter: Tsz-wo Sze
>            Priority: Major
>
> {code}
> //OrderedAsync
>   private void sendRequestWithRetry(PendingOrderedRequest pending) {
>     ...
>     if (getSlidingWindow(request).isFirst(pending.getSeqNum())) {
>       pending.setFirstRequest();
>     }
>     ...
>   }
> {code}
> {code}
> As pointed out by Teligen_ligc in [this 
> email|https://lists.apache.org/thread/3vnv0ro2vvz8ckm08t7mm93yo2c1g4f1], the 
> call setFirstRequest() above is not needed since it is already set by 
> [SlidingWindow$Client.sendOrDelayRequest(..)|https://github.com/apache/ratis/blob/31427daaab2a4f7e95d3be0a0bd654683f7965c4/ratis-common/src/main/java/org/apache/ratis/util/SlidingWindow.java#L314].
> - It is better to change setFirstRequest() in OrderedAsync to an assertion.
> - We should also include isFirst info in the log messages.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to