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

SOLR-16670: Fix 404 error in S3 directory check #1373

Merged
merged 2 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ Bug Fixes

* SOLR-9698: Fix start/stop wait time and RMI_PORT on Windows (Colvin Cowie)

SOLR-16653: Shard split on PRS collections with NRT + PULL replicas lead to down replicas (Hitesh Khamesra via noble)
* SOLR-16653: Shard split on PRS collections with NRT + PULL replicas lead to down replicas (Hitesh Khamesra via noble)

* SOLR-16670: Fix directory/file check in S3Repository (Houston Putman, Hakan Özler)

Build
---------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ boolean isDirectory(String path) throws S3Exception {
String contentType = objectMetadata.contentType();

return !StringUtils.isEmpty(contentType) && contentType.equalsIgnoreCase(S3_DIR_CONTENT_TYPE);
} catch (NoSuchKeyException nske) {
return false;
} catch (SdkException sdke) {
throw handleAmazonException(sdke);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public void testFiles() throws S3Exception {
pushContent("/simple-file", "blah");
assertTrue("File should exist without a leading slash", client.pathExists("simple-file"));
assertTrue("File should exist with a leading slash", client.pathExists("/simple-file"));

assertFalse("File should not be considered a directory", client.isDirectory("/simple-file"));
}

/** Simple tests with a directory. */
Expand Down