Github user ivakegg commented on a diff in the pull request: https://github.com/apache/accumulo/pull/260#discussion_r119133690 --- Diff: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java --- @@ -586,6 +589,10 @@ private LookupResult lookup(SortedKeyValueIterator<Key,Value> mmfi, List<Range> mmfi.next(); } + } catch (ScanYieldException sye) { + log.debug("Scan yield exception detected at position " + sye.getPosition()); + addUnfinishedRange(lookupResult, range, sye.getPosition(), false); --- End diff -- Each key that is actually returned by the iterator will be returned to the user. The ScanYieldException would be thrown within the next call (presumably because it has been doing a lot of scanning and not actually finding any keys to return). The key placed in the exception would where the next call left off before finding the next key to return. All keys already returned by getTopKey() after successfull next calls would still be returned appropriately. If you follow the timesUp or the exceededMemoryUsage used here, you will see that it is essentially follows the same paradigm of yielding the scan until later. I am just supplying a way for the underlying iterator to force this to happen.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---