[
https://issues.apache.org/jira/browse/SOLR-4790?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Erick Erickson updated SOLR-4790:
---------------------------------
Attachment: SOLR-4790.patch
Updated version, all tests pass. I took a quick look at what happens if you
define two cores with the same name old-style, and errors are thrown in
addition to the warning issued. So leaving it as-is seems fine.
But, while looking at that code I think it throws a bogus warning, it just
tests for the dataDir defined in the <core> tag. So defining two cores with
dataDir=./data would issue the warning even though they were in different
instance dirs.
Two questions:
1> is
String absData = new File(instDir, dataDir).getCanonicalPath();
a reliable way to get the full path? If so, the test in this patch will work in
old-style. It worked on a single test anyway.
2> One could test for duplicate dirs in new-style as well. Is it worth it? Two
variants come to mind:
2a> Pass a map a-la coreDescriptorMap and do simliar stuff.
2b> in SolrCoreDiscoverer.discover, just analyze the map upon return and issue
a warning.
Either way it would just be some bookeeping local to SolrCoreDiscoverer and not
intrusive. But is either one worth the effort?
[~markrmiller] [~andyfowler] any opinions?
> When defining a core with the same name (discovery mode or not),
> CoreContainer should throw an error
> ----------------------------------------------------------------------------------------------------
>
> Key: SOLR-4790
> URL: https://issues.apache.org/jira/browse/SOLR-4790
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 4.3, 5.0
> Reporter: Erick Erickson
> Assignee: Erick Erickson
> Attachments: SOLR-4790.patch, SOLR-4790.patch
>
>
> When you define a core with the same name as another core (discovery mode
> definitely, old-style xml probably), last one wins. Which means it's very
> hard to track down what caused the problem.
> What's worse, the last-encountered core replaces the first one, leading to
> cores that change an unexpected index.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]