You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2011/12/02 03:41:48 UTC
svn commit: r1209334 -
/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Author: yonik
Date: Fri Dec 2 02:41:47 2011
New Revision: 1209334
URL: http://svn.apache.org/viewvc?rev=1209334&view=rev
Log:
make commits blockable too
Modified:
lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1209334&r1=1209333&r2=1209334&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java Fri Dec 2 02:41:47 2011
@@ -556,9 +556,22 @@ public class DistributedUpdateProcessor
@Override
public void processCommit(CommitUpdateCommand cmd) throws IOException {
- if (ulog.getState() != UpdateLog.State.ACTIVE && (cmd.getFlags() & UpdateCommand.REPLAY) == 0) {
- log.info("Ignoring commit while not ACTIVE");
- return;
+ if (vinfo != null) {
+ vinfo.lockForUpdate();
+ }
+ try {
+
+ if (ulog.getState() != UpdateLog.State.ACTIVE && (cmd.getFlags() & UpdateCommand.REPLAY) == 0) {
+ log.info("Ignoring commit while not ACTIVE");
+ return;
+ }
+
+ super.processCommit(cmd);
+
+ } finally {
+ if (vinfo != null) {
+ vinfo.unlockForUpdate();
+ }
}
@@ -566,7 +579,7 @@ public class DistributedUpdateProcessor
// if (shards != null) {
// cmdDistrib.distribCommit(cmd, shards);
// } else {
- super.processCommit(cmd);
+// super.processCommit(cmd);
// }
}