Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-2244

Groups list loader sets loaded=false for groups of all other jobs

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Unresolved
    • 2.3.1, 2.4.0, 2.3.0.patch
    • None
    • grouperLoader
    • None

    Description

      When a groups list loader job runs, it checks the current set of all groups in scope, and compares vs attributes of all jobs for Loaded=true and GroupId=(loader groupId). If a group matches the attributes but isn't currently loaded, it changes the Loaded attribute from true to false.

      But due to a bug, it is only looking for attribute Loaded=true, and fails to include the search for GroupId matching the current loader job. The effect of this is to set Loaded from true to false for the groups of any loader, not just the current one.

      The affected code is from GRP-1678 (grouperLoader attribute metadata has incorrect groupId and unassigns attributes that shouldnt be causing stale state exceptions), which is a 2.3 patch.

      (commit bcc6d3f50b4851ddabffee3e78e0cf996aef9451 Wed Feb 14 05:03:01 2018)

         private static Set<Group> getGroupsNoLongerMangedByLoader(Set<String> groupNamesInLoader, String groupIdConfigured) {
       
           Set<Group> groupsNoLongerManagedByLoader = new HashSet<Group>();
           AttributeDefName loaderMetadataAttributeDefName = AttributeDefNameFinder.findByName(loaderMetadataStemName()+":"+ATTRIBUTE_GROUPER_LOADER_METADATA_GROUP_ID, false);
      +    AttributeDefName loaderMetadataLoadedAttributeDefName = AttributeDefNameFinder.findByName(loaderMetadataStemName()+":"+ATTRIBUTE_GROUPER_LOADER_METADATA_LAODED, false);
           //get all groups with settings
           Set<Group> groupsWithLoaderMetadata = new GroupFinder().assignPrivileges(null)
               .assignIdOfAttributeDefName(loaderMetadataAttributeDefName.getId())
               .assignAttributeValuesOnAssignment(GrouperUtil.toSetObjectType(groupIdConfigured))
      +        .assignIdOfAttributeDefName(loaderMetadataLoadedAttributeDefName.getId())
      +        .assignAttributeValuesOnAssignment(GrouperUtil.toSetObjectType("true"))
               .assignAttributeCheckReadOnAttributeDef(false)
               .findGroups();
      

      So the existing code did a search for all groups having the GroupId attribute. Then code was added to search for Loaded=true. But the attribute search criteria is not additive; the Loaded search instead replaces the GroupId search, so it's returning all groups currently being loaded by all group loaders.

      (note: The METADATA_LAODED typo is not the issue; it was fixed in a later commit)

      I haven't checked LDAP loaders, but I have confirmed this does happen for SQL_GROUP_LIST loaders (will attach test script).

      Attachments

        Activity

          People

            chad.redman@at.internet2.edu Chad Redman (unc.edu)
            chad.redman@at.internet2.edu Chad Redman (unc.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Smart Checklist