ArafatKhan2198 commented on code in PR #11090:
URL: https://github.com/apache/ozone/pull/11090#discussion_r3895368233
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconContainerMetadataManagerImpl.java:
##########
@@ -514,10 +514,10 @@ private List<Pipeline> getPipelines(ContainerKeyPrefix
containerKeyPrefix)
}
List<Pipeline> pipelines = new ArrayList<>();
if (null != omKeyInfo) {
- omKeyInfo.getKeyLocationVersions().stream().map(
+ omKeyInfo.getKeyLocationVersions().forEach(
Review Comment:
**Blocking:** `omKeyInfo` is read from the persisted OM key/file table,
whose codec serializes keys with `ignorePipeline=true`. Therefore
`OmKeyLocationInfo#getPipeline()` is normally null here. This change adds that
null to the result, and the caller immediately dereferences it through
`pipeline.getId()`, causing the reproduced HTTP 500. Filtering null values
would prevent the crash, but it would still leave the pipeline list empty and
would not solve this,
please do correct me if I am wrong on this
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconContainerMetadataManagerImpl.java:
##########
@@ -514,10 +514,10 @@ private List<Pipeline> getPipelines(ContainerKeyPrefix
containerKeyPrefix)
}
List<Pipeline> pipelines = new ArrayList<>();
if (null != omKeyInfo) {
- omKeyInfo.getKeyLocationVersions().stream().map(
+ omKeyInfo.getKeyLocationVersions().forEach(
omKeyLocationInfoGroup ->
- omKeyLocationInfoGroup.getLocationList()
- .stream().map(omKeyLocationInfo -> pipelines.add(
+ omKeyLocationInfoGroup.getLocationList().forEach(
Review Comment:
Please add an endpoint-level regression test that stores the key through the
real OM codec and calls both `/containers/mismatch?missingIn=SCM` and
`/containers/mismatch/deleted`. The test should verify that the response does
not return 500 and that each container receives only its own pipeline
information. The existing test only populates container-key mappings, so it
does not exercise this change.
--
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]