Skip to content

Commit

Permalink
Fix issues with PRS
Browse files Browse the repository at this point in the history
  • Loading branch information
HoustonPutman committed Nov 11, 2024
1 parent 5371fb2 commit d883e02
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions solr/core/src/java/org/apache/solr/cloud/ZkController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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();
}
Expand Down

0 comments on commit d883e02

Please sign in to comment.