⚡ Sangsakala Proxy 🏠 Home
Skip to content

fix: Break event timestamp ties by created timestamp in Milvus write batches - #7084

Open
jiwidi wants to merge 3 commits into
feast-dev:masterfrom
jiwidi:fix/milvus-write-tie-break
Open

jiwidi wants to merge 3 commits into
feast-dev:masterfrom
jiwidi:fix/milvus-write-tie-break

Conversation

@jiwidi

@jiwidi jiwidi commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

When a batch holds two rows for one entity, the Milvus store keeps one of them. It kept the row
with the latest event timestamp and, on a tie, the first row of the batch, whatever its created
timestamp. The offline stores break such a tie on the created timestamp, and the Redis online
store writes rows in order so the last one wins. A correction that carries the same event
timestamp and a newer created timestamp was lost.

Rows for one entity in a batch Before After
different event timestamps latest event timestamp wins unchanged
same event timestamp, different created timestamps first row wins latest created timestamp wins
same event and created timestamps first row wins last row of the batch wins

This orders rows within one batch. The Redis store also skips a row whose event timestamp is older
than the stored one; in Milvus that needs a read before every write and is left for a later PR.

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): the four cases of the table, with the rows in both orders; a batch with
    two entities keeps both.

  • Server: two rows with the same event timestamp; the one with the newer created timestamp is
    read back with Strong consistency.

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
#7082 (row deletion) and #7083 (partition options). mutation_timeout and a schema mismatch check follow once these merge.

…batches

A batch with two rows for one entity and the same event timestamp kept the
first row, whatever its created timestamp. The offline stores break such
ties on the created timestamp, and the Redis online store keeps the last
row it writes. The Milvus store now keeps the row with the latest event
timestamp, then the latest created timestamp, then the last row of the
batch, so a correction with a newer created timestamp is not lost.

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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.28%. Comparing base (b576c45) to head (47b55ee).
❗ 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    #7084   +/-   ##
=======================================
  Coverage   51.28%   51.28%           
=======================================
  Files         458      458           
  Lines       57409    57410    +1     
  Branches     8415     8415           
=======================================
+ Hits        29443    29445    +2     
  Misses      25957    25957           
+ Partials     2009     2008    -1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 52.76% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
.../infra/online_stores/milvus_online_store/milvus.py 76.87% <100.00%> (+0.23%) ⬆️

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 b576c45...47b55ee. 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>

@shuchu shuchu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@shuchu

shuchu commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@jiwidi please update the PR by rebasing the master branch.

@jiwidi

jiwidi commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@jiwidi please update the PR by rebasing the master branch.

hi, did that now, seems like failing to a dep issue that #7104 #7104 introduced. Will reupdate with main when that lands in so test can run!

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