Open JasonBarnabe opened 8 months ago
Hi Jason - I think frustratingly, this might be an issue with Sphinx itself. To be honest, I'm a little surprised - the whole point of rotating indexes should be how Sphinx steps around this (only switching from the old to the new when the new is ready - ideally with no gaps! And yet…)
I have checked locally, and I'm quite sure that when this error crops up Thinking Sphinx removes the current connection to Sphinx from the pool, and then retries again (up to three times) using fresh connections to Sphinx.
If you wanted to try something yourself, I would suggest adding some retry logic around your search calls - and perhaps, try adding ThinkingSphinx::Connection.pool.clear
before retrying. This should ensure Thinking Sphinx doesn't hold onto any existing connections.
Sphinx 3.3.1 thinking-sphinx 5.5.1 Ruby 3.2.2 Rails 7.0.8
Not sure if this is a sphinx thing or just a "that's just how it works" thing...
I have a cron job that periodically updates some data and then runs
rake ts:index
. Sometimes when this runs, the searches on my site receive a ThinkingSphinx::SphinxError exception: unknown local index 'index_name' in search request. This seems to only last a second or two and then everything's back to normal.Here's the log of my reindexing script:
searchd.log from this time:
Stack trace of a search request:
I would expect/hope that reindexing does not cause errors on things using the index.