Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8793

Fix stale commit files' size computation in LukeRequestHandler

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.5
    • Fix Version/s: 5.5.1, 6.0
    • Component/s: Server
    • Labels:
      None

      Description

      SOLR-8587 added segments file information and its size to core admin status API. However in case of stale commits, calling that API may result on FileNotFoundException or NoSuchFileException, if the segments file no longer exists due to a new commit. We should fix that by returning a proper value for the file's length in this case, maybe -1.

        Issue Links

          Activity

          Hide
          shaie Shai Erera added a comment -

          Patch fixes the bug by catching the IOException and returning -1. In that case, the index info will should a file size of -1, until the reader is refreshed.

          I chose to return a -1 over setting an empty string, or not returning the value at all since I feel it's better, but if others think otherwise, please comment.

          Show
          shaie Shai Erera added a comment - Patch fixes the bug by catching the IOException and returning -1. In that case, the index info will should a file size of -1, until the reader is refreshed. I chose to return a -1 over setting an empty string, or not returning the value at all since I feel it's better, but if others think otherwise, please comment.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 4384627f0891e4dc3232d3c7f20a54bc9224365c in lucene-solr's branch refs/heads/master from Shai Erera
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4384627 ]

          SOLR-8793: Fix stale commit files' size computation in LukeRequestHandler

          Show
          jira-bot ASF subversion and git services added a comment - Commit 4384627f0891e4dc3232d3c7f20a54bc9224365c in lucene-solr's branch refs/heads/master from Shai Erera [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4384627 ] SOLR-8793 : Fix stale commit files' size computation in LukeRequestHandler
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 122c24807196205f2bf65d37e6565caa7c6be987 in lucene-solr's branch refs/heads/branch_6x from Shai Erera
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=122c248 ]

          SOLR-8793: Fix stale commit files' size computation in LukeRequestHandler

          Show
          jira-bot ASF subversion and git services added a comment - Commit 122c24807196205f2bf65d37e6565caa7c6be987 in lucene-solr's branch refs/heads/branch_6x from Shai Erera [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=122c248 ] SOLR-8793 : Fix stale commit files' size computation in LukeRequestHandler
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit ee98a22d54cf1f419ae3c959ad09763cb7171140 in lucene-solr's branch refs/heads/branch_6_0 from Shai Erera
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ee98a22 ]

          SOLR-8793: Fix stale commit files' size computation in LukeRequestHandler

          Show
          jira-bot ASF subversion and git services added a comment - Commit ee98a22d54cf1f419ae3c959ad09763cb7171140 in lucene-solr's branch refs/heads/branch_6_0 from Shai Erera [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ee98a22 ] SOLR-8793 : Fix stale commit files' size computation in LukeRequestHandler
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 8edf1d96990b7327de57aa3d611dbf70b290dccb in lucene-solr's branch refs/heads/branch_5x from Shai Erera
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8edf1d9 ]

          SOLR-8793: Fix stale commit files' size computation in LukeRequestHandler

          Show
          jira-bot ASF subversion and git services added a comment - Commit 8edf1d96990b7327de57aa3d611dbf70b290dccb in lucene-solr's branch refs/heads/branch_5x from Shai Erera [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8edf1d9 ] SOLR-8793 : Fix stale commit files' size computation in LukeRequestHandler
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a1562c52671336f11f434bfb536260e260d01500 in lucene-solr's branch refs/heads/branch_5_5 from Shai Erera
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a1562c5 ]

          SOLR-8793: Fix stale commit files' size computation in LukeRequestHandler

          Show
          jira-bot ASF subversion and git services added a comment - Commit a1562c52671336f11f434bfb536260e260d01500 in lucene-solr's branch refs/heads/branch_5_5 from Shai Erera [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a1562c5 ] SOLR-8793 : Fix stale commit files' size computation in LukeRequestHandler
          Hide
          shaie Shai Erera added a comment -

          Pushed the fix to master, branch_6x, branch_6_0, branch_5x and branch_5_5. I think it would be good if it's released in a 5.5.1.

          Show
          shaie Shai Erera added a comment - Pushed the fix to master, branch_6x, branch_6_0, branch_5x and branch_5_5. I think it would be good if it's released in a 5.5.1.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 4384627f0891e4dc3232d3c7f20a54bc9224365c in lucene-solr's branch refs/heads/apiv2 from Shai Erera
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4384627 ]

          SOLR-8793: Fix stale commit files' size computation in LukeRequestHandler

          Show
          jira-bot ASF subversion and git services added a comment - Commit 4384627f0891e4dc3232d3c7f20a54bc9224365c in lucene-solr's branch refs/heads/apiv2 from Shai Erera [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4384627 ] SOLR-8793 : Fix stale commit files' size computation in LukeRequestHandler
          Hide
          elyograg Shawn Heisey added a comment - - edited

          Even with this fix, running 5.5.1-SNAPSHOT, I am still getting similar errors. Everything seems to work fine, just as it did before this fix was applied, but the error is happening a lot. Here's the stacktrace:

          2016-03-28 09:33:00.775 WARN  (qtp1012570586-316040) [   x:sparkinclive] org.apache.solr.handler.admin.LukeRequestHandler Error getting file length for [segments_ovq]
          java.nio.file.NoSuchFileException: /index/solr5/data/data/sparkinc_1/index/segments_ovq
                  at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
                  at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
                  at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
                  at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
                  at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
                  at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
                  at java.nio.file.Files.readAttributes(Files.java:1737)
                  at java.nio.file.Files.size(Files.java:2332)
                  at org.apache.lucene.store.FSDirectory.fileLength(FSDirectory.java:210)
                  at org.apache.lucene.store.NRTCachingDirectory.fileLength(NRTCachingDirectory.java:127)
                  at org.apache.solr.handler.admin.LukeRequestHandler.getFileLength(LukeRequestHandler.java:604)
                  at org.apache.solr.handler.admin.LukeRequestHandler.getIndexInfo(LukeRequestHandler.java:592)
                  at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:137)
                  at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:155)
                  at org.apache.solr.core.SolrCore.execute(SolrCore.java:2082)
                  at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:670)
                  at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:458)
                  at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:225)
                  at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:183)
                  at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
                  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
                  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
                  at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
                  at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
                  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
                  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
                  at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
                  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
                  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
                  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
                  at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
                  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
                  at org.eclipse.jetty.server.Server.handle(Server.java:499)
                  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
                  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
                  at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
                  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
                  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
                  at java.lang.Thread.run(Thread.java:745)
          
          Show
          elyograg Shawn Heisey added a comment - - edited Even with this fix, running 5.5.1-SNAPSHOT, I am still getting similar errors. Everything seems to work fine, just as it did before this fix was applied, but the error is happening a lot. Here's the stacktrace: 2016-03-28 09:33:00.775 WARN (qtp1012570586-316040) [ x:sparkinclive] org.apache.solr.handler.admin.LukeRequestHandler Error getting file length for [segments_ovq] java.nio.file.NoSuchFileException: /index/solr5/data/data/sparkinc_1/index/segments_ovq at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55) at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144) at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99) at java.nio.file.Files.readAttributes(Files.java:1737) at java.nio.file.Files.size(Files.java:2332) at org.apache.lucene.store.FSDirectory.fileLength(FSDirectory.java:210) at org.apache.lucene.store.NRTCachingDirectory.fileLength(NRTCachingDirectory.java:127) at org.apache.solr.handler.admin.LukeRequestHandler.getFileLength(LukeRequestHandler.java:604) at org.apache.solr.handler.admin.LukeRequestHandler.getIndexInfo(LukeRequestHandler.java:592) at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:137) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:155) at org.apache.solr.core.SolrCore.execute(SolrCore.java:2082) at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:670) at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:458) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:225) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:183) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) at java.lang.Thread.run(Thread.java:745)
          Hide
          toldev Tomasz Oliwa added a comment -

          I am on Solr 6.0.0 and am seeing exactly the same WARN org.apache.solr.handler.admin.LukeRequestHandler Error getting file length for [segments_...] in the Solr logging.

          Show
          toldev Tomasz Oliwa added a comment - I am on Solr 6.0.0 and am seeing exactly the same WARN org.apache.solr.handler.admin.LukeRequestHandler Error getting file length for [segments_...] in the Solr logging.
          Hide
          kamaci Furkan KAMACI added a comment - - edited

          I get that warning:

          WARN  - 2016-11-25 14:45:53.587; [   x:gettingstarted] org.apache.solr.handler.admin.LukeRequestHandler; Error getting file length for [segments_5]
          java.nio.file.NoSuchFileException: /solr-5.5.2/example/schemaless/solr/gettingstarted/data/index/segments_5
          	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
          	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
          	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
          	at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
          	at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
          	at java.nio.file.Files.readAttributes(Files.java:1737)
          	at java.nio.file.Files.size(Files.java:2332)
          	at org.apache.lucene.store.FSDirectory.fileLength(FSDirectory.java:210)
          	at org.apache.lucene.store.NRTCachingDirectory.fileLength(NRTCachingDirectory.java:124)
          	at org.apache.solr.handler.admin.LukeRequestHandler.getFileLength(LukeRequestHandler.java:604)
          	at org.apache.solr.handler.admin.LukeRequestHandler.getIndexInfo(LukeRequestHandler.java:592)
          	at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:137)
          	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:155)
          	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2102)
          	at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:654)
          	at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:460)
          	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:257)
          	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
          	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
          	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
          	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
          	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
          	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
          	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
          	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
          	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
          	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
          	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
          	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
          	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
          	at org.eclipse.jetty.server.Server.handle(Server.java:499)
          	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
          	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
          	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
          	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
          	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
          	at java.lang.Thread.run(Thread.java:745)
          

          with Solr 5.5.2 with default schemaless example.

          Show
          kamaci Furkan KAMACI added a comment - - edited I get that warning: WARN - 2016-11-25 14:45:53.587; [ x:gettingstarted] org.apache.solr.handler.admin.LukeRequestHandler; Error getting file length for [segments_5] java.nio.file.NoSuchFileException: /solr-5.5.2/example/schemaless/solr/gettingstarted/data/index/segments_5 at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55) at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144) at java.nio.file.Files.readAttributes(Files.java:1737) at java.nio.file.Files.size(Files.java:2332) at org.apache.lucene.store.FSDirectory.fileLength(FSDirectory.java:210) at org.apache.lucene.store.NRTCachingDirectory.fileLength(NRTCachingDirectory.java:124) at org.apache.solr.handler.admin.LukeRequestHandler.getFileLength(LukeRequestHandler.java:604) at org.apache.solr.handler.admin.LukeRequestHandler.getIndexInfo(LukeRequestHandler.java:592) at org.apache.solr.handler.admin.LukeRequestHandler.handleRequestBody(LukeRequestHandler.java:137) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:155) at org.apache.solr.core.SolrCore.execute(SolrCore.java:2102) at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:654) at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:460) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:257) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) at java.lang. Thread .run( Thread .java:745) with Solr 5.5.2 with default schemaless example.
          Hide
          TimOwen Tim Owen added a comment -

          We get this using Solr 6.3.0 because it's still logged at WARN level, which seems a bit alarmist to me. For indexes that are changing rapidly, it happens a lot. We're going to increase our logging threshold for that class to ERROR, because these messages are just filling up the logs and there's no action we can actually take to prevent it, because they're expected to happen sometimes. Personally I would make this message INFO level.

          Show
          TimOwen Tim Owen added a comment - We get this using Solr 6.3.0 because it's still logged at WARN level, which seems a bit alarmist to me. For indexes that are changing rapidly, it happens a lot. We're going to increase our logging threshold for that class to ERROR, because these messages are just filling up the logs and there's no action we can actually take to prevent it, because they're expected to happen sometimes. Personally I would make this message INFO level.

            People

            • Assignee:
              shaie Shai Erera
              Reporter:
              shaie Shai Erera
            • Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development