-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59720/
-----------------------------------------------------------

(Updated June 14, 2017, 6:25 p.m.)


Review request for sentry, Alexander Kolbasov, kalyan kumar kalvagadda, and 
Vamsee Yarlagadda.


Changes
-------

Addressed comments from Sasha:

- Incremement the HMS image ID on the application. The HMS image ID is a 
primary key on the MHiveMetastoreImage, so if another thread attempts to 
persist the same ID, then the other thread will fail.
- Use just the HMS Image ID as a reference on the MAuthzPathsMapping to avoid 
datanucleus to create hidden tables


Bugs: SENTRY-1781
    https://issues.apache.org/jira/browse/SENTRY-1781


Repository: sentry


Description
-------

This patch only adds an extra column to the MAuthzPathsMapping table that 
contains an image identifier that will be used to detect full snapshots. This 
patch does not increment the identifier yet, it only uses 0 for now.

TIPS for reviewers:

- package.jdo adds a new column name AUTHZ_IMG_ID to the AUTHZ_MAPS_MAPPING 
table used to identify the paths that are part of a new hive snapshot.

- MAuthzPathsMapping.java adds the the new column and API to handle JDO 
requests.

- SentryStore.java modifies all methods that interact with the snapshots. It 
makes sure that
  when persisting a new snapshot, then the authzImgID is incremented and the 
old one is
  deleted. Also it makes sure that retrieve/add/delete/rename/update uses the 
current 
  authzImgID whenver they're called.

- TestSentryStore.java adds unit tests to verify that all SentryStore API work 
correctly
  when a new hive snapshot is created.


Diffs (updated)
-----

  
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MAuthzPathsMapping.java
 f51894bb7e109c37997e7134e07a82f46c0a3c44 
  
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MHiveMetastoreImage.java
 PRE-CREATION 
  
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/package.jdo
 459939b7600e05d57c7e11eefe20c2591cac0b34 
  
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
 8b19c88e52400ce096cf8f38fe2ca0313f7e46e1 
  
sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java
 29878c5f1213062cb9d0a1f9666a19004b67dc52 


Diff: https://reviews.apache.org/r/59720/diff/8/

Changes: https://reviews.apache.org/r/59720/diff/7-8/


Testing
-------

All unit tests run locally, but there are some flaky tests on Jenkins no 
related to this patch.


Thanks,

Sergio Pena

Reply via email to