-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25982/
-----------------------------------------------------------
Review request for sentry, Arun Suresh, Prasad Mujumdar, and Sravya
Tirukkovalur.
Bugs: SENTRY-458
https://issues.apache.org/jira/browse/SENTRY-458
Repository: sentry
Description
-------
JDO has lock mechanism, as HA design doc [SENTRY-427 SENTRY High
Availability](https://issues.apache.org/jira/browse/SENTRY-427) has discuss ,
we use **optimistic lock** in HA mode, the patch will enable it
* the code changed in **SentryStore** and **MSentryPrivilege** will make sure
version auto-increment per operation, (Quote the design doc: Privilege and Role
is M-N relationship, the grant/revoke will do add/remove in Role_Privilege_MAP,
the version should be added to Role_Privilege_MAP, but currently we use jdo
auto-generate the Role_Privilege_MAP, so the version could only be added to
Role.)
* Add **version** in **package.jdo**
* Add **@VisibleForTesting CommitContext alterSentryRoleGrantPrivilege(String
grantorPrincipal, MSentryRole mRole, TSentryPrivilege privilege) throws
SentryUserException** for test, it will help reproduce makePersistent a lower
version MSentryRole and get a **JDOOptimisticVerificationException**
Diffs
-----
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
0667cb5
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
9abaab8
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
1bf3faf
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestHASentryStore.java
PRE-CREATION
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java
befecf4
Diff: https://reviews.apache.org/r/25982/diff/
Testing
-------
Unit Tests in local
Thanks,
Sun Dapeng