On 5/13/2013 11:46 AM, Jie Sun wrote:
did any one verified the following is ture?
the Description on http://wiki.apache.org/solr/CoreAdmin#CREATE is:

*quote*
If a core with the same name exists, while the "new" created core is
initalizing, the "old" one will continue to accept requests. Once it
has finished, all new request will go to the "new" core, and the "old"
core will be unloaded.
*/quote*

step1 - I have a core 'abc' with 30 documents in it:
http://myhost.com:8080/solr/abc/select/?q=type%3Amessage&version=2.2&start=0&rows=10&indent=on

<str name="rows">10</str></lst></lst><result name="response" numFound="30"
start="0"><doc>

step2 - then I create a new core with same name 'abc':
http://myhost.com:8080/solr/admin/cores?action=create&name=abc&instanceDir=./

<response><lst name="responseHeader"><int name="status">0</int><int
name="QTime">303</int></lst><str name="core">abc</str><str
name="saved">/mxl/var/solr/solr.xml</str></response>

step3 - I cleared out my browser cache

step4 - I did same query as in step1, got same results (30 documents):
http://myhost.com:8080/solr/abc/select/?q=type%3Amessage&version=2.2&start=0&rows=10&indent=on

<str name="rows">10</str></lst></lst><result name="response" numFound="30"
start="0"><doc>

I thought the old core should be unloaded?
did I misunderstand any thing here?

If the instanceDir value that you are using is different than the existing core, then this might be a bug, either in the documentation or Solr. If the instanceDir is the same as the existing core, then it's working as designed -- you've created a core with an index that already exists.

I personally would like to see core creation fail if the core already exists, but others with more authority may disagree.

A workaround would be to CREATE a new core with a different name and instanceDir, SWAP them, and then UNLOAD the one you don't need any more, optionally deleting it.

Thanks,
Shawn

Reply via email to