smengcl commented on code in PR #12096:
URL: https://github.com/apache/ozone/pull/12096#discussion_r4713962104
##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconSCMContainerSyncIntegration.java:
##########
@@ -212,6 +215,30 @@ private void seedReconAsClosing(long startId, int count)
throws Exception {
}
}
+ /** Seeds a container Recon retired to DELETED while a datanode still
reported a replica of it. */
+ private ContainerID seedDeletedWithReplica(long id) throws Exception {
+ seedRecon(id, 1, CLOSED);
+ ContainerID containerID = ContainerID.valueOf(id);
+ ReconContainerManager containerManager = getContainerManager();
+ containerManager.updateContainerReplica(containerID,
ContainerReplica.newBuilder()
+ .setContainerID(containerID)
+ .setContainerState(ContainerReplicaProto.State.CLOSED)
+ .setDatanodeDetails(randomDatanodeDetails())
+ .build());
Review Comment:
nit: after the master merge, the `addReplica` helper from HDDS-17060 is
right above, so this block could just reuse it:
```suggestion
addReplica(containerID, ContainerReplicaProto.State.CLOSED);
```
Then the local `containerManager` is only used for the two
`updateContainerState` calls.
--
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]