Skip to content
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

Issue predb status cleanup #9242

Conversation

MarieVerdonck
Copy link
Contributor

References

Description

The script to update solr docs with predb state (from eg Import script) only processed the first 10 docs with database_status:predb (default solr page size)

Instructions for Reviewers

  • Add more than 10 new items

  • Check in solr they have database_status:predb

  • Run item-database-status script with config item-database-status.time-until-reindex set to 0 for example (so all solr records indexed before script run time) are updated

  • Verify all the docs for the new items no longer have predb status

  • For automated test: Run updated SolrDatabaseResyncIT before fix & verify script fails to clear status field for more than 10 docs

Checklist

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & integration tests). Exceptions may be made if previously agreed upon.
  • My PR passes Checkstyle validation based on the Code Style Guide.
  • My PR includes Javadoc for all new (or modified) public methods and classes. It also includes Javadoc for large or complex private methods.
  • My PR passes all tests and includes new/updated Unit or Integration Tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in any pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR modifies REST API endpoints, I've opened a separate REST Contract PR related to this change.
  • If my PR includes new configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

…efault size) - Fix:

- Query with 0 rows to get total number of records to process
- Process them in batches of 100
@tdonohue tdonohue added bug backend: Solr Related to the Solr index 1 APPROVAL pull request only requires a single approval to merge. port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Jan 8, 2024
@Atmire-github Atmire-github force-pushed the w2p-90830-104654_issue-8125_pr-8267_Issue-stale-record-cleanup branch from 91f53c2 to 34bd5f1 Compare January 18, 2024 18:35
@Atmire-github Atmire-github force-pushed the w2p-90830-104654_issue-8125_pr-8267_Issue-stale-record-cleanup branch from 34bd5f1 to e1cfb74 Compare January 18, 2024 18:36
@alanorth alanorth removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Mar 7, 2024
@tdonohue tdonohue self-requested a review March 28, 2024 15:48
@tdonohue tdonohue added this to the 8.0 milestone Apr 10, 2024
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks @MarieVerdonck ! Code looks good. I was able to verify this works locally by bulk importing 20 items and checking Solr to ensure that they all had database_status:predb: http://localhost:8983/solr/#/search/query?q=database_status:predb&q.op=OR&indent=true

Then, I set solr-database-resync.time-until-reindex = 0 and ran the solr-database-resync script from the Processes UI.

After doing so, all 20 items were reindexed & have the database_status:predb flag removed.

@tdonohue tdonohue merged commit 95405d0 into DSpace:main Apr 10, 2024
22 checks passed
@tdonohue
Copy link
Member

Ported to dspace-7_x via #9269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge. backend: Solr Related to the Solr index bug
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants