Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-2089

Add CommitInfoProto in NotReplicatedException

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.1.0
    • client
    • None

    Description

      In Ozone's XceiverClientRatis#watchForCommit, there are two watch commits request with different ReplicationLevel

      1. Watch for ALL_COMMITTED 
      2. Watch for MAJORITY_COMMITTED (If the previous watch threw an exception)

      Based on the second watch request, the client will remove some failed datanode UUID from the commitInfoMap.

      The second watch might not be necessary since the entries in AbstractCommitWatcher.commitIndexMap implies that the PutBlock request has been committed to the majority of the servers. Therefore, another MAJORITY_COMMITTED watch might not be necessary. From my understanding, the second MAJORITY_COMMITTED only serves to gain information to remove entries from commitInfoMap.

      If the first watch failed with NotReplicatedException, we might be able to remove the need to a second watch request. Since NotReplicatedException is a Raft server exception, we can include the CommitInfoProtos in the NotReplicatedException. The client can use this CommitInfoProtos to remove the entry from commitInfoMap without sending another WATCH request. 

      This CommitInfoProto is returned for every RaftClientReply (RaftClientReply.commitInfos), but if there is an exception, it seems the RaftClientReply is not accessible to the client.

      However, if the exception is a client exception (e.g. due to Raft client watch timeout configuration), the client might have no choice but to send another watch request.

      So in this patch, I propose to include CommitInfoProto into NotReplicatedException.

      Attachments

        Issue Links

          Activity

            People

              ivanandika Ivan Andika
              ivanandika Ivan Andika
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m