diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java index 60981616027..5cb313f717a 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java +++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java @@ -1762,6 +1762,14 @@ public void publish( cd.getCloudDescriptor().setLastPublished(state); } DocCollection coll = zkStateReader.getCollection(collection); + // extra handling for PRS, we need to write the PRS entries from this node directly, + // as overseer does not and should not handle those entries + if (coll != null && coll.isPerReplicaState() && coreNodeName != null) { + PerReplicaStates perReplicaStates = + PerReplicaStatesOps.fetch(coll.getZNode(), zkClient, coll.getPerReplicaStates()); + PerReplicaStatesOps.flipState(coreNodeName, state, perReplicaStates) + .persist(coll.getZNode(), zkClient); + } if (forcePublish || updateStateDotJson(coll, coreNodeName)) { if (distributedClusterStateUpdater.isDistributedStateUpdate()) { distributedClusterStateUpdater.doSingleStateUpdate( @@ -1773,14 +1781,6 @@ public void publish( overseerJobQueue.offer(m); } } - // extra handling for PRS, we need to write the PRS entries from this node directly, - // as overseer does not and should not handle those entries - if (coll != null && coll.isPerReplicaState() && coreNodeName != null) { - PerReplicaStates perReplicaStates = - PerReplicaStatesOps.fetch(coll.getZNode(), zkClient, coll.getPerReplicaStates()); - PerReplicaStatesOps.flipState(coreNodeName, state, perReplicaStates) - .persist(coll.getZNode(), zkClient); - } } finally { MDCLoggingContext.clear(); }