[ https://issues.apache.org/jira/browse/SENTRY-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16030338#comment-16030338 ]
kalyan kumar kalvagadda edited comment on SENTRY-1788 at 5/30/17 11:15 PM: --------------------------------------------------------------------------- *Root Cause:* Application was using JDO object even after the associated database entry was deleted. *Fix:* Made code change so that JDO object is detached so that deletion of data in the database would not invalidate the object used by the application. parent object which is an JDO object used in SentryStore.dropOrRenamePrivilegeForAllRoles after associated data in the database is deleted. Method alterSentryRoleRevokePrivilegeCore which called would internally delete the data from database.As part of this exercise I have identified some optimization as well. *Optimization:* dropOrRenamePrivilegeForAllRoles method handles both drop and rename of privileges. There is certain logic which constructs privilege graph which is executed for both dropping and renaming of the privilege. This logic needs to be executed only for renaming of privileges as the privilege graph constructed is used only when the privilege is renamed. was (Author: kkalyan): Identified the root cause and a solution for these failure. Testing them. *Root Cause:* Application was using JDO object even after the associated database entry was deleted. *Fix:* Made code change so that JDO object is detached so that deletion of data in the database would not invalidate the object used by the application. parent object which is an JDO object used in SentryStore.dropOrRenamePrivilegeForAllRoles after associated data in the database is deleted. Method alterSentryRoleRevokePrivilegeCore which called would internally delete the data from database.As part of this exercise I have identified some optimization as well. *Optimization:* dropOrRenamePrivilegeForAllRoles method handles both drop and rename of privileges. There is certain logic which constructs privilege graph which is executed for both dropping and renaming of the privilege. This logic needs to be executed only for renaming of privileges as the privilege graph constructed is used only when the privilege is renamed. > Sentry Store may use JDO object after the associated data is removed in DB > -------------------------------------------------------------------------- > > Key: SENTRY-1788 > URL: https://issues.apache.org/jira/browse/SENTRY-1788 > Project: Sentry > Issue Type: Bug > Components: Sentry > Affects Versions: 1.8.0, sentry-ha-redesign > Reporter: kalyan kumar kalvagadda > Assignee: kalyan kumar kalvagadda > Fix For: 1.8.0, sentry-ha-redesign > > Attachments: SENTRY-1788.001.patch, > SENTRY-1788.001-sentry-ha-redesign.patch, SENTRY-1788.002.patch, > SENTRY-1788.002-sentry-ha-redesign.patch > > > Currently sentry store might use the JDO object after the associated data is > removed in DB. -- This message was sent by Atlassian JIRA (v6.3.15#6346)