-
Notifications
You must be signed in to change notification settings - Fork 499
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
IQSS/10697 - Improve batch permission indexing #10698
Merged
stevenwinship
merged 15 commits into
IQSS:develop
from
QualitativeDataRepository:QDR-improve-batch-permission-indexing
Oct 16, 2024
Merged
IQSS/10697 - Improve batch permission indexing #10698
stevenwinship
merged 15 commits into
IQSS:develop
from
QualitativeDataRepository:QDR-improve-batch-permission-indexing
Oct 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Avoids keeping everything in memory, also helps in tracking progress as you can see the permissionindextime getting updated per dataset.
…rmission-indexing
…rmission-indexing
pdurbin
approved these changes
Oct 2, 2024
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.
I made some cosmetic tweaks. I didn't run the code but it seems fine. Approved.
…rmission-indexing
…b.com/QualitativeDataRepository/dataverse.git into QDR-improve-batch-permission-indexing
Tested heavily on Perf cluster. No CPU or Memory issues detected. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Consider For Next Release
A simple change (eg bug fix) that would be good to prioritize since it has been seen in the wild
FY25 Sprint 7
FY25 Sprint 7 (2024-09-25 - 2024-10-09)
FY25 Sprint 8
FY25 Sprint 8 (2024-10-09 - 2024-10-23)
Size: 3
A percentage of a sprint. 2.1 hours.
Type: Feature
a feature request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it: This PR adds checks within the loops over all children of a definition point and all files of those children and now calls the code to actually process files to create the permissions docs for them and then to submit those documents to solr, thus allowing the memory used to cache them to be released.
Which issue(s) this PR closes:
Special notes for your reviewer:
Changes are clearer if you look at https://github.com/IQSS/dataverse/pull/10698/files?w=1.
I have somewhat arbitrarily chosen to trigger creating documents every 100 files and to then send those docs to solr every 20 docs. Those could be configurable or just optimized with some testing, but the key thing is that, prior to this PR, a change to permissions on the root DV loads all files and all docs into memory, so any cap to avoid doing that should be OK. Choosing too small number is hopefully not a big issue any more as we are relying on auto soft/hard commits, so if we make updates more often than 1 sec/30 seconds, solr is just going to cache the submissions on its side.
Note that one of the problems we detected at QDR was that after a permission change and subsequent out-of-memory failure of our test server, when we restarted, we had out-of-date permissions documents. Those are not orphans so they aren't detected by the /api/admin/index/status call, they just result in odd behavior such as a search showing a closed lock on a restricted file when, if you go the page, you can actually download, etc.
This PR doesn't change the fact that all file permission docs have to be updated, which still take a long time (minutes/hours) on a big installation. It does appear to stop the memory use from climbing though.
If someone had a memory failure due to this, they could/should reindex permissions to fix it. From what I can see, there is an api call for that: /admin/index/perms, but as far as I can tell, this is undocumented. Not sure why (other than it is slow - and it does everything in one batch and writes permissionindextimes to files as well). Doing an in place reindex of everything would also work, so this is what I've put in the release note for now.
Suggestions on how to test this:
Create a db with a significant number of files in one or more datasets (thousands?), change the permissions on the root collection, e.g. adding or removing a person from the curator role. Watch the memory use during processing (top?) and verify that it doesn't keep increasing until the permission updates finish (%cpu should drop and there's a message in the log).
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: