Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-31610

Refactoring of LocalBufferPool

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.17.0
    • None
    • Runtime / Network
    • None

    Description

      FLINK-31293 bug highlighted the issue with the internal mutual consistency of different fields in LocalBufferPool. ex.:

      • `numberOfRequestedOverdraftMemorySegments`
      • `numberOfRequestedMemorySegments`
      • `availableMemorySegment`
      • `currentPoolSize`

      Most of the problem was fixed already(I hope) but it is a good idea to reorganize the code in such a way that all invariants between all fields inside will be clearly determined and difficult to break.

      As one example I can propose getting rid of numberOfRequestedOverdraftMemorySegments and using existing numberOfRequestedMemorySegments instead. That means:

      • the pool will be available when `!availableMemorySegments.isEmpty() && unavailableSubpartitionsCount == 0`
      • we don't request a new `ordinary` buffer when `numberOfRequestedMemorySegments >=  currentPoolSize` but we request the overdraft buffer instead
      • `setNumBuffers` should work automatically without any changes

      I think we can come up with a couple of such improvements to simplify the code.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              akalash Anton Kalashnikov
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: