[
https://issues.apache.org/jira/browse/RATIS-571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16852588#comment-16852588
]
Lokesh Jain commented on RATIS-571:
-----------------------------------
[~szetszwo] Thanks for reviewing the patch!
| Client.isFirst seems incorrect since the entires may be removed from the map.
It gives the current first entry in the sliding window. Do you want me to
rename the api to sth like currentFirst?
| Why changing RequestMap.requests to ConcurrentSkipListMap? It is already
synchronized.
In Client.removeRepliesFromHead we are iterating over the map and removing
entries. Therefore we can either synchronize that operation on the RequestMap
or convert the map to a ConcurrentSkipListMap. If we use ConcurrentSkipListMap
we can remove synchronized usage in RequestMap?
| Why removing firstSeqNum from SlidingWindow.Client?
I was thinking of relying on the current first request in the sliding window.
But it might be incorrect. I will revert that change.
> Client may send first request in sliding window with firstFlag as false
> -----------------------------------------------------------------------
>
> Key: RATIS-571
> URL: https://issues.apache.org/jira/browse/RATIS-571
> Project: Ratis
> Issue Type: Bug
> Reporter: Lokesh Jain
> Assignee: Lokesh Jain
> Priority: Major
> Attachments: RATIS-571.001.patch, RATIS-571.002.patch
>
>
> It is possible for the client to send first request in sliding window with
> firstFlag as false.
> In the below example, request with sequence number 73 is accepted in the
> sliding window when the first request is 70. Therefore its first flag is
> false. After that the request with sequence 72 gets a reply from the stream
> observer dc40cfe3. When request 73 is sent to stream observer 87103303 the
> first flag as false and is therefore never processed in the new stream
> observer. It leads to all requests in the server sliding window to be blocked.
>
> {code:java}
> 2019-05-26 11:07:50,532 INFO util.SlidingWindow
> (SlidingWindow.java:sendOrDelayRequest(243)) -
> uid=4272f0d0-95e7-461a-9201-82ddfb218847 request seqNum=73 requestsFirst=70
> firstSeqNum=-1 request=RaftClien
> tRequest:client-DBC1276EA2C1->s0@group-6920A8550E5D, cid=952, seq=73, RW, 3-72
> 2019-05-26 11:07:50,622 INFO util.SlidingWindow
> (SlidingWindow.java:sendRepliesFromHead(439)) -
> dc40cfe3-a06a-43db-893e-e86b0cd41a8b server send reply seq=72
> request=RaftClientRequest:client-DBC1276EA2C1
> ->s1@group-6920A8550E5D, cid=938, seq=72*, RW,
> Message:332d3731:RaftClientReply:client-DBC1276EA2C1->s1@group-6920A8550E5D,
> cid=938, SUCCESS, logIndex=842, commits[s1:c914, s0:c914, s2:c717]
> 2019-05-26 11:07:50,628 DEBUG client.RaftClient
> (RaftClientImpl.java:sendRequestAsync(364)) - client-DBC1276EA2C1: send*
> RaftClientRequest:client-DBC1276EA2C1->s2@group-6920A8550E5D, cid=952,
> seq=73, RW, 3-72
> 2019-05-26 11:07:50,633 INFO util.SlidingWindow
> (SlidingWindow.java:receivedRequest(398)) -
> uid=87103303-ba73-45bf-b2ee-e6c8debf7a25 server received
> request=RaftClientRequest:client-DBC1276EA2C1->s2@group-6920A8550E5D,
> cid=952, seq=73, RW, Message:332d3732:null 13-OrderedRequestStreamObserver13:
> got seq=73 in 13-OrderedRequestStreamObserver13: requests[], nextToProcess=-1
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)