This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 30272f7be642b6fbd6bdd427526b0897f31907fd
Merge: 80a48cdc60 aa6e61cb41
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Fri Feb 14 22:47:27 2025 +0000

    Merge branch '3.1'

 .../accumulo/core/clientImpl/ScannerIterator.java  |  2 +
 .../accumulo/core/clientImpl/ThriftScanner.java    | 12 ++-
 .../java/org/apache/accumulo/core/data/Key.java    | 57 ++++++++++++++
 .../org/apache/accumulo/core/data/KeyBuilder.java  | 88 ++++++++++++++++++++++
 .../org/apache/accumulo/core/data/KeyTest.java     | 50 ++++++++++++
 5 files changed, 207 insertions(+), 2 deletions(-)

diff --cc 
core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java
index d3fd02b44e,c166918a9f..b58f743d68
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java
@@@ -251,10 -211,12 +252,12 @@@ public class ThriftScanner 
  
      Duration busyTimeout;
  
 -    volatile boolean closeInitiated = false;
 +    int tabletsScanned;
  
 -    TabletLocation getErrorLocation() {
 -      return prevLoc;
 -    }
 +    KeyExtent prevExtent = null;
 +
++    volatile boolean closeInitiated = false;
+ 
      public ScanState(ClientContext context, TableId tableId, Authorizations 
authorizations,
          Range range, SortedSet<Column> fetchedColumns, int size,
          List<IterInfo> serverSideIteratorList,
@@@ -765,14 -509,15 +768,19 @@@
            TraceUtil.setException(child2, e, false);
            sleepMillis = pause(sleepMillis, maxSleepTime, 
scanState.runOnScanServer);
          } catch (TException e) {
 -          boolean wasInterruptedAfterClose =
 -              e.getCause() != null && 
e.getCause().getClass().equals(InterruptedIOException.class)
 -                  && scanState.closeInitiated;
 -          if (!wasInterruptedAfterClose) {
 -            TabletLocator.getLocator(context, 
scanState.tableId).invalidateCache(context,
 -                loc.getTserverLocation());
 +          if (addr.serverType == ServerType.TSERVER) {
 +            // only tsever locations are in cache, invalidating a scan server 
would not find
 +            // anything the cache
-             ClientTabletCache.getInstance(context, 
scanState.tableId).invalidateCache(context,
-                 addr.serverAddress);
++            boolean wasInterruptedAfterClose =
++                e.getCause() != null && 
e.getCause().getClass().equals(InterruptedIOException.class)
++                    && scanState.closeInitiated;
++            if (!wasInterruptedAfterClose) {
++              ClientTabletCache.getInstance(context, 
scanState.tableId).invalidateCache(context,
++                  addr.serverAddress);
++            }
            }
            error = "Scan failed, thrift error " + e.getClass().getName() + "  
" + e.getMessage()
 -              + " " + scanState.getErrorLocation();
 +              + " " + addr.serverAddress;
            if (!error.equals(lastError)) {
              log.debug("{}", error);
            } else if (log.isTraceEnabled()) {

Reply via email to