Skip to content

registry.db doesn't work in S3 subdirectory with Java Feature Server #2239

Closed

Description

@shumway743

Expected Behavior

registry.db should be fetched by java feature server in any valid S3 location.

Current Behavior

Java feature server can only fetch registry.db if it is in the root directory of the S3 bucket.

Steps to reproduce

Set registry java config to a nested s3 path such as "s3://bucket/child_directory/registry.db" and the server will throw a "No Such Key" error. However, something like "s3://bucket/registry.db" works.

Specifications

  • Version:
  • Platform:
  • Subsystem:

Possible Solution

The issue seems to be in feast.serving.registry.S3RegistryFile.java lines 35-36:

String[] split = url.replace("s3://", "").split("/");
this.s3Object = this.s3Client.getObject(split[0], split[1]);

The current code splits and uses the element at index 1, which may or may not be the registry.db file. Instead, we should join back the last n-1 elements of the split array. Something like this:

String[] split = url.replace("s3://", "").split("/");
String objectPath = String.join("/", java.util.Arrays.copyOfRange(split, 1, split.length));
this.s3Object = this.s3Client.getObject(split[0], objectPath);

Activity

  1. pyalex commented on Jan 26, 2022

    @pyalex
    Collaborator

    Hi @shumway743 , thanks for reporting this. Creating PR with the fix would be very welcomed!

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions