devmadhuu commented on code in PR #11494:
URL: https://github.com/apache/ozone/pull/11494#discussion_r4259818191
##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconStorageContainerManagerFacade.java:
##########
@@ -90,6 +92,10 @@ void testScmSnapshotDbIsOpenedAtCanonicalReconPath() throws
Exception {
ReconStorageContainerManagerFacade reconScm =
injector.getInstance(ReconStorageContainerManagerFacade.class);
+ ReconContainerManager containerManager = (ReconContainerManager)
reconScm.getContainerManager();
+ DatanodeID historyDatanode = DatanodeID.randomID();
+ containerManager.upsertContainerHistory(1L, historyDatanode, 10L, 20L,
Review Comment:
Same here, looks like this exception handling was not done before this PR
also. But handled in this PR itself.
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconContainerMetadataManagerImpl.java:
##########
@@ -241,11 +244,13 @@ public void batchStoreContainerReplicaHistory(
Map<Long, Map<DatanodeID, ContainerReplicaHistory>> replicaHistoryMap)
throws IOException {
try (BatchOperation batchOperation =
- containerDbStore.initBatchOperation()) {
+ replicaHistoryDBProvider.getDbStore().initBatchOperation()) {
for (Map.Entry<Long, Map<DatanodeID, ContainerReplicaHistory>> entry :
replicaHistoryMap.entrySet()) {
final long containerId = entry.getKey();
- final Map<DatanodeID, ContainerReplicaHistory> tsMap =
entry.getValue();
+ // The in-memory map contains only current replicas; preserve departed
datanodes on shutdown.
+ final Map<DatanodeID, ContainerReplicaHistory> tsMap =
getContainerReplicaHistory(containerId);
+ tsMap.putAll(entry.getValue());
Review Comment:
Yeah, this bug was present before this PR itself. Have handled this bug in
current patch only.
--
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]