Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shumway743 opened this issue Jan 26, 2022 · 1 comment · Fixed by #2259
Closed

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

shumway743 opened this issue Jan 26, 2022 · 1 comment · Fixed by #2259

Comments

@shumway743
Copy link

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);
@pyalex
Copy link
Collaborator

pyalex commented Jan 26, 2022

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
Projects
None yet
3 participants