Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-17198

RBF: fix bug of getRepresentativeQuorum when records have same dateModified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • rbf
    • Reviewed

    Description

      Bug description

      In the original implementation, when each router reports nn status at different times, the nn status is the status reported by majority routers, for example:
      router1 -> nn0:active dateModified:1

      router2 -> nn0:active dateModified:2

      router3 -> nn0:active dateModified:3

      router0 -> nn0:standby dateModified:4

      Then, the status of nn0 is active, because majority routers report that nn0 is active.

      If majority routers report nn status at the same time, for example:
      (record1) router1 -> nn0:active dateModified:1

      (record2) router2 -> nn0:active dateModified:1

      (record3) router3 -> nn0:active dateModified:1

      (record4) router0 -> nn0:standbydateModified:2

      Then the state of nn0 is standby, but We expect the status of nn0 is active

      This bug is because the above record is put into the Treeset in the method getRepresentativeQuorum. Since record1,2,3 have the same dateModified, there will only be one record in the final treeset of this method, so this method thinks that this nn is standby, because record4 newer

      How to reproduce

      Running my unit test testRegistrationMajorityQuorumEqDateModified, but using the original code

      Attachments

        1. HDFS-17198.patch
          5 kB
          Jian Zhang
        2. HDFS-17198.v001.patch
          6 kB
          Jian Zhang

        Issue Links

          Activity

            People

              Keepromise Jian Zhang
              Keepromise Jian Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: