ArafatKhan2198 commented on code in PR #4724:
URL: https://github.com/apache/ozone/pull/4724#discussion_r1198580365
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java:
##########
@@ -141,10 +140,18 @@ public Response getContainers(
// Send back an empty response
return Response.status(Response.Status.NOT_ACCEPTABLE).build();
}
+ if (prevKey > 0) {
+ // Increase the limit by 1 to fetch one additional container
+ // since we are excluding the container with the same ID as prevKey
+ limit = limit + 1;
Review Comment:
My Initial thought for raising the limit was that we might encounter
non-sequential container ID's
When we sort container IDs in ascending order, we expect to have a sequence
of consecutive numbers. For example 1, 2, 3, 4, 5, 6 would represent a proper
sequence where each number follows the previous one. However, it's important to
note that even though we sort the container IDs, it doesn't guarantee a fixed
sequence.
In some cases, we may encounter container IDs that are not in a consecutive
or sequential order. For instance, we might have container IDs like 1, 3, 4,
10, 23, 99, where there are gaps or missing numbers between the IDs. This can
occur due to various reasons such as containers being deleted or missing. These
missing or deleted containers result in gaps within the sequence of container
IDs.
But after checking out the code in the
[getContainers()](https://github.com/apache/ozone/blob/7d1aaef989f3749014c870000c84a6645d6fb43b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerManagerImpl.java#LL144C1-L146C1)
it turns out even if we provide a containerId that does not exist it will
still filter them out and start with a container ID that exists. So I believe
the code changees suggested by @ashishkumar50 will work out fine.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]