Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
9.0, 9.1
-
None
-
None
Description
Description
It is found that the existing `CreateCollectionCmd` would update the `state.json` per new replica. This potentially creates a lot of unnecessary writes as only the last state.json with all the replicas matters.
Take note that this actually is a problem for non PRS collection as well, but probably less problematic for non PRS as even if it does very similar operation per replica by sending the update to OS queue `ccc.offerStateUpdate(Utils.toJSON(props));`, at least OS would use the `ClusterStateUpdater` which uses `ZkStateWriter#enqueueUpdate` that likely batches up state.json update (only writes the latest entry every 2 secs by default) ; while for PRS, we use direct update which each call translates to an actual call to ZK.
Proposal
We will move the `ZkClient#setData` statement out of the replica loop and only call it once outside
Attachments
Issue Links
- duplicates
-
SOLR-16446 Remove redundant state.json update For PRS collection creation
- Open