adoroszlai opened a new pull request, #4967: URL: https://github.com/apache/ozone/pull/4967
## What changes were proposed in this pull request? 1. `ContainerManagerImpl` lock is intended only for write operations (see [comment](https://github.com/apache/ozone/blob/3211547ed21b7683720ca57282e13a4edb9fdce2/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerManagerImpl.java#L68-L71) on `lock`). `ContainerStateManagerImpl` has its own read/write lock. Earlier `ConcurrentModificationException` (HDDS-6314) happened because `ContainerStateManagerImpl` returns an unmodifiable view of its internal sets. These are not thread-safe, only protect against changing the set. Replaced these with `ImmutableSet.copyOf`. 2. Replace stream with iteration. 3. Remove ineligible items from the list being sorted before sorting it. 4. Only filter items if request is not for all items (as indicated by the smallest possible `ContainerID`: 0. 5. Increment metric for `getContainers(LifeCycleState)`, was missing previously. 6. Move metrics calls out of locked block in `deleteContainer`. Further improvement is possible, as some of the container sets are already sorted (to be done separately in HDDS-6315). https://issues.apache.org/jira/browse/HDDS-8913 ## How was this patch tested? CI: https://github.com/adoroszlai/hadoop-ozone/actions/runs/5356645847 -- 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]
