zhixinwen opened a new issue, #3244:
URL: https://github.com/apache/kvrocks/issues/3244

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
   
   
   ### Motivation
   
   In  WAIT cmd, there was some optimization that would work for the normal 
usecase:
   When master sends change to a replica, it would check if the change would 
unblock a blocked WAIT. If yes, master would send _getack. When replica sees 
_getack, it would immediately send out ack $sequence after it processes the 
change. This works fine in an env where WAIT and non-WAIT cmd are used in mix.
   
   However, there is one issue. On master, WRITE and WAIT are executed as two 
separate commands. And the replication logic is in its own thread. Therefore, 
it is possible, the replication logic processes the WRITE before WAIT finishes. 
As a result, master may not send _getack in some cases because it does not know 
the WRITE would be blocked. Replica would not send ack in time, it would need 
to wait for next write/ping to send the ack.
   
   ### Solution
   
   Not sure if there is a good general way.
   In my internal CI env, I just add an option to force replica to ack on every 
replicated batch.
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a 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: [email protected]

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

Reply via email to