Skip to content

Apache Lucene open-source search software

SOLR-4855: DistributedUpdateProcessor doesn't check for peer sync requests

Shalin Shekhar Mangarf9a5dc2c88f1
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 19f413cfc6a..1958b57cb68 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -116,6 +116,8 @@ Bug Fixes
* SOLR-4863: Removed non-existent attribute sourceId from dynamic JMX stats
to fix AttributeNotFoundException (suganuma, hossman via shalin)
+* SOLR-4855: DistributedUpdateProcessor doesn't check for peer sync requests (shalin)
+
Other Changes
----------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
index f940489cae7..bccc97eb134 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
@@ -312,7 +312,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
}
private void doDefensiveChecks(DistribPhase phase) {
- boolean isReplayOrPeersync = (updateCommand.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.REPLAY)) != 0;
+ boolean isReplayOrPeersync = (updateCommand.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.PEER_SYNC)) != 0;
if (isReplayOrPeersync) return;
String from = req.getParams().get("distrib.from");
@@ -559,7 +559,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
}
}
- boolean isReplayOrPeersync = (cmd.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.REPLAY)) != 0;
+ boolean isReplayOrPeersync = (cmd.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.PEER_SYNC)) != 0;
boolean leaderLogic = isLeader && !isReplayOrPeersync;
@@ -917,7 +917,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
}
versionOnUpdate = Math.abs(versionOnUpdate); // normalize to positive version
- boolean isReplayOrPeersync = (cmd.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.REPLAY)) != 0;
+ boolean isReplayOrPeersync = (cmd.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.PEER_SYNC)) != 0;
boolean leaderLogic = isLeader && !isReplayOrPeersync;
if (!leaderLogic && versionOnUpdate==0) {
@@ -1029,7 +1029,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
long signedVersionOnUpdate = versionOnUpdate;
versionOnUpdate = Math.abs(versionOnUpdate); // normalize to positive version
- boolean isReplayOrPeersync = (cmd.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.REPLAY)) != 0;
+ boolean isReplayOrPeersync = (cmd.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.PEER_SYNC)) != 0;
boolean leaderLogic = isLeader && !isReplayOrPeersync;
if (!leaderLogic && versionOnUpdate==0) {