-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
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);