Skip to content

Text index hardening - #8920

Merged
agourlay merged 1 commit into
devfrom
text-index-hardening
May 6, 2026
Merged

agourlay merged 1 commit into
devfrom
text-index-hardening

Conversation

@agourlay

@agourlay agourlay commented May 6, 2026

Copy link
Copy Markdown
Member

Hardening pass for ImmutableFullTextIndex and ImmutableInvertedIndex.

  • Safe saturating_sub for points_count decrement in ImmutableInvertedIndex::remove.
  • Document cached_ram_usage_bytes snapshot semantics.
  • Use the prelude size_of.

@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 028c31d2-65ce-4ead-962b-6be9e41ea2a9

📥 Commits

Reviewing files that changed from the base of the PR and between 665b91d and 1e2f154.

📒 Files selected for processing (2)
  • lib/segment/src/index/field_index/full_text_index/immutable_text_index.rs
  • lib/segment/src/index/field_index/full_text_index/inverted_index/immutable_inverted_index.rs

📝 Walkthrough

Walkthrough

This pull request adds documentation to ImmutableFullTextIndex and refactors memory accounting logic in ImmutableInvertedIndex. The first file receives new doc comments clarifying that RAM usage is captured at construction time and not refreshed during point deletions, and explaining deletion behavior across in-memory and storage layers. The second file introduces safer underflow prevention using saturating_sub for point count updates and restructures RAM usage calculations with explicit intermediate variables for improved clarity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

release:1.18.0

Suggested reviewers

  • generall
  • coszio
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Text index hardening' accurately and concisely reflects the main change: hardening the text index modules with safer operations, documentation, and improved memory accounting.
Description check ✅ Passed The description is directly related to the changeset, detailing the specific hardening improvements made to the text index modules.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch text-index-hardening

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@agourlay
agourlay requested a review from timvisee May 6, 2026 08:36
@agourlay
agourlay merged commit 8c354ac into dev May 6, 2026
15 checks passed
@agourlay
agourlay deleted the text-index-hardening branch May 6, 2026 09:25
timvisee pushed a commit that referenced this pull request May 8, 2026
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