You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/04/09 09:07:52 UTC

[GitHub] [solr] asalamon74 opened a new pull request #67: SOLR-15329 Improve hdfs directory size calculation

asalamon74 opened a new pull request #67:
URL: https://github.com/apache/solr/pull/67


   <!--
   _(If you are a project committer then you may remove some/all of the following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system for Solr:
   
   * https://issues.apache.org/jira/projects/SOLR
   
   You will need to create an account in Jira in order to create an issue.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * SOLR-####: <short description of problem or changes>
   
   SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   
   The current implementation of directory size calculation checks the size of the files one by one which can be very slow on HDFS. It seems to me, this was sped up in SOLR-9204 but later SOLR-3990 changed it back to the old implementation.
   
   # Solution
   
   Change back to the SOLR-9204 version.
   
   # Tests
   
   Unit tests.
   
   Also tested (using Solr 8.4.1) on a cluster, reading metrics (which includes the directory size calculation) was drastically improved.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob closed pull request #67: SOLR-15329 Improve hdfs directory size calculation

Posted by GitBox <gi...@apache.org>.
madrob closed pull request #67:
URL: https://github.com/apache/solr/pull/67


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] asalamon74 commented on a change in pull request #67: SOLR-15329 Improve hdfs directory size calculation

Posted by GitBox <gi...@apache.org>.
asalamon74 commented on a change in pull request #67:
URL: https://github.com/apache/solr/pull/67#discussion_r614249826



##########
File path: solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java
##########
@@ -452,8 +452,6 @@ public long size(String path) throws IOException {
     } catch (IOException e) {
       log.error("Error checking if hdfs path exists", e);
       throw new SolrException(ErrorCode.SERVER_ERROR, "Error checking if hdfs path exists", e);
-    } finally {
-      IOUtils.closeQuietly(fileSystem);

Review comment:
       Without removing this I got filesystem already closed exceptions.
   
   We are getting the fileSystem using `FileSystem fileSystem = getCachedFileSystem(path)`. And cache will take care of the close as stated here: https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java#L462
   
   ```
   // no need to close the fs, the cache will do it
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] madrob commented on a change in pull request #67: SOLR-15329 Improve hdfs directory size calculation

Posted by GitBox <gi...@apache.org>.
madrob commented on a change in pull request #67:
URL: https://github.com/apache/solr/pull/67#discussion_r614186729



##########
File path: solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java
##########
@@ -452,8 +452,6 @@ public long size(String path) throws IOException {
     } catch (IOException e) {
       log.error("Error checking if hdfs path exists", e);
       throw new SolrException(ErrorCode.SERVER_ERROR, "Error checking if hdfs path exists", e);
-    } finally {
-      IOUtils.closeQuietly(fileSystem);

Review comment:
       Why do we no longer need to close this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org