SOLR SelectStream bug

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SOLR SelectStream bug

jpereira
Hi,

While trying to create an example with the Select stream decorator, I stumbled upon a bug in the solr 6.0.1 core.

The expression I was trying to run was:
select(
	search(
		collection1,
		q=""*:*",
		fl="v_id,s_id",
		qt="/export",
		sort="v_id asc,s_id asc"
	),
	v_id as v,
	s_id as s
)

via HTTP
http://localhost:8983/solr/collection1/stream?expr=http://localhost:8983/solr/collection1/stream?expr=select(search(collection1,q=""*:*",fl="v_id,s_id",qt="/export",sort="v_id asc,s_id asc"),v_id as v,s_id as s)

The request returned an error message, so I looked in the server full stack trace:
714206 ERROR (qtp1784662007-1250) [c:collection1 s:shard1 r:core_node1 x:collection1_shard1_replica1] o.a.s.h.StreamHandler java.io.IOException: Invalid stream expression select(search(collection1,q=""*:*",fl="v_id,s_id",qt="/export",sort="v_id asc,s_id asc"),v_id as v,s_id as s) - function 'select' is unknown (not mapped to a valid TupleStream)
	at org.apache.solr.client.solrj.io.stream.expr.StreamFactory.constructStream(StreamFactory.java:190)
	at org.apache.solr.client.solrj.io.stream.expr.StreamFactory.constructStream(StreamFactory.java:178)
	at org.apache.solr.handler.StreamHandler.handleRequestBody(StreamHandler.java:164)
	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:155)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2053)
	at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:652)
	at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:460)
	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:229)
	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:184)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
	at org.eclipse.jetty.server.Server.handle(Server.java:518)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
	at java.lang.Thread.run(Thread.java:745)

After examining the file org.apache.solr.handler.StreamHandler, I noticed the initialization of the functionNames HashMap of StreamFactory class was missing the select operation. This is done in StreamHandler.inform function, so I just added
.withFunctionName("select", SelectStream.class)
 after
.withFunctionName("topic", TopicStream.class) (StreamHandler.java:110)
, recompiled and... it works :)

Will this issue be fixed in 6.0.2?

Thanks.

Cheers,

João Pereira
Reply | Threaded
Open this post in threaded view
|

Re: SOLR SelectStream bug

Joel Bernstein
This was resolved in https://issues.apache.org/jira/browse/SOLR-9015. So
this will be fixed in the soon to be released in 6.1

This does look a good candidate to be backported to a bug fix release as
well.

Joel Bernstein
http://joelsolr.blogspot.com/

On Mon, Jun 13, 2016 at 7:03 AM, jpereira <[hidden email]> wrote:

> Hi,
>
> While trying to create an example with the Select stream decorator, I
> stumbled upon a bug in the solr 6.0.1 core.
>
> The expression I was trying to run was:
>
>
> via HTTP
>
>
> The request returned an error message, so I looked in the server full stack
> trace:
>
>
> After examining the file org.apache.solr.handler.StreamHandler, I noticed
> the initialization of the functionNames HashMap of StreamFactory class was
> missing the select operation. This is done in StreamHandler.inform
> function,
> so I just added  after , recompiled and... it works :)
>
> Will this issue be fixed in 6.0.2?
>
> Thanks.
>
> Cheers,
>
> João Pereira
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/SOLR-SelectStream-bug-tp4281995.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>