[ https://issues.apache.org/jira/browse/GEODE-2768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15966750#comment-15966750 ]
ASF GitHub Bot commented on GEODE-2768: --------------------------------------- Github user jhuynh1 commented on a diff in the pull request: https://github.com/apache/geode/pull/451#discussion_r111275346 --- Diff: geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneQueryFunction.java --- @@ -132,6 +133,25 @@ private LuceneIndexImpl getLuceneIndex(final Region region, try { index = (LuceneIndexImpl) service.getIndex(searchContext.getIndexName(), region.getFullPath()); + if (index == null && service instanceof LuceneServiceImpl) { + if (((LuceneServiceImpl) service).getDefinedIndex(searchContext.getIndexName(), + region.getFullPath()) != null) { + // The node may be in the process of recovering, where we have the index defined but yet + // to be recovered + // If we retry fast enough, we could get a stack overflow based on the way function + // execution is currently written + // Instead we will add an artificial sleep to slow down the retry at this point + // Hopefully in the future, the function execution would retry without adding to the stack + // and this can be removed + try { --- End diff -- This is really an artificial time that was to avoid the stack overflow from the function execution retry. The smaller the time, the greater chance we hit the stack overflow but also the quicker we return to the user if the index really doesn't exist. I can understand maybe bumping this up to a second but 10 seems a bit long... > Lucene Queries executed before index is fully created should be retried > ----------------------------------------------------------------------- > > Key: GEODE-2768 > URL: https://issues.apache.org/jira/browse/GEODE-2768 > Project: Geode > Issue Type: Bug > Components: lucene > Reporter: Jason Huynh > Assignee: Jason Huynh > > With the feature to destroy a Lucene Index, parts of the querying function > were changed to handle the event where we execute a query on an index that is > no longer present. However, the scenario where we execute a query on an > index that is defined but has not been created can also arise. > We want to handle the case where we have defined the index, but have yet to > create it due to a brief window in restart. -- This message was sent by Atlassian JIRA (v6.3.15#6346)