patsonluk commented on code in PR #2438: URL: https://github.com/apache/solr/pull/2438#discussion_r1628197733
########## solr/core/src/java/org/apache/solr/core/ConfigSetService.java: ########## @@ -391,6 +402,21 @@ protected NamedList<Object> loadConfigSetFlags(SolrResourceLoader loader) throws */ protected abstract SolrResourceLoader createCoreResourceLoader(CoreDescriptor cd); + /** + * Create a SolrResourceLoader for a core with the provided configSetName. + * + * <p>By default, this will just call {@link + * ConfigSetService#createConfigSetService(CoreContainer)}. Child implementation might override + * this to make use of the configSetName directly + * + * @param cd the core's CoreDescriptor + * @param configSetName an optional config set name + * @return a SolrResourceLoader + */ + protected SolrResourceLoader createCoreResourceLoader(CoreDescriptor cd, String configSetName) { Review Comment: > We should remove "1. Auto create collection in ZK if it's not already here"; this refers to legacy behavior. Or gate this with "bootstrap_conf" system property being specified or something like that. Heck, I wonder if this chunk of code actually works.... like if you did a little experiment locally, could you get the collection to appear merely by having a core descriptor for a non-existent collection? I wonder if it's even tested (easy to check by trial and error). That's a good point! I tried locally with this: 1. Copy an existing single shard/replica directory from data folder and rename it with a different collection name, patched the `core.properties` as well 2. Start and debug the code flow 3. The `CoreDescriptor` did get loaded properly after scanning the disk 4. But on `createFromDescriptor` -> `preRegister` -> `checkStateInZk` -> `zkStateReader.waitForState`, it failed cause such collection is not in ZK 5. It does not really reach the `coreConfigService.loadConfigSet` and it's after `preRegister` So i'm pretty sure we can remove that auto creation collection 😊 As for the 2. Set the configset read from ZK (off the collection from cluster state) to CD. Ignore the pre-existing on in CD, Based on the commit [history](https://github.com/cowpaths/fullstory-solr/commit/f1db918e2072e35295cd53376822b83f7e438927), it is part of the effort to "restore legacy Collection auto-creation", which can be removed altogether since it does not work anymore anyway? 😅 Thank you for all the pointers again! -- 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-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org