Uploaded image for project: 'Sentry (Retired)'
  1. Sentry (Retired)
  2. SENTRY-2184

Performance Issue: MPath is queried for each MAuthzPathsMapping in full snapshot

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.1.0
    • 2.1.0
    • Sentry
    • None

    Description

      MAuthzPathsMapping contains list of MPath instances. From log message, when getting path full snapshot at SentryStore.retrieveFullPathsImageCore(), DataNucleus issues a query for all MPath instances associated with each MAuthzPathsMapping. Therefore, getting full path image may take a very long time.

      The solution is to get MPath in a batch when getting full path image.

      Log Message when DataNucleus issues a query for all MPath instances associated with each MAuthzPathsMapping

      1) Initially, all MAuthzPathsMapping entries for current snapshot is queried.
      
      2018-03-14 11:51:23,999 (main) [DEBUG - org.datanucleus.util.Log4JLogger.debug(Log4JLogger.java:58)] SELECT 'org.apache.sentry.provider.db.service.model.MAuthzPathsMapping' AS NUCLEUS_TYPE,A0.AUTHZ_OBJ_NAME,A0.AUTHZ_SNAPSHOT_ID,A0.CREATE_TIME_MS,A0.AUTHZ_OBJ_ID FROM AUTHZ_PATHS_MAPPING A0 WHERE A0.AUTHZ_SNAPSHOT_ID = <1>
      
      2) call authzToPaths.getPathStrings() causes MPath to be queried for each AUTHZ_OBJ_ID
      
      2018-03-14 11:52:27,700 (main) [DEBUG - org.datanucleus.util.Log4JLogger.debug(Log4JLogger.java:58)] SELECT 'org.apache.sentry.provider.db.service.model.MPath' AS NUCLEUS_TYPE,A0.PATH_NAME,A0.PATH_ID FROM AUTHZ_PATH A0 WHERE A0.AUTHZ_OBJ_ID = <1>

      Attachments

        1. SENTRY-2184.003.patch
          2 kB
          Na Li
        2. SENTRY-2184.002.patch
          2 kB
          Na Li
        3. SENTRY-2184.001.patch
          3 kB
          Na Li

        Issue Links

          Activity

            People

              linaataustin Na Li
              linaataustin Na Li
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Issue deployment