Skip to content

fix: Stop fetching the registry twice on each feature server refresh - #7220

Open
helloybz wants to merge 2 commits into
feast-dev:masterfrom
helloybz:fix/vector-store-registry-cached-refresh
Open

helloybz wants to merge 2 commits into
feast-dev:masterfrom
helloybz:fix/vector-store-registry-cached-refresh

Conversation

@helloybz

@helloybz helloybz commented Nov 24, 2026 •

Copy link
Copy Markdown

What this PR does / why we need it:

Each registry refresh of the feature server (at startup and then on every registry_ttl_sec cycle) calls store.refresh_registry() and then VectorStoreRegistry.refresh(). VectorStoreRegistry.refresh(), added in #6121, lists feature views with the default allow_cache=False, so it reads the registry backend again right after the store refreshed from it. With a file-based registry (local, S3, GCS), every cycle downloads the registry file twice. With the SQL registry, every cycle runs a feature view query on top of the full reload. With a remote registry, the registry server reads its own backend again instead of answering from the cache that the preceding Refresh call updated. This happens on every feature server, including servers with no vector-indexed feature views, where the second read finds nothing to index. Each extra read is also one more chance for a cycle to hit a transient backend error.

VectorStoreRegistry.refresh() now lists feature views with allow_cache=True and reads the copy the store just refreshed. The initial build in get_app() also reads a loaded registry, because Registry and CachingRegistry fill their cache when they are created. With cache_mode="none", allow_cache=True still reads the backend, as before.

Only VectorStoreRegistry.refresh() changes.

Which issue(s) this PR fixes:

No existing issue. I searched open and closed issues and PRs for VectorStoreRegistry and registry refresh.

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

New test test_registry_refresh_reads_the_registry_store_once in sdk/python/tests/unit/test_feature_server.py: starting the app runs one registry refresh, which should call the registry store's get_registry_proto once. Fails on master with assert 2 == 1 and passes with this change.

make test-python-unit passes locally (4460 passed, 37 skipped), and ruff check, ruff format and mypy are clean on the changed files.

Misc

#7219 fixes another problem in the same refresh cycle: a failed periodic refresh stopped all later refreshes. The two PRs touch different parts of the code; I checked that they merge cleanly together and that the tests of both pass.

This change was written with help from an AI assistant (Claude Code). I reviewed it and ran the tests above.

🤖 Generated with Claude Code


Devin Review

Every periodic refresh calls store.refresh_registry() and then
VectorStoreRegistry.refresh(), which listed feature views with the
default allow_cache=False. That fetched the full registry from its
backend a second time right after the first fetch, doubling registry
backend reads (S3/GCS downloads, SQL queries, gRPC calls) and the
chances of a failed refresh, even for servers with no vector-indexed
feature views.

List feature views with allow_cache=True so the vector store registry
reads the copy the store just refreshed. Registries fill their cache
when they are created, so the initial VectorStoreRegistry build in
get_app() also reads a loaded registry.

Signed-off-by: Youngbeom Choi <helloybz@gmail.com>
@helloybz
helloybz requested a review from a team as a code owner November 24, 2026 07:12

@devin-ai-integration devin-ai-integration 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.

🔍 Devin Review: 3 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Signed-off-by: Youngbeom Choi <helloybz@gmail.com>

@franciscojavierarceo franciscojavierarceo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the explicit FeatureStore.refresh_registry() call still reloads the backend before the vector mapping reads its cache. the file registry's TTL/mtime checks and the SQL registry's cache_mode='none' path remain in effect. the new real-registry regression observes one backend fetch during lifespan startup.

@codecov-commenter

codecov-commenter commented Nov 24, 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 54.13%. Comparing base (a291a0f) to head (fe91aa1).
❗ 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    #7220      +/-   ##
==========================================
+ Coverage   54.10%   54.13%   +0.03%     
==========================================
  Files         467      467              
  Lines       58940    58940              
  Branches     8688     8688              
==========================================
+ Hits        31890    31908      +18     
+ Misses      24892    24868      -24     
- Partials     2158     2164       +6     
Flag Coverage Δ
go-feature-server 30.96% <ø> (ø)
python-unit 55.74% <100.00%> (+0.03%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/vector_store_utils.py 100.00% <100.00%> (ø)

... and 3 files 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 a291a0f...fe91aa1. 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants