> On Jan. 6, 2017, 5:20 a.m., Misha Dmitriev wrote: > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/HAContext.java, > > line 173 > > <https://reviews.apache.org/r/55190/diff/2/?file=1598234#file1598234line173> > > > > I wonder why this method is public and the previous one is not - is > > that intentional?
ANother one isn't used by anyone yet - this may change later. > On Jan. 6, 2017, 5:20 a.m., Misha Dmitriev wrote: > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/LeaderStatusMonitor.java, > > line 122 > > <https://reviews.apache.org/r/55190/diff/2/?file=1598240#file1598240line122> > > > > I've checked how this Lock is used, and it looks like there is nothing > > sophisticated about it. It can be replaced with simple synchronized {} > > (maybe still on a separate 'Object lock'), which will make the code easier > > to read and less error-prone. There is nothing sofisticated but we need condition variable associated with the lock to send signal - see deactivate() and takeLeadership() which calls cond.await() - that's the reason to have a lock. > On Jan. 6, 2017, 5:20 a.m., Misha Dmitriev wrote: > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/LeaderStatusMonitor.java, > > line 171 > > <https://reviews.apache.org/r/55190/diff/2/?file=1598240#file1598240line171> > > > > A more sensible name for this method would be 'finishInitialization()'. > > I am not really convinced that this functionality should be in a separate > > method - the javadoc doesn't give any profound reasons. But, well, up to > > you. The reason is not to publish 'this' for another thread until it isn't fully constrcted. This may cause visibility problems. - Alexander ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/55190/#review160672 ----------------------------------------------------------- On Jan. 6, 2017, 2:14 a.m., Alexander Kolbasov wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/55190/ > ----------------------------------------------------------- > > (Updated Jan. 6, 2017, 2:14 a.m.) > > > Review request for sentry, Colin Ma, Misha Dmitriev, Dapeng Sun, Hao Hao, > kalyan kumar kalvagadda, Vamsee Yarlagadda, and Vadim Spector. > > > Bugs: SENTRY-1583 > https://issues.apache.org/jira/browse/SENTRY-1583 > > > Repository: sentry > > > Description > ------- > > - Restored HAContext class > - Removed Fencing support from HA > - Removed Activator, Activators, and LeaderStatus classes > - Renamed LeaderStatusAdaptor to LeaderStatusMonitor which is now the sole > class responsible for leader status monitoring. > > > Diffs > ----- > > pom.xml df26edf74c04fffcd9fbc3da07e949362eb94728 > > sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/SentryConstants.java > c094058142706a6b564c54fa69ddff5f1e2e5048 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/HAContext.java > PRE-CREATION > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetrics.java > f80605c4d68ef266a24e65d14f51066388b48417 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/Activator.java > c3df4d8a6568f236dc5e05ab190cd1f484f7967a > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/Activators.java > 2926eeb97ec450f12d0d08086165c091709ead99 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/LeaderStatus.java > 2467921b3cdc9ebd267d308d5cdcce52a836f207 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/LeaderStatusAdaptor.java > e87b3d13dcf2d10eb7ef00d21b8fa8846b4d16c0 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/LeaderStatusMonitor.java > PRE-CREATION > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java > a9d49f86961f1ced1af40afcfe6172f884a23d44 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java > d80fa1e71c165b7f1faf1c50c451e049d76b770b > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestActivator.java > 60cfc735832433fb4dbeae1c2d617dd713fc3f3e > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/thrift/TestSentryServiceMetrics.java > bc375e32685dcbcbf0b6398856dceced3de789e6 > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestLeaderStatus.java > c796fabc21005479fa6afc687cf1df7af76538a9 > > Diff: https://reviews.apache.org/r/55190/diff/ > > > Testing > ------- > > Performed manual testing with two instances of Sentry running. Tried the > following actions: > > - Sending SIGUSR2 to processes which changes leadership status (verified via > log messages and emtrics) > - Killing active server - new sserver is elected as a leader > - Restarting ZK service - a leader is elected once ZK service is back. > > > Thanks, > > Alexander Kolbasov > >