If SolrCore creation fails, there should be an attempt to clean up any pre register changes to ZK.
Beef up autoAddReplica test to catch more issues related to SOLR-10279.
AutoAddReplicas should use previous state to populate shared data dirs if SolrCore is not available.
Unloading a core can remove a ZK SolrCore registration entry for the wrong SolrCore.
There is also a check that breaks this and the feature to have coreNodeName be used for taking over existing registrations. I'll remove it.
Commit bac3424936eacb2381138612ca70276ef5f909d5 in lucene-solr's branch refs/heads/master from markrmiller
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=bac3424 ]
SOLR-10279: The autoAddReplica feature can result in SolrCores being assigned new shards when using legacyCloud=false and will also fail on a state check when taking over a core registration with a new core.
Commit 5983f9e702a9dbd1ba9c5f383c8cc310d00fde91 in lucene-solr's branch refs/heads/branch_6x from markrmiller
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=5983f9e ]
Originally this was titled for SOLR-10279 legacyCloud=false, but there appear to be harder to hit in a test but similar issues with lagacyCloud=true.