Solr
  1. Solr
  2. SOLR-8336

CoreDescriptor instance directory should be a Path, not a String

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      Next step in SOLR-8282

      1. SOLR-8336.patch
        95 kB
        Alan Woodward

        Activity

        Hide
        Alan Woodward added a comment -

        Patch.

        This also moves all core-creation logic out of CoreAdminHandler and into CoreContainer, so that CAH now just translates query parameters into POJOs.

        One thing we might want to consider in another issue is removing (in 6.0) the ability to specify arbitrary instance directories for cores. This can already break core discovery, and isn't really necessary with configsets and arbitrary data directories.

        Show
        Alan Woodward added a comment - Patch. This also moves all core-creation logic out of CoreAdminHandler and into CoreContainer, so that CAH now just translates query parameters into POJOs. One thing we might want to consider in another issue is removing (in 6.0) the ability to specify arbitrary instance directories for cores. This can already break core discovery, and isn't really necessary with configsets and arbitrary data directories.
        Hide
        ASF subversion and git services added a comment -

        Commit 1717254 from Alan Woodward in branch 'dev/trunk'
        [ https://svn.apache.org/r1717254 ]

        SOLR-8336: CoreDescriptor takes a Path for its instance dir, rather than a String

        Show
        ASF subversion and git services added a comment - Commit 1717254 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1717254 ] SOLR-8336 : CoreDescriptor takes a Path for its instance dir, rather than a String
        Hide
        ASF subversion and git services added a comment -

        Commit 1717260 from Alan Woodward in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1717260 ]

        SOLR-8336: CoreDescriptor takes a Path for its instance dir, rather than a String

        Show
        ASF subversion and git services added a comment - Commit 1717260 from Alan Woodward in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1717260 ] SOLR-8336 : CoreDescriptor takes a Path for its instance dir, rather than a String
        Hide
        Dennis Gove added a comment -

        This patch appears to have broken the ability to create a new collection using bin/solr create -c

        $ bin/solr/bin/solr create -c holders -d ~/dev/solr/bbdemo/data/solr/conf
        
        Connecting to ZooKeeper at localhost:2181 ...
        Uploading /Users/dgove1/dev/solr/bbdemo/data/solr/conf/conf for config holders to ZooKeeper at localhost:2181
        
        Creating new collection 'holders' using command:
        http://localhost:8983/solr/admin/collections?action=CREATE&name=holders&numShards=1&replicationFactor=1&maxShardsPerNode=1&collection.configName=holders
        
        
        ERROR: Failed to create collection 'holders' due to: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://10.16.81.28:8983/solr: Expected mime type application/octet-stream but got text/html. <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Error 500 {msg=org.apache.solr.core.CoreDescriptor.getInstanceDir()Ljava/lang/String;,trace=java.lang.NoSuchMethodError: org.apache.solr.core.CoreDescriptor.getInstanceDir()Ljava/lang/String;
        	at org.apache.solr.cloud.CloudConfigSetService.createCoreResourceLoader(CloudConfigSetService.java:38)
        	at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:810)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:750)
        	at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:617)
        	at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:212)
        	at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:192)
        	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:151)
        	at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:660)
        	at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:436)
        	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:221)
        	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:180)
        	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)
        ,code=500}</title>
        </head>
        <body><h2>HTTP ERROR 500</h2>
        <p>Problem accessing /solr/admin/cores. Reason:
        <pre>    {msg=org.apache.solr.core.CoreDescriptor.getInstanceDir()Ljava/lang/String;,trace=java.lang.NoSuchMethodError: org.apache.solr.core.CoreDescriptor.getInstanceDir()Ljava/lang/String;
        	at org.apache.solr.cloud.CloudConfigSetService.createCoreResourceLoader(CloudConfigSetService.java:38)
        	at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:810)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:750)
        	at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:617)
        	at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:212)
        	at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:192)
        	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:151)
        	at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:660)
        	at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:436)
        	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:221)
        	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:180)
        	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)
        ,code=500}</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>
        
        </body>
        </html>
        

        If I revert trunk back to git hash 4781aaf (2015-11-30 | [Christine Poerschke] (HEAD) SOLR-8340: move solr/CHANGES.txt entry from 5.4.0 to 5.5.0 section) and rebuild then this command completes as expected.

        Show
        Dennis Gove added a comment - This patch appears to have broken the ability to create a new collection using bin/solr create -c $ bin/solr/bin/solr create -c holders -d ~/dev/solr/bbdemo/data/solr/conf Connecting to ZooKeeper at localhost:2181 ... Uploading /Users/dgove1/dev/solr/bbdemo/data/solr/conf/conf for config holders to ZooKeeper at localhost:2181 Creating new collection 'holders' using command: http: //localhost:8983/solr/admin/collections?action=CREATE&name=holders&numShards=1&replicationFactor=1&maxShardsPerNode=1&collection.configName=holders ERROR: Failed to create collection 'holders' due to: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http: //10.16.81.28:8983/solr: Expected mime type application/octet-stream but got text/html. <html> <head> <meta http-equiv= "Content-Type" content= "text/html; charset=UTF-8" /> <title>Error 500 {msg=org.apache.solr.core.CoreDescriptor.getInstanceDir()Ljava/lang/ String ;,trace=java.lang.NoSuchMethodError: org.apache.solr.core.CoreDescriptor.getInstanceDir()Ljava/lang/ String ; at org.apache.solr.cloud.CloudConfigSetService.createCoreResourceLoader(CloudConfigSetService.java:38) at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:810) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:750) at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:617) at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:212) at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:192) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:151) at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:660) at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:436) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:221) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:180) 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) ,code=500}</title> </head> <body><h2>HTTP ERROR 500</h2> <p>Problem accessing /solr/admin/cores. Reason: <pre> {msg=org.apache.solr.core.CoreDescriptor.getInstanceDir()Ljava/lang/ String ;,trace=java.lang.NoSuchMethodError: org.apache.solr.core.CoreDescriptor.getInstanceDir()Ljava/lang/ String ; at org.apache.solr.cloud.CloudConfigSetService.createCoreResourceLoader(CloudConfigSetService.java:38) at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:810) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:750) at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:617) at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:212) at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:192) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:151) at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:660) at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:436) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:221) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:180) 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) ,code=500}</pre></p><hr><i><small>Powered by Jetty: //</small></i><hr/> </body> </html> If I revert trunk back to git hash 4781aaf (2015-11-30 | [Christine Poerschke] (HEAD) SOLR-8340 : move solr/CHANGES.txt entry from 5.4.0 to 5.5.0 section) and rebuild then this command completes as expected.
        Hide
        Alan Woodward added a comment -

        Hm, that looks as though something hasn't been rebuilt - are you sure you're trying this from a totally clean checkout?

        Show
        Alan Woodward added a comment - Hm, that looks as though something hasn't been rebuilt - are you sure you're trying this from a totally clean checkout?
        Hide
        Dennis Gove added a comment -

        I believe so. I went through a full clean/rebuild. Though maybe something failed and I didn't notice it. I'll double check.

        Show
        Dennis Gove added a comment - I believe so. I went through a full clean/rebuild. Though maybe something failed and I didn't notice it. I'll double check.
        Hide
        Dennis Gove added a comment -

        You're correct - it was a failure to properly clean the build. Apparently I fat-fingered

        ant clean

        to

        ant c lean

        After going back and properly cleaning I am now seeing expected behavior.

        Show
        Dennis Gove added a comment - You're correct - it was a failure to properly clean the build. Apparently I fat-fingered ant clean to ant c lean After going back and properly cleaning I am now seeing expected behavior.
        Hide
        Alan Woodward added a comment -

        No worries, thanks for checking!

        Show
        Alan Woodward added a comment - No worries, thanks for checking!

          People

          • Assignee:
            Alan Woodward
            Reporter:
            Alan Woodward
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development