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

SegmentedRaftLogCache#shouldEvict should only iterate over closed segments once

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.0, 2.4.1, 2.5.0, 2.5.1
    • 3.0.0
    • None
    • None

    Description

      It's observed that `SegmentedLogCache#shouldEvict` iterate over the `closedSegments` twice:

      • `LogSegmentList#countCached`
      • `LogSegmentList#getTotalCacheSize`

      We can improve this by iterating over the `closedSegments` once.

      Attachments

        1. profile_cpu_high_rpc_0915_ck_om3.html
          977 kB
          Ivan Andika
        2. image-2023-09-18-13-17-25-569.png
          249 kB
          Ivan Andika
        3. 921_review.patch
          3 kB
          Tsz-wo Sze

        Issue Links

          Activity

            People

              ivanandika Ivan Andika
              ivanandika Ivan Andika
              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 - 20m
                  20m