Issues with Responses for Uncommitted Entries When Changing Leaders

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 更换leader时,对于未committed的entries的response的问题

| username: Haining

When there are some uncommitted entries during a leader change, some of these entries will be present in the new leader, but some will not. How should the client be responded to in this situation? These uncommitted entries might be applied or overridden by the new leader, and the original client’s request callback is still in the original leader’s proposal. Therefore, the original leader does not know the final situation. If the client is simply asked to retry and send the message to the new leader, it might result in the same command being executed twice. I would like to ask everyone, how is this situation handled?