Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-2823 SCM HA Support
  3. HDDS-5205

Make admin check work for SCM HA cluster

    XMLWordPrintableJSON

Details

    Description

      By default, the user started principal is added to scmAdminUsernames.

          String scmUsername = UserGroupInformation.getCurrentUser().getUserName();
          if (!scmAdminUsernames.contains(scmUsername)) {
            scmAdminUsernames.add(scmUsername);
          }
      

      In HA cluster, when kinit with scm2 principal when scm1 is leader, we get access denied as we check getUserName() and also when adding to adminlist we use getUserName.

      In OM we don't have this kind of issue, as getShortUserName() is used.

        String omSPN = UserGroupInformation.getCurrentUser().getShortUserName();
          if (!ozAdmins.contains(omSPN)) {
            ozAdmins.add(omSPN);
          }
      

      And during admin check it compares with both userName and shortUserName.

      if (ozAdmins.contains(callerUgi.getShortUserName()) ||
              ozAdmins.contains(callerUgi.getUserName()) ||
      

      Attachments

        Issue Links

          Activity

            People

              bharat Bharat Viswanadham
              bharat Bharat Viswanadham
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: