----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/62107/#review184681 -----------------------------------------------------------
sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/DBUpdateForwarder.java Line 105 (original), 108 (patched) <https://reviews.apache.org/r/62107/#comment260871> We should check if( seqNum > EMPTY_NOTIFICATION_ID && ...) When client sends seqNum, it sends the inital value (-1) + 1, so the seqNum received by sentry server is 0. And it should get full snapshot, not delta. Definitions are below. // number used in authz paths and permissions to request initial syncs public static final long SEQUENCE_NUMBER_UPDATE_UNINITIALIZED = -1L; public static final long EMPTY_NOTIFICATION_ID = 0L; sentry-hdfs/sentry-hdfs-service/src/test/java/org/apache/sentry/hdfs/TestDBUpdateForwarder.java Lines 69 (patched) <https://reviews.apache.org/r/62107/#comment260872> the server should receive 0 (EMPTY_NOTIFICATION_ID) in real operation, so the input should be 0, not -1. In UpdateableAuthzPaths, the seqNum is initialized to -1. seqNum = new AtomicLong(SEQUENCE_NUMBER_UPDATE_UNINITIALIZED) In SentryUpdater, the client (HDFS) sends (-1 + 1) to Sentry Server. ============= return sentryClient.getAllUpdatesFrom( authzInfo.getAuthzPermissions().getLastUpdatedSeqNum() + 1, authzInfo.getAuthzPaths().getLastUpdatedSeqNum() + 1, authzInfo.getAuthzPaths().getLastUpdatedImgNum()); ================= - Na Li On Sept. 6, 2017, 2:24 p.m., Brian Towles wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/62107/ > ----------------------------------------------------------- > > (Updated Sept. 6, 2017, 2:24 p.m.) > > > Review request for sentry, Alexander Kolbasov, Arjun Mishra, Na Li, Sergio > Pena, and Vadim Spector. > > > Bugs: SENTRY-1918 > https://issues.apache.org/jira/browse/SENTRY-1918 > > > Repository: sentry > > > Description > ------- > > Added fix to limit sending back of full snapshot when the HMSFollower is > pulling a full snapshot > > > Diffs > ----- > > > sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/DBUpdateForwarder.java > 5d744214e14d6c48194b3a0bf84d6e10070b020a > > sentry-hdfs/sentry-hdfs-service/src/test/java/org/apache/sentry/hdfs/TestDBUpdateForwarder.java > 8fbc10048003ab4b8a38676e241ae0fd27d2392c > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java > d4feb380fa0f3bd5f237609a107295a2d23eae3b > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java > d44abffc199cd46d3ab7d2230dfdb2075736a8f0 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceFactory.java > 1685702c6dbc9715c8885a29a80bc68509550f0b > > > Diff: https://reviews.apache.org/r/62107/diff/3/ > > > Testing > ------- > > Unit Tests > > > Thanks, > > Brian Towles > >