-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Rebuild-indexes cmd #7753
Rebuild-indexes cmd #7753
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7753 +/- ##
==========================================
- Coverage 41.79% 41.71% -0.08%
==========================================
Files 497 500 +3
Lines 65639 65801 +162
==========================================
+ Hits 27433 27450 +17
- Misses 34689 34835 +146
+ Partials 3517 3516 -1
Continue to review full report at Codecov.
|
I've implemented the issues index rebuild that was previously missing. The PR is now complete (not WIP) except requests by the managers, of course. |
Edit: Nevermind, it seems to work, I was missing my |
So, some feedback: I get a lot of this while running against a pretty much idle server:
Not sure exactly why's that but on a server hosting like 15 repos, it ran like 10 minutes til completion with a lot of those "too busy" in between which seems quite long. Maybe drop the per-repo thing and delete the index files and force-reinitialize bleve? If possible, it should only take a few seconds. The fact that his has to run while gitea is running on another thread seems non-intuitive to me. In fact I was caught off guard above when I forgot to set Edit: Also, what's interesting is that when I run the rebuild command a second time, it now completes almost instantly, not sure why that is. |
@silverwind Please see my response to Lunny about this option being more future proof. Perhaps it took different times because the indexes got in fact different content, like with/without the camel case tokenizer? Also, it may seem overkill to do it per repo if you have 15 very big ones, If you have 500 small ones may make more sense. Anyway, based on you guys' feedback, I think I'll change the strategy:
If you guy agree, I'll drop this PR and start another. |
If it cannot be done at runtime, I guess there's not much sense to have the command in first place, may as well instruct users to stop gitea, manually delete index files and start it back up. Thought my preference would generally be to bump the index version on every change that affects indexing, that way, users will probably never have to manually touch index files. |
@silverwind I re-engineered the logic to support both offline and online rebuilds. It also uses the version metadata to force the rebuild, so it's much faster (although I've dropped the per-repository rebuild). I think this version makes more sense an it's more robust. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
can you resolve conflicts pleace :) |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
ping @Stale |
I'm closing this, I don't think it's the correct way of handling it anymore. We could add the drop indexes offline to the doctor some other time. A command line utility for rebuilding the indexes online doesn't make much sense since the |
This PR adds the following command:
Old, outdated description
So, this is the direction I'm taking to implement the rebuild-indexes cmd mentioned in #7733:Only the--repositories
option is currently implemented. It's a little bit convoluted because the indexes are normally updated in background on the web server. I didn't want to cause any kind of concurrency problem, so I've decided for a private api route.I figured a per-repository request would make sense for very big installations, as the requests will go very quickly for the firstsetting.Indexer.UpdateQueueLength
(20) repos. After that it will have to wait in the queue to advance. All in all, there's a risk for the requests to timeout. I'd like your input on how to handle that.Please feel free to criticize. If you guys like where I'm going, I'll implement the--issues
option.