adixitconfluent commented on code in PR #22740:
URL: https://github.com/apache/kafka/pull/22740#discussion_r4680096233


##########
core/src/test/java/kafka/server/share/DelayedShareFetchTest.java:
##########
@@ -1780,6 +1784,79 @@ public void 
testTryCompleteWithPendingRemoteFetchInFlight() {
         }
     }
 
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testRemoteStorageFetchMaxBytesResizedToRemoteFetchPartitions() 
{

Review Comment:
   Added in bc69857:
   1. `testRemoteStorageFetchMaxBytesSplitAcrossRemoteFetchPartitions`: 2 
remote and 2 empty local partitions. Each remote read goes from 
`requestMaxBytes / 4` to `requestMaxBytes / 2`, so together they get exactly 
`requestMaxBytes`.
   2. 
`testRemoteStorageFetchMaxBytesUnchangedWhenAllAcquiredPartitionsAreRemote`: 
the caps are no longer recomputed, only topped up with spare budget, so they 
can't be lowered and the "not larger" case becomes "no spare budget". This test 
makes every acquired partition remote and asserts each remote read keeps its 
byte cap. Its strategy puts the remainder byte on a different partition on each 
call, the case where the previous version went over `requestMaxBytes` by a byte.
   
   For the fairness change, I also added:
   - `testRemoteStorageFetchMaxBytesLeavesRequestBudgetForLocalPartitionData`: 
a local partition with data keeps the bytes it returned.
   - `testRemoteStorageFetchMaxBytesLeavesShareOfPartitionNotReadInRequest` and 
`...WithAsyncLogRead`: a local partition not read in the request keeps its 
strategy share, on both the sync and async log-read paths.



-- 
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