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

Delay snapshot MD5 computing to InstallSnapshot stream process

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.0, 3.0.0
    • performance
    • None

    Description

      Leader’s LogAppender while-loop checks latest snapshot info to decide wether to send a snapshot to a follower. The SnapshotInfo includes every snapshot file with its MD5 digest. Therefore, StateMachine is required to compute MD5 each time it takes a snapshot. 
       
      However, for database workload, snapshot files may contain GBs of data, which makes MD5 computing a very consuming task. Since MD5 is only used when leader InstallSnapshot to a follower, it is better to compute MD5 along with InstallSnapshot stream process.
       
      Currently, InstallSnapshot stream process will break snapshot file into fixed-size chunks and send them to followers one by one. Is it possible to calculate MD5 when reading each chunk? This implementation can avoid precomputing MD5 and minimize the IO cost.

      Attachments

        1. 661_review.patch
          6 kB
          Tsz-wo Sze

        Issue Links

          Activity

            People

              William Song Song Ziyang
              William Song Song Ziyang
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 2h
                  2h