Skip to content

chore(search): remove unused names index client code#2702

Merged
gbirman merged 2 commits into
mainfrom
gab/chore/deprecate-names-index
Apr 20, 2026
Merged

chore(search): remove unused names index client code#2702
gbirman merged 2 commits into
mainfrom
gab/chore/deprecate-names-index

Conversation

@gbirman
Copy link
Copy Markdown
Contributor

@gbirman gbirman commented Apr 20, 2026

Stacked on #2694.

Summary

  • The names OpenSearch index (3M docs / 2.5GB in prod) has no writers: upsert_entity_name exists but has zero callers in the codebase. The only code still touching it is defensive cleanup in chat/document/email removal paths, which delete from an index nothing writes to.
  • Drop the orphaned upsert_entity_name + UpsertEntityNameArgs and all four delete_entity_name* functions (+ their OpensearchClient wrappers).
  • Remove the defensive delete_entity_name* calls from search_processing_service::process::{chat, document::mod, email::remove, user}.
  • Remove SearchIndex::Names variant — with these deletions, it has no references.

Once this deploys, the prod names index can be deleted out of band (same pattern as the projects index).

The unit test asserting OpenSearchEntityType::index_name() matches SearchIndex::from(variant).as_ref() (added in #2694) still passes — Names wasn't part of that invariant.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@gbirman has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 35 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 35 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c7154c6d-8d25-4e07-acce-8cd42e1c1d3d

📥 Commits

Reviewing files that changed from the base of the PR and between ff0d828 and 97b79c5.

📒 Files selected for processing (12)
  • infra/stacks/opensearch/helpers/scripts/delete_user_entities.ts
  • rust/cloud-storage/models_opensearch/src/lib.rs
  • rust/cloud-storage/opensearch_client/src/delete/mod.rs
  • rust/cloud-storage/opensearch_client/src/delete/name.rs
  • rust/cloud-storage/opensearch_client/src/lib.rs
  • rust/cloud-storage/opensearch_client/src/name.rs
  • rust/cloud-storage/opensearch_client/src/upsert/mod.rs
  • rust/cloud-storage/opensearch_client/src/upsert/name.rs
  • rust/cloud-storage/search_processing_service/src/process/chat.rs
  • rust/cloud-storage/search_processing_service/src/process/document/mod.rs
  • rust/cloud-storage/search_processing_service/src/process/email/remove.rs
  • rust/cloud-storage/search_processing_service/src/process/user.rs

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.

Base automatically changed from gab-chore-remove-projects-search-index to main April 20, 2026 22:39
The names index has no writers — upsert_entity_name has no callers
and the defensive delete_entity_name* calls in chat/document/email
removal paths cleaned up an index nothing wrote to. Dropped the
orphaned upsert, all four delete variants, the OpensearchClient
methods that wrapped them, and the SearchIndex::Names variant.

The prod names index (3M docs, 2.5GB) can now be safely deleted out
of band once this is deployed.
@gbirman gbirman force-pushed the gab/chore/deprecate-names-index branch from fbc4fe3 to 85526a1 Compare April 20, 2026 22:41
@gbirman gbirman requested a review from a team as a code owner April 20, 2026 22:45
@github-actions github-actions Bot added the infra label Apr 20, 2026
@gbirman gbirman merged commit c8107bf into main Apr 20, 2026
39 checks passed
@gbirman gbirman deleted the gab/chore/deprecate-names-index branch April 20, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant