-
-
Notifications
You must be signed in to change notification settings - Fork 964
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
Docs: search returns no results after there are recent doc changes (but comes back later) #1693
Comments
Here is how the |
Are there logs on how long this takes to run? |
There are logs, let me see if I can get some numbers from them. As far as I know, the CRON entry I posted above is the only way the docs get built. There's no push, it's all pull, and it happens every hour at 15 past (not every 15min). |
@pauloxnet Does the above ring any bell for you? |
Here is the log I have for today: https://gist.github.com/bmispelon/b2a714f02daa300fa1e2dfef78ad7ebd (there's a lot of noise that seems to be caused by incomplete translated docs). Note that this was before #1692 was deployed. |
I was searching around the 15 minutes past mark and for a few minutes after - and that was fine |
Actually I think this line is suspicious
We seem to update everything anyway so I'm not sure why we need to first null out the search index |
The command run from As I just ran it again now on my laptop to check the timing: $ time python -m manage update_docs --settings=djangoproject.settings.prod --verbosity=2 --update-index --force
...
Indexed 1529 documents in 2.7s.
real 3m56,187s
user 17m51,930s
sys 0m40,349s Re-indexing takes less than 3 seconds, but I only have 3 release in 3 languages locally, and I imagine my laptop has more processing power and memory than the server, To understand the cause of the recurring problems with search on the site, we should understand what happens on the server when it regenerates the documentation for all versions of Django and with the various languages supported. |
If you see some line before, there's a
Since indexing happens in a transaction, search queries continue to work correctly, while the command deletes and recreates all the vectors on which they are performed. As I wrote in the comment above it takes less than 3 seconds on my laptop, so I've simulated a longer run locally, putting a |
I wonder if the GinIndex needs tuning 🤔 |
What makes you think this? Have you read the GIN index update timeframe? I would be interested in having these timeframes so I can give you my opinion. If not, before making changes and seeing what happens, I would try to read the database timeframes. In the meantime I added the time spent by PG updating the search vectors in the logs in #1695
I've never looked into the cache part. I think it might be worth looking into to see how it behaves and what the update times are, but someone with permissions to the service should try to read this information. |
I was reading this article on GIN Indexes this morning. I'm just trying to give ideas of things we can look into 🙂 |
Can you share the log now that we have merged #1692 and #1695 ? Can you export from the server and add in the code and additional fixtures file with all releases and languages, in addition to doc_releases.json? It will be very useful to emulate locally what happens on the server when the Cron runs? |
I just noticed that search was not working this morning for me on 5.1 and dev. I observed this at ~10am and the I first tried to just purge the cache with Then I tried rebuilding the index with |
Here is the log for 2024-10-27 as well as a |
I can't find any occurrence of "Indexed" in the log file, it seems that the
In order to try locally to execute the same flow of update docs and index, I need also the fixtures for all "docs.documentrelease". |
Do you think that the search started working again thanks to the execution of the If so, two considerations come to mind:
|
Sorry, I didn't think about the docs_documentreleases_20241027.json.gz I think the reason you don't see |
(just pushed a docs change 👍) |
See: https://forum.djangoproject.com/t/docs-seem-to-go-missing-for-a-given-version-when-there-are-docs-changes/35861
We get periodic reports about the docs search stopping working:
The text was updated successfully, but these errors were encountered: