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

Avoid leader election for invalid conf

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 2.3.0
    • server
    • None

    Description

       

      1private void yieldLeaderToHigherPriorityPeer() {
      2  if (!server.getInfo().isLeader()) {
      3    return;
      4  }
      
      5  final RaftConfigurationImpl conf = server.getRaftConf();
      6  int leaderPriority = conf.getPeer(server.getId()).getPriority(); 

      During my test in k8s env, I met the corner case where the ozone progress met NPE and was shut down. The log shows it is thrown at line 6. It is possible in some cases configuration may not include the server itself. The case happened when bootstrapping the second SCM. Thus there should have a null check before getPriority.

      -------

      The attachment is the error log caught.

      Attachments

        1. 560_reivew.patch
          5 kB
          Tsz-wo Sze
        2. npe-1
          29 kB
          Xu Shao Hong

        Issue Links

          Activity

            People

              Nibiruxu Xu Shao Hong
              Nibiruxu Xu Shao Hong
              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 - 3h 40m
                  3h 40m