> On May 13, 2014, 12:44 a.m., Robert Kanter wrote: > > core/src/main/java/org/apache/oozie/sla/SLACalculatorMemory.java, line 374 > > <https://reviews.apache.org/r/17720/diff/8/?file=575969#file575969line374> > > > > what happens if multipleServerRunning() gets called by server A when > > it's the only server, so it returns false; but then server B comes up > > immediately after? Will this race condition be a problem?
good point, I thought about it, race condition is less likely happen since time window for contention is very short. Suppose server A starts updateJobSla for particular job id, soon after, server B comes up and registered to ZK. but then server B start SLAService which call loadOnRestart where loading summary beans from DB first, process one by one, then finally trying to update DB (Summary bean) for each job id. until that time, server A should have done with updateJobSla() for one job. (then after server B registered to ZK, both server start to respect lock) > On May 13, 2014, 12:44 a.m., Robert Kanter wrote: > > core/src/main/java/org/apache/oozie/sla/SLACalculatorMemory.java, line 482 > > <https://reviews.apache.org/r/17720/diff/8/?file=575969#file575969line482> > > > > Instead of doing "instanceof", you can put "multipleServerRunning()" in > > JobsConcurrencyService which simply always returns "false". > > ZKJobsConcurrencyService would override that method (don't forget the > > "@Override") to actually check with ZooKeeper. fixed this part. thanks - Ryota ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/17720/#review42795 ----------------------------------------------------------- On May 7, 2014, 4:46 a.m., Ryota Egashira wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/17720/ > ----------------------------------------------------------- > > (Updated May 7, 2014, 4:46 a.m.) > > > Review request for oozie. > > > Bugs: OOZIE-1678 > https://issues.apache.org/jira/browse/OOZIE-1678 > > > Repository: oozie-git > > > Description > ------- > > https://issues.apache.org/jira/browse/OOZIE-1678 > > > Diffs > ----- > > core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java > fb31e9a > > core/src/main/java/org/apache/oozie/executor/jpa/SLARegistrationQueryExecutor.java > e3b115f > > core/src/main/java/org/apache/oozie/executor/jpa/SLASummaryQueryExecutor.java > 79d11ed > > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetJPAExecutor.java > 1f7cb4d > core/src/main/java/org/apache/oozie/service/JPAService.java aba8709 > core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java > 611b74c > core/src/main/java/org/apache/oozie/sla/SLACalcStatus.java ea53712 > core/src/main/java/org/apache/oozie/sla/SLACalculatorMemory.java 618d899 > core/src/main/java/org/apache/oozie/sla/SLARegistrationBean.java a2260a4 > core/src/main/java/org/apache/oozie/sla/SLASummaryBean.java 0a70326 > core/src/main/java/org/apache/oozie/sla/service/SLAService.java ea2983f > > core/src/test/java/org/apache/oozie/command/coord/TestCoordChangeXCommand.java > 327ec90 > > core/src/test/java/org/apache/oozie/executor/jpa/TestSLARegistrationQueryExecutor.java > 00fb677 > > core/src/test/java/org/apache/oozie/executor/jpa/TestSLASummaryQueryExecutor.java > 2e170a4 > core/src/test/java/org/apache/oozie/service/TestHASLAService.java > PRE-CREATION > core/src/test/java/org/apache/oozie/sla/TestSLACalculationJPAExecutor.java > 9270aa2 > core/src/test/java/org/apache/oozie/sla/TestSLACalculatorMemory.java > 9a16722 > core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java f3bfc29 > core/src/test/java/org/apache/oozie/sla/TestSLAJobEventListener.java > 3ce86ab > core/src/test/java/org/apache/oozie/sla/TestSLAService.java 291d850 > > core/src/test/java/org/apache/oozie/sla/TestSLASummaryGetOnRestartJPAExecutor.java > 3a9e72e > core/src/test/java/org/apache/oozie/test/ZKXTestCase.java 7bebaf0 > core/src/test/resources/coord-action-sla.xml e88df6c > > Diff: https://reviews.apache.org/r/17720/diff/ > > > Testing > ------- > > > Thanks, > > Ryota Egashira > >
