Skip to content

SQL registry initialization fails  #4543

@dmartinol

Description

@dmartinol

Expected Behavior

Given the right connection settings, an SQL registry initializes properly .

Current Behavior

First time, with an empty DB, the registry starts properly.
Once the DB is already populated with a Feast project, it fails.

Sample stack trace follows:

  File "/usr/local/lib/python3.11/site-packages/feast/feature_store.py", line 147, in __init__
    self._registry = SqlRegistry(registry_config, self.config.project, None)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/feast/infra/registry/sql.py", line 251, in __init__
    super().__init__(
  File "/usr/local/lib/python3.11/site-packages/feast/infra/registry/caching_registry.py", line 31, in __init__
    self.cached_registry_proto = self.proto()
                                 ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/feast/infra/registry/sql.py", line 855, in proto
    process_project(project)
  File "/usr/local/lib/python3.11/site-packages/feast/infra/registry/sql.py", line 813, in process_project
    cached_project = self.get_project(project_name, True)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/feast/infra/registry/caching_registry.py", line 407, in get_project
    self._refresh_cached_registry_if_necessary()
  File "/usr/local/lib/python3.11/site-packages/feast/infra/registry/caching_registry.py", line 430, in _refresh_cached_registry_if_necessary
    if self.cache_mode == "sync":
       ^^^^^^^^^^^^^^^
AttributeError: 'SqlRegistry' object has no attribute 'cache_mode'

Steps to reproduce

Reproduced with a Registry server connected to postgres DB.

Possible Solution

The SqlRegistry.proto() function has been enhanced after PR #4475 to run the process_process function on each existing project, which invokes self.get_project before the registry instance has been fully initialized.
We cannot invoke self.proto() at the beginning of the CachingRegistry initialization.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions