-
Notifications
You must be signed in to change notification settings - Fork 173
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
trigger re-index and optimize query by social field #1744
Conversation
Signed-off-by: call-me-matt <nextcloud@matthiasheinisch.de>
This is a follow-up of nextcloud/server#22085 |
Codecov Report
@@ Coverage Diff @@
## master #1744 +/- ##
============================================
- Coverage 40.05% 37.93% -2.12%
- Complexity 128 133 +5
============================================
Files 17 18 +1
Lines 377 398 +21
============================================
Hits 151 151
- Misses 226 247 +21
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
It's a repair step, exactly what it should be, but it's not registered in info.xml |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BuildSocialSearchIndex
should not be part of the Contacts app, but in dav
in the server.
Apps should not use classes from other apps or access their database tables.
Futhermore, the actual indexing shouldn't be done in the migration step, but the migration step should only register a background job that will re-index them in smaller chunks. There are Nextcloud instances storing millions and millions of contacts, a simple repair-step would timeout here or block the update for hours.
See https://github.com/nextcloud/server/blob/master/apps/dav/lib/Migration/BuildCalendarSearchIndex.php
It's only fetching the biggest id from the database and registering a re-index job, which later reindexes all events with an id lower than the one from the repair step.
Also see https://github.com/nextcloud/server/blob/master/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php#L79L87 and https://github.com/nextcloud/server/blob/master/apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php#L116L118.
The background-job does not re-index everything at once, but only 15 seconds per background-job and continues where it left of previously.
Thank you for your feedback, I will move the code to the server then (and pack it into background-chunks) |
trigger re-index of contacts to optimize query in background updates