Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-26522 FLIP-285: Refactoring code for multiple component leader election
  3. FLINK-31838

Move thread handling from DefaultMultipleComponentLeaderElectionService into DefaultLeaderElectionService

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.18.0
    • None

    Description

      While working on FLINK-31773 we noticed in the PR (see comment #1 and comment #2) that there's a different notion of responsibility of the thread handling between the FLINK-24038 and the pre-FLINK-24038 implementation of the leader election. The latter one (i.e. 
      DefaultLeaderElectionService) doesn't need to deal with where onGrantLeadership and onRevokeLeadership are called because those are called in a separate thread in the driver. The new implementation (i.e. 
      DefaultMultipleComponentLeaderElectionService) has to call the onGrantLeadership and onRevokeLeadership methods itself when registering new contenders. This would happen in the main thread of the LeaderContender which is not suitable. DefaultMultipleComponentLeaderElectionService solves this by introducing its own threadpool.

      The separation of driver and contender in FLINK-31773 requires such a executionService in DefaultLeaderElectionService as well before going ahead with FLINK-31773.

      Attachments

        Issue Links

          Activity

            People

              mapohl Matthias Pohl
              mapohl Matthias Pohl
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: