Thanks to visit codestin.com
Credit goes to github.com

Skip to content

apply_data_source method matches by name only, without filtering by project in shared registry scenario #6206

Description

@ntkathole

Current Behavior

The issue is in sdk/python/feast/infra/registry/registry.py. When multiple projects share the same registry and have data sources with the same name (like the default vals_to_add), the apply_data_source method matches by name only, without filtering by project, causing cross-project overwriting.

Correctly scoped (name + project):

apply_entity (line 349-352):

if (existing_entity_proto.spec.name == entity_proto.spec.name
    and existing_entity_proto.spec.project == project):

apply_feature_service (line 447-451):

if (existing_feature_service_proto.spec.name == feature_service_proto.spec.name
    and existing_feature_service_proto.spec.project == project):

apply_feature_view (line 779-781):

if (existing_feature_view_proto.spec.name == feature_view_proto.spec.name
    and existing_feature_view_proto.spec.project == project):

BUG - name-only matching, no project filter:

apply_data_source (line 396-397):

        for idx, existing_data_source_proto in enumerate(registry.data_sources):
            if existing_data_source_proto.name == data_source.name:

delete_data_source (line 426):

if data_source_proto.name == name:

Steps to reproduce

  • feast apply for project test registers vals_to_add with project=test
  • feast apply for project test1 iterates all data_sources, finds vals_to_add from project test (matched by name only, no project check)
  • The equality check fails (they differ - at minimum different internal state), so it deletes the test version and adds a new one with project=test1

Specifications

  • Version: latest

Possible Solution

The fix would be to add the project filter to both apply_data_source and delete_data_source:


# apply_data_source fix (line 397):
if existing_data_source_proto.name == data_source.name and existing_data_source_proto.project == project:

# delete_data_source fix (line 426):
if data_source_proto.name == name and data_source_proto.project == project:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions