Author: alexparvulescu Date: Tue Mar 3 10:37:22 2015 New Revision: 1663614
URL: http://svn.apache.org/r1663614 Log: OAK-2567 AsyncIndex should update the run status after the merge has completed Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java?rev=1663614&r1=1663613&r2=1663614&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java (original) +++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java Tue Mar 3 10:37:22 2015 @@ -371,12 +371,14 @@ public class AsyncIndexUpdate implements builder.child(ASYNC).setProperty(name, afterCheckpoint); builder.child(ASYNC).setProperty(PropertyStates.createProperty(lastIndexedTo, afterTime, Type.DATE)); + boolean updatePostRunStatus = true; if (callback.isDirty() || before == MISSING_NODE) { if (switchOnSync) { - reindexedDefinitions.addAll( - indexUpdate.getReindexedDefinitions()); + reindexedDefinitions.addAll(indexUpdate + .getReindexedDefinitions()); + updatePostRunStatus = false; } else { - postAsyncRunStatsStatus(indexStats); + updatePostRunStatus = true; } } else { if (switchOnSync) { @@ -396,9 +398,12 @@ public class AsyncIndexUpdate implements } reindexedDefinitions.clear(); } - postAsyncRunStatsStatus(indexStats); + updatePostRunStatus = true; } mergeWithConcurrencyCheck(builder, beforeCheckpoint, callback.lease); + if (updatePostRunStatus) { + postAsyncRunStatsStatus(indexStats); + } if (indexUpdate.isReindexingPerformed()) { log.info("Reindexing completed for indexes: {} in {}", indexUpdate.getAllReIndexedIndexes(), watch); }
