ivakegg commented on code in PR #2790:
URL: https://github.com/apache/accumulo/pull/2790#discussion_r911323811


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java:
##########
@@ -124,20 +127,28 @@ public void run() {
           interruptFlag.set(false);
 
         } catch (IOException e) {
-          log.warn("lookup failed for tablet " + entry.getKey(), e);
+          log.warn("lookup failed for tablet " + extent, e);
           throw new RuntimeException(e);
         }
 
         bytesAdded += lookupResult.bytesAdded;
 
         if (lookupResult.unfinishedRanges.isEmpty()) {
-          fullScans.add(entry.getKey());
+          fullScans.add(extent);
+          // if this extent was previously saved, but now completed then reset 
these values
+          if (partScan != null && partScan.equals(extent)) {
+            partScan = null;
+            partNextKey = null;
+            partNextKeyInclusive = false;
+          }
         } else {
           if (lookupResult.closed) {
-            failures.put(entry.getKey(), lookupResult.unfinishedRanges);
+            failures.put(extent, lookupResult.unfinishedRanges);
           } else {
-            session.queries.put(entry.getKey(), lookupResult.unfinishedRanges);

Review Comment:
   How were we not always getting concurrent modification exceptions here?  
Weird



##########
server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java:
##########
@@ -79,6 +79,9 @@ public void run() {
       long maxScanTime = 4000;
 
       long startTime = System.currentTimeMillis();
+      LinkedList<Pair<KeyExtent,List<Range>>> queryQueue = new LinkedList<>();
+      session.queries.entrySet()
+          .forEach(e -> queryQueue.addLast(new Pair<>(e.getKey(), 
e.getValue())));

Review Comment:
   We need to make sure the session.queries is reset with what is left in the 
queryQueue after the loop.  Otherwise whenever the scan session is restarted 
(e.g. bytesAdded > maxResultsSize) then we need to restart where we left off.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to