feat: Add feature view versioning support to Elasticsearch online store - #6781
Open
alekseevpavel04 wants to merge 1 commit into
Open
feat: Add feature view versioning support to Elasticsearch online store#6781alekseevpavel04 wants to merge 1 commit into
alekseevpavel04 wants to merge 1 commit into
Conversation
Versioned feature references such as `driver_stats@v2:trips_today` were refused by the Elasticsearch online store: every path named its index after the bare feature view name, and the store was not on the list of stores that `OnlineStore._check_versioned_read_support` accepts, so a versioned read raised `VersionedOnlineReadNotSupported`. Elasticsearch keeps one index per feature view, so the version belongs in the index name, the same shape Cassandra and the SQL stores use. All nine sites that name an index now go through `_versioned_index_name`, which wraps the existing `compute_versioned_name` helper the way `redis.py` does: the write and its mapping probe, `online_read`, `create_index`, `update`, `teardown`, and both `retrieve_online_documents` paths. The index name is unchanged when `enable_online_feature_view_versioning` is off and when the version is 0, so existing deployments keep the indices they have and the flag stays opt-in. Fixes feast-dev#6172 Signed-off-by: Pavel Alekseev <alekceevpavel@mail.ru>
alekseevpavel04
requested review from
ejscribner,
robhowley and
shuchu
and removed request for
a team
August 25, 2026 11:42
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6781 +/- ##
==========================================
+ Coverage 47.08% 47.28% +0.19%
==========================================
Files 419 419
Lines 51878 51882 +4
Branches 7525 7525
==========================================
+ Hits 24429 24534 +105
+ Misses 25700 25587 -113
- Partials 1749 1761 +12
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Adds versioned read/write support for feature views to the Elasticsearch online
store, so that a version-qualified reference like
driver_stats@v2:trips_todayresolves to that version's data.
Before this, Elasticsearch named every index after the bare feature view name,
and the store was not among the types
OnlineStore._check_versioned_read_supportaccepts — so a versioned referenceraised
VersionedOnlineReadNotSupportedno matter what was in the store.Elasticsearch keeps one index per feature view, so the version belongs in the
index name, which is the shape the SQL stores and Cassandra already use. The
new module-level
_versioned_index_namewraps the existingcompute_versioned_namehelper the same wayredis.pydoes, and every paththat names an index goes through it:
online_write_batch_index, and the_index_has_value_nummapping probeonline_readcreate_indexindices.createupdatedelete_by_queryfor dropped views,create_indexfor kept onesteardownindices.deleteretrieve_online_documents,retrieve_online_documents_v2ElasticSearchOnlineStoreis also added to the supported list inonline_store.py. Both halves are needed: renaming alone still refuses everyversioned read, and the list entry alone would accept the reference and then
read the unversioned index.
Backward compatible. The index name is unchanged when
enable_online_feature_view_versioningis off, and when the resolved version is0 — so existing deployments keep the indices they have, and nothing moves until
the flag is turned on.
_bulk_batch_actionsnow takes the resolved index nameinstead of the
FeatureView; it is private andonline_write_batchis its onlycaller.
Which issue(s) this PR fixes:
Fixes #6172
Checks
git commit -s)Testing Strategy
sdk/python/tests/unit/infra/online_store/test_elasticsearch_versioning.py, 17tests, following
test_redis_versioning.py: the name the helper resolves(including version 0 and
projection.version_tagtaking priority overcurrent_version_number), the index each store path actually asks for, and thatthe store now passes
_check_versioned_read_support.Checked that they fail without the change, in two halves. Reverting only
elasticsearch.pygives 14 failures of the formassert 'driver_stats' == 'driver_stats_v2'; reverting onlyonline_store.pygives 2, with
VersionedOnlineReadNotSupported: Versioned feature reads (@v2) are not yet supported by ElasticSearchOnlineStore.Full unit suite, run in two halves: 1258 passed / 20 skipped and 1398
passed / 24 skipped, no failures, against a baseline of 1241 / 20 and 1398 /
24 taken on the same commit before the change — so the only difference is the 17
new tests.
ruff format --checkandruff checkare clean on the three files.Misc
Integration tests are not included: the Elasticsearch integration suite needs a
live instance, and the six stores that already have this feature test it in the
unit suite, one
test_<store>_versioning.pyfile each. This follows that.One thing I noticed and did not touch:
VersionedOnlineReadNotSupportedinerrors.pylists the supporting stores by hand, and that sentence is alreadymissing Milvus. Happy to update it here if you would like it to stay accurate.