Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

feat: Add row deletion to the Milvus online store - #7082

Open
jiwidi wants to merge 4 commits into
feast-dev:masterfrom
jiwidi:feat/milvus-online-delete
Open

jiwidi wants to merge 4 commits into
feast-dev:masterfrom
jiwidi:feat/milvus-online-delete

Conversation

@jiwidi

@jiwidi jiwidi commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

The Redis online store can remove rows: delete_entity_values removes the rows of an entity and
delete_table removes the rows of a feature view. The Milvus online store has nothing between
upsert and drop_collection, so a row cannot be removed when its entity leaves the data set, for
example a product that is no longer sold.

This PR adds MilvusOnlineStore.online_delete, which deletes by entity key or by filter:

Call Behaviour
entity_keys=[...] Deletes by primary key, with the same serialized entity key that writes and reads use.
filters=ComparisonFilter(...) or CompoundFilter(...) Deletes the rows the filter selects, through the existing MilvusFilterTranslator.
entity_keys=[] Deletes nothing.
both or neither ValueError.
a filter with an empty group, at any level ValueError, so a mistake cannot delete more rows than it names.
missing collection Returns without creating it.
from feast.filter_models import ComparisonFilter

online_store.online_delete(config, feature_view, entity_keys=[entity_key])
online_store.online_delete(
    config, feature_view, filters=ComparisonFilter(type="eq", key="brand_id", value="acme")
)

It works on every collection Feast created, whichever settings created it. No tombstone is kept: a
later write creates the row again, and Feast does not order a delete against writes from other
processes. The method is store-level, like the Redis delete methods; a FeatureStore-level API can
follow once more stores implement it.

Which issue(s) this PR fixes:

N/A

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests

  • Integration tests

  • Manual tests

  • Testing is not required for this change

  • Unit (Milvus Lite): delete by entity key leaves the other rows; delete by filter; a deleted row
    can be written again.

  • Unit (mocked client): both or neither selector and a filter with an empty group are rejected
    before any call; a missing collection is neither created nor queried; an empty key list
    does not even connect.

  • Server: delete by key and by filter are visible to the next Strong read; the row can be
    written again.

Unit tests run on Milvus Lite 3.2.1 (pymilvus 3.0.2). The server test in
sdk/python/tests/integration/online_store/test_milvus_remote.py passes against a local
Milvus 3.0.2 server. The existing Milvus unit and server tests pass unchanged.

Misc

Part of a stack that adds to the Milvus online store the update and delete functionality the Redis
online store has, following #6882, #6895, #6917, #6921 and #6940. The other PRs of the stack are
#7083 (partition options) and #7084 (tie-break in write batches). mutation_timeout and a schema mismatch check follow once these merge.

The Milvus online store had no operation between upsert and dropping a
collection, so a row could not be removed when its entity left the
catalogue. The Redis online store can remove rows with
delete_entity_values and delete_table.

MilvusOnlineStore.online_delete deletes rows by entity key or by filter.
It accepts exactly one of the two, deletes nothing for an empty key list,
rejects a filter without conditions, and does not create a missing
collection. It works on every collection that Feast created.

Signed-off-by: jiwidi <fhjaime96@gmail.com>
@codecov-commenter

codecov-commenter commented Oct 28, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.00%. Comparing base (1e5e90c) to head (408fc54).

Files with missing lines Patch % Lines
.../infra/online_stores/milvus_online_store/milvus.py 89.47% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7082      +/-   ##
==========================================
+ Coverage   50.97%   51.00%   +0.02%     
==========================================
  Files         455      455              
  Lines       56994    57013      +19     
  Branches     8321     8327       +6     
==========================================
+ Hits        29055    29080      +25     
+ Misses      25954    25947       -7     
- Partials     1985     1986       +1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (+0.20%) ⬆️
python-unit 52.46% <89.47%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
.../infra/online_stores/milvus_online_store/milvus.py 76.64% <89.47%> (+0.47%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e5e90c...408fc54. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: jiwidi <fhjaime96@gmail.com>

@patelchaitany patelchaitany 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.

Looks good overall. One concern about nested empty filter groups on the delete path, and a small nit.

Comment on lines +740 to +742
expression = MilvusFilterTranslator().translate(filters)
if not expression:
raise ValueError("The deletion filter must have at least one condition")

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.

This only catches a filter that is empty at the top level. MilvusFilterTranslator drops empty nested groups, so:

CompoundFilter(type="and", filters=[
    ComparisonFilter(type="eq", key="brand_id", value="acme"),
    CompoundFilter(type="or", filters=[]),
])

becomes (brand_id == 'acme') and deletes every acme row. An empty or should match nothing, so this deletes more than the filter asks for. It can happen when the or is built from a list that turns out empty. Since this is a delete, could we reject an empty group anywhere in the tree, not only at the top?

Comment on lines +752 to +753
collection = self._get_or_create_collection(config, table)
self.client.delete(collection_name=collection["collection_name"], **selector)

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.

nit: The guard above already returns when the collection is missing, so this never creates one. It is only here to load and cache the collection. A short comment would help, since it reads like "create, then delete". Also, collection["collection_name"] is the same as collection_name.

The Milvus filter translator drops an empty nested group, so a filter
such as and(brand_id == 'acme', or()) deleted every acme row instead of
none. online_delete now rejects a filter with an empty group at any
level before it connects.

The delete path loads the collection with _ensure_loaded instead of
_get_or_create_collection, which could not create one after the
has_collection guard, and reuses the collection name it computed.

Signed-off-by: jiwidi <fhjaime96@gmail.com>
@jiwidi

jiwidi commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Looks good overall. One concern about nested empty filter groups on the delete path, and a small nit.

hi! thank you for review, pushed now a commit to address the bug and nit.

  • online_delete now walks the filter and rejects an empty group at any level, and your example is in the rejection test. Left the translator as is since reads go through it too, can do that in a followup commit if you think it should raise there as well.

  • Nit: dropped the _get_or_create_collection call there. It now checks the collection exists, calls _ensure_loaded (delete by filter fails on an unloaded collection on a real server) and uses collection_name directly.

Signed-off-by: jiwidi <fhjaime96@gmail.com>

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.

3 participants