[ https://issues.apache.org/jira/browse/GEODE-2943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shelley Lynn Hughes-Godfrey updated GEODE-2943: ----------------------------------------------- Description: Some invalid query strings might be "*" or " ". When used with a single node dataStore, we see the correct Exception returned: {noformat} gfsh>search lucene --name=testIndex --region=/testRegion --queryStrings="*" --defaultField=__REGION_VALUE_FIELD Could not process command due to GemFire error. An error occurred while searching lucene index across the Geode cluster: Leading wildcard is not allowed: __REGION_VALUE_FIELD:* {noformat} However, with multiple nodes, the query hangs. Jason debugged this a bit and found: {noformat} org.apache.geode.InternalGemFireException: java.io.NotSerializableException: org.apache.lucene.queryparser.flexible.messages.MessageImpl at org.apache.geode.distributed.internal.DistributionManager.putOutgoing(DistributionManager.java:1838) at org.apache.geode.distributed.internal.ReplyMessage.send(ReplyMessage.java:111) at org.apache.geode.internal.cache.partitioned.PartitionMessage.sendReply(PartitionMessage.java:441) at org.apache.geode.internal.cache.partitioned.PartitionMessage.process(PartitionMessage.java:421) at org.apache.geode.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:376) at org.apache.geode.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:442) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:625) at org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1071) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.NotSerializableException: org.apache.lucene.queryparser.flexible.messages.MessageImpl at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441) at java.lang.Throwable.writeObject(Throwable.java:985) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) {noformat} The executing node fails with {noformat} [info 2017/05/18 13:50:34.115 PDT server1 <Function Execution Processor3> tid=0x120] Unexpected exception during function execution on local node Partitioned Region org.apache.geode.cache.execute.FunctionException: org.apache.geode.cache.lucene.LuceneQueryException: Malformed lucene query: *asdf* at org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.getQuery(LuceneQueryFunction.java:163) at org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.execute(LuceneQueryFunction.java:87) at org.apache.geode.internal.cache.execute.AbstractExecution.executeFunctionLocally(AbstractExecution.java:332) at org.apache.geode.internal.cache.execute.AbstractExecution$1.run(AbstractExecution.java:274) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:625) at org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1071) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.geode.cache.lucene.LuceneQueryException: Malformed lucene query: *asdf* at org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:79) at org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.getQuery(LuceneQueryFunction.java:160) ... 8 more Caused by: LEADING_WILDCARD_NOT_ALLOWED: Leading wildcard is not allowed: field1:*asdf* at org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.postProcessNode(AllowLeadingWildcardProcessor.java:79) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.processIteration(QueryNodeProcessorImpl.java:98) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.process(QueryNodeProcessorImpl.java:89) at org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.process(AllowLeadingWildcardProcessor.java:54) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline.process(QueryNodeProcessorPipeline.java:89) at org.apache.lucene.queryparser.flexible.core.QueryParserHelper.parse(QueryParserHelper.java:250) at org.apache.lucene.queryparser.flexible.standard.StandardQueryParser.parse(StandardQueryParser.java:159) at org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:73) ... 9 more but it's waiting for replies that never come because the other nodes fail with the serialization issue {noformat} the remote nodes fail in the function with this stack trace (where we will probably need to try/catch any lucene exception) {noformat} [warning 2017/05/18 13:50:34.105 PDT server2 <Function Execution Processor1> tid=0x3c] org.apache.geode.cache.lucene.LuceneQueryException: Malformed lucene query: *asdf* at org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:79) at org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.getQuery(LuceneQueryFunction.java:160) at org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.execute(LuceneQueryFunction.java:87) at org.apache.geode.internal.cache.PartitionedRegionDataStore.executeOnDataStore(PartitionedRegionDataStore.java:2956) at org.apache.geode.internal.cache.partitioned.PartitionedRegionFunctionStreamingMessage.operateOnPartitionedRegion(PartitionedRegionFunctionStreamingMessage.java:98) at org.apache.geode.internal.cache.partitioned.PartitionMessage.process(PartitionMessage.java:339) at org.apache.geode.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:376) at org.apache.geode.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:442) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:625) at org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1071) at java.lang.Thread.run(Thread.java:745) Caused by: LEADING_WILDCARD_NOT_ALLOWED: Leading wildcard is not allowed: field1:*asdf* at org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.postProcessNode(AllowLeadingWildcardProcessor.java:79) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.processIteration(QueryNodeProcessorImpl.java:98) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.process(QueryNodeProcessorImpl.java:89) at org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.process(AllowLeadingWildcardProcessor.java:54) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline.process(QueryNodeProcessorPipeline.java:89) at org.apache.lucene.queryparser.flexible.core.QueryParserHelper.parse(QueryParserHelper.java:250) at org.apache.lucene.queryparser.flexible.standard.StandardQueryParser.parse(StandardQueryParser.java:159) at org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:73) ... 12 more {noformat} was: Some invalid query strings might be "*" or " ". When used with a single node dataStore, we see the correct Exception returned: {noformat} gfsh>search lucene --name=testIndex --region=/testRegion --queryStrings="*" --defaultField=__REGION_VALUE_FIELD Could not process command due to GemFire error. An error occurred while searching lucene index across the Geode cluster: Leading wildcard is not allowed: __REGION_VALUE_FIELD:* {noformat} However, with multiple nodes, the query hangs. Jason debugged this a bit and found: {noformat} the remote nodes fail in the function with this stack trace (where we will probably need to try/catch any lucene exception) [warning 2017/05/18 13:50:34.105 PDT server2 <Function Execution Processor1> tid=0x3c] org.apache.geode.cache.lucene.LuceneQueryException: Malformed lucene query: *asdf* at org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:79) at org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.getQuery(LuceneQueryFunction.java:160) at org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.execute(LuceneQueryFunction.java:87) at org.apache.geode.internal.cache.PartitionedRegionDataStore.executeOnDataStore(PartitionedRegionDataStore.java:2956) at org.apache.geode.internal.cache.partitioned.PartitionedRegionFunctionStreamingMessage.operateOnPartitionedRegion(PartitionedRegionFunctionStreamingMessage.java:98) at org.apache.geode.internal.cache.partitioned.PartitionMessage.process(PartitionMessage.java:339) at org.apache.geode.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:376) at org.apache.geode.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:442) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:625) at org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1071) at java.lang.Thread.run(Thread.java:745) Caused by: LEADING_WILDCARD_NOT_ALLOWED: Leading wildcard is not allowed: field1:*asdf* at org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.postProcessNode(AllowLeadingWildcardProcessor.java:79) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.processIteration(QueryNodeProcessorImpl.java:98) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.process(QueryNodeProcessorImpl.java:89) at org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.process(AllowLeadingWildcardProcessor.java:54) at org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline.process(QueryNodeProcessorPipeline.java:89) at org.apache.lucene.queryparser.flexible.core.QueryParserHelper.parse(QueryParserHelper.java:250) at org.apache.lucene.queryparser.flexible.standard.StandardQueryParser.parse(StandardQueryParser.java:159) at org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:73) ... 12 more {noformat} > Invalid queryStrings cause lucene searches to hang in in PR with multiple > nodes > ------------------------------------------------------------------------------- > > Key: GEODE-2943 > URL: https://issues.apache.org/jira/browse/GEODE-2943 > Project: Geode > Issue Type: Bug > Components: lucene > Affects Versions: 1.2.0 > Reporter: Shelley Lynn Hughes-Godfrey > > Some invalid query strings might be "*" or " ". > When used with a single node dataStore, we see the correct Exception returned: > {noformat} > gfsh>search lucene --name=testIndex --region=/testRegion --queryStrings="*" > --defaultField=__REGION_VALUE_FIELD > Could not process command due to GemFire error. An error occurred while > searching lucene index across the Geode cluster: Leading wildcard is not > allowed: __REGION_VALUE_FIELD:* > {noformat} > However, with multiple nodes, the query hangs. > Jason debugged this a bit and found: > {noformat} > org.apache.geode.InternalGemFireException: java.io.NotSerializableException: > org.apache.lucene.queryparser.flexible.messages.MessageImpl > at > org.apache.geode.distributed.internal.DistributionManager.putOutgoing(DistributionManager.java:1838) > at > org.apache.geode.distributed.internal.ReplyMessage.send(ReplyMessage.java:111) > at > org.apache.geode.internal.cache.partitioned.PartitionMessage.sendReply(PartitionMessage.java:441) > at > org.apache.geode.internal.cache.partitioned.PartitionMessage.process(PartitionMessage.java:421) > at > org.apache.geode.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:376) > at > org.apache.geode.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:442) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at > org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:625) > at > org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1071) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.io.NotSerializableException: > org.apache.lucene.queryparser.flexible.messages.MessageImpl > at > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) > at > java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) > at > java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) > at > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) > at > java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) > at > java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441) > at java.lang.Throwable.writeObject(Throwable.java:985) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:483) > at > java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) > at > java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) > {noformat} > The executing node fails with > {noformat} > [info 2017/05/18 13:50:34.115 PDT server1 <Function Execution Processor3> > tid=0x120] Unexpected exception during function execution on local node > Partitioned Region > org.apache.geode.cache.execute.FunctionException: > org.apache.geode.cache.lucene.LuceneQueryException: Malformed lucene query: > *asdf* > at > org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.getQuery(LuceneQueryFunction.java:163) > at > org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.execute(LuceneQueryFunction.java:87) > at > org.apache.geode.internal.cache.execute.AbstractExecution.executeFunctionLocally(AbstractExecution.java:332) > at > org.apache.geode.internal.cache.execute.AbstractExecution$1.run(AbstractExecution.java:274) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at > org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:625) > at > org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1071) > at java.lang.Thread.run(Thread.java:745) > Caused by: org.apache.geode.cache.lucene.LuceneQueryException: Malformed > lucene query: *asdf* > at > org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:79) > at > org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.getQuery(LuceneQueryFunction.java:160) > ... 8 more > Caused by: LEADING_WILDCARD_NOT_ALLOWED: Leading wildcard is not allowed: > field1:*asdf* > at > org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.postProcessNode(AllowLeadingWildcardProcessor.java:79) > at > org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.processIteration(QueryNodeProcessorImpl.java:98) > at > org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.process(QueryNodeProcessorImpl.java:89) > at > org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.process(AllowLeadingWildcardProcessor.java:54) > at > org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline.process(QueryNodeProcessorPipeline.java:89) > at > org.apache.lucene.queryparser.flexible.core.QueryParserHelper.parse(QueryParserHelper.java:250) > at > org.apache.lucene.queryparser.flexible.standard.StandardQueryParser.parse(StandardQueryParser.java:159) > at > org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:73) > ... 9 more > but it's waiting for replies that never come because the other nodes fail > with the serialization issue > {noformat} > the remote nodes fail in the function with this stack trace (where we will > probably need to try/catch any lucene exception) > {noformat} > [warning 2017/05/18 13:50:34.105 PDT server2 <Function Execution Processor1> > tid=0x3c] > org.apache.geode.cache.lucene.LuceneQueryException: Malformed lucene query: > *asdf* > at > org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:79) > at > org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.getQuery(LuceneQueryFunction.java:160) > at > org.apache.geode.cache.lucene.internal.distributed.LuceneQueryFunction.execute(LuceneQueryFunction.java:87) > at > org.apache.geode.internal.cache.PartitionedRegionDataStore.executeOnDataStore(PartitionedRegionDataStore.java:2956) > at > org.apache.geode.internal.cache.partitioned.PartitionedRegionFunctionStreamingMessage.operateOnPartitionedRegion(PartitionedRegionFunctionStreamingMessage.java:98) > at > org.apache.geode.internal.cache.partitioned.PartitionMessage.process(PartitionMessage.java:339) > at > org.apache.geode.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:376) > at > org.apache.geode.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:442) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at > org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:625) > at > org.apache.geode.distributed.internal.DistributionManager$9$1.run(DistributionManager.java:1071) > at java.lang.Thread.run(Thread.java:745) > Caused by: LEADING_WILDCARD_NOT_ALLOWED: Leading wildcard is not allowed: > field1:*asdf* > at > org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.postProcessNode(AllowLeadingWildcardProcessor.java:79) > at > org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.processIteration(QueryNodeProcessorImpl.java:98) > at > org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl.process(QueryNodeProcessorImpl.java:89) > at > org.apache.lucene.queryparser.flexible.standard.processors.AllowLeadingWildcardProcessor.process(AllowLeadingWildcardProcessor.java:54) > at > org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline.process(QueryNodeProcessorPipeline.java:89) > at > org.apache.lucene.queryparser.flexible.core.QueryParserHelper.parse(QueryParserHelper.java:250) > at > org.apache.lucene.queryparser.flexible.standard.StandardQueryParser.parse(StandardQueryParser.java:159) > at > org.apache.geode.cache.lucene.internal.StringQueryProvider.getQuery(StringQueryProvider.java:73) > ... 12 more > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)