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

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
   
   
   ### Version
   
   
https://github.com/apache/kvrocks/blob/9c9ffb82de7fd70e02ae0244faf05677d27f53b0/src/cluster/slot_migrate.cc#L424-L445
   In `finishSuccessfulMigration`, the code first set SUCCESS on dest node then 
the local cluster marks the slot range on itself as migrated.
   
   However, if the dest node has some network issue and we have an error for 
`setImportStatusOnDstNode`, then it is possible the dest node actually 
successfully processed `setImportStatusOnDstNode` and put the slot in 
`imported_slots_`.However, the local cluster does not mark the slot as migrated.
   
   In this case, the old node would be able to serve read. And the new node 
would be able to server read and write: 
https://github.com/apache/kvrocks/blob/9c9ffb82de7fd70e02ae0244faf05677d27f53b0/src/cluster/cluster.cc#L926-L930
   
   And if clients are sending traffic to the two nodes at the same time (e.g. 
because some clients have old slot mapping), then it is possible the clients 
hitting old node may see stale value.
   
   In 
https://github.com/apache/kvrocks/blob/9c9ffb82de7fd70e02ae0244faf05677d27f53b0/src/cluster/cluster.cc#L926-L930,
 should we only return OK if the connection is in ASKING mode?
   
   
   ### Minimal reproduce step
   
   N/A
   
   ### What did you expect to see?
   
   N/A
   
   ### What did you see instead?
   
   N/A
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [x] 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