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

Investigate problems with Oracle and serializable transactions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.8.0, 2.0.0
    • None
    • Sentry

    Description

      We discovered during testing with Oracle that when transaction level is set to Serializable, a lot of transactions start to fail complaining about failure to serialize.

      We need to investigate the causes for this.

      One thing that we discovered is that the simple createSentryRole() fails.
      This one is:

                  String trimmedRoleName = trimAndLower(roleName);
                  if (getRole(pm, trimmedRoleName) != null) {
                    throw new SentryAlreadyExistsException("Role: " + trimmedRoleName);
                  }
                  pm.makePersistent(new MSentryRole(trimmedRoleName));
       

      If we try this operation, for multiple roles, an interesting thing happens. The first time it fails, the second two succeed, then the next one fails again, the two more succeed, etc.

      This failure is masked by our transaction retry mechanism, so we need to disable it to see the failures.

      Removal of the check for existing roles fixes this particular problem. It seems that Oracle isn't happy when we scan the table and modify it in the same transaction which we do in multiple other cases.

      Another discovered case is alterSentryRoleGrantPrivilegeCore:
      which does

           pm.makePersistent(mRole);
            pm.makePersistent(mPrivilege);
      

      It is quite possible that we do not need to make both persistent.

      Attachments

        Activity

          People

            Unassigned Unassigned
            akolb Alex Kolbasov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: