sodonnel commented on a change in pull request #2963:
URL: https://github.com/apache/ozone/pull/2963#discussion_r812337062
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java
##########
@@ -235,18 +235,20 @@ public void listContainer(long startContainerId, long
count,
public ContainerReportsProto getContainerReport() throws IOException {
LOG.debug("Starting container report iteration.");
+ ContainerReportsProto.Builder crBuilder =
+ ContainerReportsProto.newBuilder();
// No need for locking since containerMap is a ConcurrentSkipListMap
// And we can never get the exact state since close might happen
// after we iterate a point.
List<Container<?>> containers = new ArrayList<>(containerMap.values());
-
- ContainerReportsProto.Builder crBuilder =
- ContainerReportsProto.newBuilder();
-
- for (Container<?> container: containers) {
- crBuilder.addReports(container.getContainerReport());
+ // Incremental Container reports can read stale container information
Review comment:
> but could we get a snapshot of the containers here and meanwhile a new
container is added and ICR queued that is not in our snapshot and hence never
gets added to the FCR?
Seeing how this is synchronized in StateContext, I don't think this could
happen.
I do think we could end up with a scenario where the new container is added
to the set, but the ICR is blocked from being queued due to the
synchronization. Then we generate teh FCR that contains it, and then we also
end up with a duplicate ICR. However I doubt that matters - on SCM it will just
process it again, so it should be 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]