charlesconnell commented on code in PR #6978: URL: https://github.com/apache/hbase/pull/6978#discussion_r2081822422
########## hbase-endpoint/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java: ########## @@ -560,20 +609,22 @@ private void postScanPartialResultUpdate(List<Cell> results, PartialResultContex } } - private void setPartialResultResponse(AggregateResponse.Builder builder, AggregateRequest request, - boolean hasMoreRows, PartialResultContext context) throws IOException { - // If we encountered an RpcThrottlingException, tell the client the partial result we've - // accumulated so far, and what row to start scanning at in order to finish the scan. + private AggregateResponse.Builder responseBuilder(AggregateRequest request, boolean hasMoreRows, + PartialResultContext context) { + AggregateResponse.Builder builder = AggregateResponse.newBuilder(); if (request.getClientSupportsPartialResult() && hasMoreRows) { if (context.lastRowSuccessfullyProcessedArray != null) { byte[] lastRowSuccessfullyProcessed = Arrays.copyOfRange( context.lastRowSuccessfullyProcessedArray, context.lastRowSuccessfullyProcessedOffset, context.lastRowSuccessfullyProcessedOffset + context.lastRowSuccessfullyProcessedLength); builder.setNextChunkStartRow(ByteString.copyFrom( ClientUtil.calculateTheClosestNextRowKeyForPrefix(lastRowSuccessfullyProcessed))); + } else { + builder.setNextChunkStartRow(request.getScan().getStartRow()); Review Comment: This is the key fix here. If no results were found, indicate that retry is still necessary ########## hbase-endpoint/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java: ########## @@ -560,20 +609,22 @@ private void postScanPartialResultUpdate(List<Cell> results, PartialResultContex } } - private void setPartialResultResponse(AggregateResponse.Builder builder, AggregateRequest request, - boolean hasMoreRows, PartialResultContext context) throws IOException { - // If we encountered an RpcThrottlingException, tell the client the partial result we've - // accumulated so far, and what row to start scanning at in order to finish the scan. + private AggregateResponse.Builder responseBuilder(AggregateRequest request, boolean hasMoreRows, + PartialResultContext context) { + AggregateResponse.Builder builder = AggregateResponse.newBuilder(); if (request.getClientSupportsPartialResult() && hasMoreRows) { if (context.lastRowSuccessfullyProcessedArray != null) { byte[] lastRowSuccessfullyProcessed = Arrays.copyOfRange( context.lastRowSuccessfullyProcessedArray, context.lastRowSuccessfullyProcessedOffset, context.lastRowSuccessfullyProcessedOffset + context.lastRowSuccessfullyProcessedLength); builder.setNextChunkStartRow(ByteString.copyFrom( ClientUtil.calculateTheClosestNextRowKeyForPrefix(lastRowSuccessfullyProcessed))); + } else { + builder.setNextChunkStartRow(request.getScan().getStartRow()); Review Comment: This is the key fix here. If no results were found, indicate that retry is still necessary. -- 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: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org