Skip to content

[BUG](frontend): Meter IDs-only deletes - #7657

Open
Jokasa7 wants to merge 1 commit into
chroma-core:mainfrom
Jokasa7:JoyCx/chroma-6695-delete-read-metering
Open

[BUG](frontend): Meter IDs-only deletes#7657
Jokasa7 wants to merge 1 commit into
chroma-core:mainfrom
Jokasa7:JoyCx/chroma-6695-delete-read-metering

Conversation

@Jokasa7

@Jokasa7 Jokasa7 commented Aug 29, 2026

Copy link
Copy Markdown

Description of changes

  • Improvements & Bug fixes
    • Close the CollectionReadContext after the delete selector branches have
      converged, instead of closing it only after a where lookup.
    • Submit the existing CollectionRead(GetForDelete) event for IDs-only and
      empty-selector delete paths as well as where-based deletes.
    • Preserve the query-size metadata collected by the where branch and the
      existing metering_events_sent.read success counter.
    • Add an integration regression test that exercises an IDs-only delete under
      a real metering context and verifies that exactly one read event is emitted
      with the expected action and region.
  • New functionality

Closes #6695.

Test plan

  • Tests pass locally with cargo test for Rust.
    • Before the production change, the new focused test failed with zero
      CollectionRead events where one was expected.
    • cargo test -p chroma-frontend --test test_delete_limit test_delete_by_ids_emits_collection_read_metering_event -- --exact --nocapture passes after the fix.
    • cargo test -p chroma-frontend --test test_delete_limit -- --nocapture
      passes all 8 tests.
    • cargo clippy -p chroma-frontend --test test_delete_limit -- -D warnings
      passes.
    • cargo fmt --all --check and git diff --check pass.

Migration plan

No migration or compatibility step is required. The change only ensures that
an already-created read metering context reaches the existing event receiver on
every delete-selector path.

Observability plan

No new metric is introduced. Successful submission continues to increment the
existing metering_events_sent.read counter, and the emitted event retains the
existing GetForDelete action and region fields. That counter and the billing
event stream can be used to confirm that IDs-only deletes are no longer absent.

Documentation Changes

No user-facing API, configuration, or behavior documentation changes are
needed. This is an internal metering correctness fix with regression coverage.

Close the read metering context after delete selector paths
converge so IDs-only requests submit the existing billing event.

Add regression coverage that exercises a metered IDs-only delete.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions

Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

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.

[BUG] IDs-only delete silently drops CollectionReadContext metering event

1 participant