Skip to content

Commit b9be573

Browse files
committed
SOLR-17877: fix: don't eagerly fetch DistributedCollectionCommandContext
And we don't need to create yet another instance either; there's already one in ZkController. DistributedClusterStateUpdater is stateless.
1 parent 1af4c11 commit b9be573

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

solr/core/src/java/org/apache/solr/cloud/api/collections/DistributedCollectionCommandContext.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,12 @@
2727

2828
public class DistributedCollectionCommandContext implements CollectionCommandContext {
2929
private final CoreContainer coreContainer;
30-
private final DistributedClusterStateUpdater distributedClusterStateUpdater;
3130
private final ExecutorService executorService;
3231

3332
public DistributedCollectionCommandContext(
3433
CoreContainer coreContainer, ExecutorService executorService) {
3534
// note: coreContainer.getZkController() is not yet instantiated; don't call it right now
3635
this.coreContainer = coreContainer;
37-
this.distributedClusterStateUpdater =
38-
new DistributedClusterStateUpdater(
39-
coreContainer.getConfig().getCloudConfig().getDistributedClusterStateUpdates());
4036
this.executorService = executorService;
4137
}
4238

@@ -69,7 +65,7 @@ public ZkStateReader getZkStateReader() {
6965

7066
@Override
7167
public DistributedClusterStateUpdater getDistributedClusterStateUpdater() {
72-
return this.distributedClusterStateUpdater;
68+
return this.coreContainer.getZkController().getDistributedClusterStateUpdater();
7369
}
7470

7571
@Override

0 commit comments

Comments
 (0)