----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58221/#review173795 -----------------------------------------------------------
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java Lines 107 (patched) <https://reviews.apache.org/r/58221/#comment246830> We have to move the code here to avoid running full snapshot multiple times. after the first time, getting empty full snapshot at run() will cause exception. SENTRY-1712 Add capability to force Sentry to get full snapshot from HMS will provide more flexibility to get full snapshot. Example of the exception if this code is put in run() instead of constructor. 2017-05-03 09:58:42,209 (pool-5-thread-1) [ERROR - org.apache.sentry.service.thrift.HMSFollower.run(HMSFollower.java:304)] Caught unexpected exception in HMSFollower! Caused by: AuthzObj: default already exists org.apache.sentry.core.common.exception.SentryAlreadyExistsException: AuthzObj: default already exists at org.apache.sentry.provider.db.service.persistent.SentryStore.createAuthzPathsMappingCore(SentryStore.java:2541) at org.apache.sentry.provider.db.service.persistent.SentryStore.access$3000(SentryStore.java:101) at org.apache.sentry.provider.db.service.persistent.SentryStore$42.execute(SentryStore.java:2515) at org.apache.sentry.provider.db.service.persistent.TransactionManager.executeTransaction(TransactionManager.java:114) at org.apache.sentry.provider.db.service.persistent.TransactionManager.executeTransactionWithRetry(TransactionManager.java:181) at org.apache.sentry.provider.db.service.persistent.SentryStore.persistFullPathsImage(SentryStore.java:2511) at org.apache.sentry.service.thrift.HMSFollower.run(HMSFollower.java:269) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java Line 172 (original), 172 (patched) <https://reviews.apache.org/r/58221/#comment246829> since we start HMSFollower in SentryService.runServer() now, having a long delay will cause the unit test to fail. The reason is that HMSFollower has not run before the test starts and finishes, so no permission is obtained. - Na Li On May 3, 2017, 7:20 p.m., Na Li wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58221/ > ----------------------------------------------------------- > > (Updated May 3, 2017, 7:20 p.m.) > > > Review request for sentry, Alexander Kolbasov, Hao Hao, kalyan kumar > kalvagadda, and Sergio Pena. > > > Repository: sentry > > > Description > ------- > > SENTRY-1649 move HMS follower to runServer > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java > ec8676e > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java > 132db63 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceUtil.java > ce73358 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java > 834ed41 > > sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hdfs/TestHDFSIntegrationEnd2End.java > 1ace07c > > > Diff: https://reviews.apache.org/r/58221/diff/23/ > > > Testing > ------- > > > Thanks, > > Na Li > >
