You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org> on 2026/08/19 17:44:46 UTC

[PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode, un-deprecate createFromCollectionMap [solr]

serhiy-bzhezytskyy opened a new pull request, #4768:
URL: https://github.com/apache/solr/pull/4768

   Removes `ClusterState.getReplicaNamesPerCollectionOnNode` (0 callers left after migrating `ZkController`/`ZkControllerTest` to `collectionStream()` + `getReplicasOnNode`), and un-deprecates `createFromCollectionMap` instead of removing it as the title suggests -- it's still called from `createFromJson` (deprecated, tracked separately in the still-open SOLR-18149) plus two production call sites.
   
   14 tests, 0 failures.
   
   SOLR-18370 (local, not yet a PR) also touches ZkController.java, different region -- re-check once it opens a PR.
   
   AI-assisted (Claude Sonnet 5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode, un-deprecate createFromCollectionMap [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4768:
URL: https://github.com/apache/solr/pull/4768#issuecomment-5368798739

   I don't have permissions to add labels as an outside contributor -- could you add `no-changelog` if that's the route you'd prefer? Same applies to #4761.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode, un-deprecate createFromCollectionMap [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #4768:
URL: https://github.com/apache/solr/pull/4768#issuecomment-5368588477

   also, for purely internal type changes with no change log, you can just add the label `no-changelog` ;-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on code in PR #4768:
URL: https://github.com/apache/solr/pull/4768#discussion_r3860051804


##########
solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java:
##########


Review Comment:
   Already resolved -- `main` picked this up via #4760 (unrelated SOLR-18382 cleanup), and I just merged `main` into this branch. Current code is exactly what you described: no Map, just `clusterState.getCollection(collectionName).getReplicasOnNode(nodeName)`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode, un-deprecate createFromCollectionMap [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4768:
URL: https://github.com/apache/solr/pull/4768#issuecomment-5368902129

   Opened #4777 -- un-deprecates `createFromJson` instead of waiting on a removal, so no ordering dependency between the two anymore.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode, un-deprecate createFromCollectionMap [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #4768:
URL: https://github.com/apache/solr/pull/4768#issuecomment-5368585366

   I wonder if we wait till  the fix for [SOLR-18149](https://issues.apache.org/jira/browse/SOLR-18149) lands before merging this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4768:
URL: https://github.com/apache/solr/pull/4768#issuecomment-5546453650

   @epugh the SOLR-18149 ordering concern is gone -- #4777 merged and this is rebased on it, and @dsmiley approved after that. Anything left on my side?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on code in PR #4768:
URL: https://github.com/apache/solr/pull/4768#discussion_r3854511807


##########
solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java:
##########
@@ -225,7 +208,7 @@ public static ClusterState createFromJson(
     return createFromCollectionMap(version, stateMap, liveNodes, creationTime, prsSupplier);
   }
 
-  @Deprecated
+  /** Still used by {@link #createFromJson}. */

Review Comment:
   Checked — it has its own independent callers (`BackupManager`, `DistributedClusterStateUpdater`, `ZkStateReader` in production, plus 4 test files), unrelated to `createFromJson`. Can't remove it; `createFromJson` was just a thin wrapper over it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode, un-deprecate createFromCollectionMap [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #4768:
URL: https://github.com/apache/solr/pull/4768#issuecomment-5368842459

   > I don't have permissions to add labels as an outside contributor -- could you add `no-changelog` if that's the route you'd prefer? Same applies to #4761.
   
   argh, that's annonying.   also, feel free to just slap in a comment to that effect and I can do the bookeeping.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh merged PR #4768:
URL: https://github.com/apache/solr/pull/4768


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode, un-deprecate createFromCollectionMap [solr]

Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on code in PR #4768:
URL: https://github.com/apache/solr/pull/4768#discussion_r3848013744


##########
solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java:
##########


Review Comment:
   looking at this, it's apparent the logic should be simplified to only get the list of replicas on this node for the collection the test cares about.  No need for a Map; only a List.  Could build in a single Stream.



##########
solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java:
##########
@@ -225,7 +208,7 @@ public static ClusterState createFromJson(
     return createFromCollectionMap(version, stateMap, liveNodes, creationTime, prsSupplier);
   }
 
-  @Deprecated
+  /** Still used by {@link #createFromJson}. */

Review Comment:
   createFromJson has been removed.  We can remove this one.  Ideally should have folded both together into the same change to tackle ClusterState API IMO.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18381: remove ClusterState.getReplicaNamesPerCollectionOnNode, un-deprecate createFromCollectionMap [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4768:
URL: https://github.com/apache/solr/pull/4768#issuecomment-5406887141

   Both addressed. Rebased on main (`createFromJson` is gone there per SOLR-18149/#4777, so dropped the now-dead method + the stale "Still used by createFromJson" comment). `ZkControllerTest` now does `clusterState.getCollection(collectionName).getReplicasOnNode(nodeName)` directly instead of building a `Map` over every collection -- ran `testPublishAndWaitForDownStates` locally, still passes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org