Skip to content

Remove creation of new index when reindexing #1473

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

Merged
merged 1 commit into from
Nov 6, 2016

Conversation

di
Copy link
Member

@di di commented Oct 11, 2016

This PR removes the new_index.create() call from the reindexing command. I think the explicit call to create a new index is unnecessary, because elasticsearch will automatically create an index if it has not been created before.

Furthermore, it is causing problems when reindexing in production:

  • Prior to Optimize reindex #1471, this line was producing connection timeout errors nearly every time it was called;
  • Since Optimize reindex #1471, the call can return before timing out, which produces a index_already_exists_exception instead (but still occasionally times out).

The latter issue leads me to believe that this due to a race condition with the automatic index creation -- since our "temporary" index is given a randomly-generated name every time, I don't see any other way that the index could already exist.

I can't reproduce either exception in local development. However, I have verified that reindexing still creates a new index and runs as expected without this line.

@di
Copy link
Member Author

di commented Oct 31, 2016

@dstufft, are you able to take a look at this? As noticed in #1489, the search index is getting somewhat stale due to this issue.

@dstufft dstufft merged commit 5e6c7f8 into pypi:master Nov 6, 2016
@dstufft dstufft deleted the remove-create-index branch November 6, 2016 17:30
@di di mentioned this pull request May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants