-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running solr_wrapper a 2nd time with "persist" option set does not find the existing core #92
Comments
This is the same as #69 |
But #69 doesn't refer to the |
It appears to me that this is a timing related issue. I can in no way reliably trigger or eliminate the error using the gem as released. On a low-resource VM, the issue seems to be more prevalent, i.e. I get the "Core ... already exists" error multiple successive times before the solr starts as expected. See example runs where I did nothing but try launching the wrapper again in this gist https://gist.github.com/mark-dce/0a6bb38adde0d5b7645ed58778158575 If I add a status check at the beginning of the create method something like
the solr service appears to start completely reliably - see this gist of behavior after the change https://gist.github.com/mark-dce/7aaede62802adea79ab826a48af23ad8 |
As I buried at the end of a massive comment on the very-related #69, if this gem does undergo future development it might be best to find a better core existence check. This page has a couple of newer answers that indicate the accepted solution (as used in this gem) is not reliable and/or has been superseded in newer versions of Solr. But perhaps it will just wane as more and more people develop in containers instead. I still use and appreciate it though! :) |
Versions used:
solr_wrapper 0.12.0
solr_wrapper
)Expected Result:
I should be able to:
solr_wrapper
for a 1st time, with a configuration that has thepersist
flag set totrue
.solr_wrapper
solr_wrapper
a 2nd time, with the same config, and not get an error.Actual Results:
Running
solr_wrapper
a 2nd time, with the same config, gives an error (see below).To Replicate:
create a config file named
.solr_wrapper.yml
containing the following:Run
solr_wrapper
for the first time (without the core having been created yet) with the specified config, like this...At this point, Solr starts.
Stop Solr using Ctrl+C
Run
solr_wrapper
again, with the same command and config file...At this point, I get the following error...
Background:
SolrWrapper::Client#core?
is returning false when checking for the core namedmy-core
.solr_wrapper
) in/tmp/solr-6.4.1/server/solr/my-core
, and after getting the error, I can still see the directory corresponding tomy-core
on the filesystem.SolrWrapper::Client#core?
looks like this:admin/cores?action=STATUS&wt=json&core=my-core'
SolrWrapper::Client#core?
is actually behaving correctly and returning false, given the response from Solr. However, Solr itself is not finding the core that it created previously.SolrWrapper::Client#exists?
to returnfalse
, which in turn causes this conditional to also returnfalse
, which in turn runs the lineexec('create', create_options)
.exec('create', create_options)
where Solr is somehow able to find the core it couldn't find before, and throws the error for trying to create a core that already exists.The text was updated successfully, but these errors were encountered: