Skip to content

fix: index files of more than 2 GiB - #1228

Open
jma wants to merge 1 commit into
rero:stagingfrom
jma:fix/files-size-mapping
Open

jma wants to merge 1 commit into
rero:stagingfrom
jma:fix/files-size-mapping

Conversation

@jma

@jma jma commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

_files.size was mapped as integer: a file of more than 2 GiB made the indexing of its record fail.

  • Maps it as long in the documents, deposits, organisations and collections.

⚠️ These indices must be recreated and reindexed for the mapping to apply.

* Map the size of the files as long: as an integer, a file of more
  than 2 GiB made the indexing of its record fail.

:warning: The indices of the documents, deposits, organisations and
collections must be recreated and reindexed for the mapping to apply.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
@jma
jma marked this pull request as ready for review November 30, 2026 10:56
@jma
jma requested review from PascalRepond and rerowep November 30, 2026 10:56
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The _files.size mapping changes from integer to long for collections, deposits, documents, and organisations. A document test commits and reindexes a document with a 3 GiB file, then checks that a size query returns one matching record.

Estimated code review effort: 2 (Simple) | ~8 minutes

Merge Risk: Minimal · up to bc388

The change lets records with files larger than 2 GiB index correctly. Existing indices must be recreated and reindexed for it to take effect, as the PR notes. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the fix makes indexing work for files larger than 2 GiB. The changeset changes the _files.size mapping from integer to long in the documents, deposits, organisations a…
Description check Passed The description states the problem: _files.size was mapped as integer, so indexing a record with a file over 2 GiB failed. It lists the fix, which maps the field as long in the four modules. It also w…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the fix makes indexing work for files larger than 2 GiB. The changeset changes the _files.size mapping from integer to long in the documents, deposits, organisations and collections indices, and adds a large-file test. The title is concise and specific.

Full details: Description check

Explanation

The description states the problem: _files.size was mapped as integer, so indexing a record with a file over 2 GiB failed. It lists the fix, which maps the field as long in the four modules. It also warns that the indices must be recreated and reindexed. This matches the changeset.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 620bbf29-58ce-403b-bb1f-c688df2e2131
Commits

Reviewing files that changed from the base of the PR and between 708251e and bc388e3.

Files selected for processing: 5

  • sonar/modules/collections/mappings/os-v2/collections/collection-v1.0.0.json
  • sonar/modules/deposits/mappings/os-v2/deposits/deposit-v1.0.0.json
  • sonar/modules/documents/mappings/os-v2/documents/document-v1.0.0.json
  • sonar/modules/organisations/mappings/os-v2/organisations/organisation-v1.0.0.json
  • tests/ui/documents/test_documents_api.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants