ChenSammi commented on code in PR #7981:
URL: https://github.com/apache/ozone/pull/7981#discussion_r1974708241
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/SendContainerRequestHandler.java:
##########
@@ -110,32 +119,44 @@ public void onNext(SendContainerRequest req) {
@Override
public void onError(Throwable t) {
- LOG.warn("Error receiving container {} at {}", containerId, nextOffset, t);
- closeOutput();
- deleteTarball();
- responseObserver.onError(t);
+ try {
+ LOG.warn("Error receiving container {} at {}", containerId, nextOffset,
t);
+ closeOutput();
+ deleteTarball();
+ responseObserver.onError(t);
+ } finally {
+ if (volume != null) {
+
volume.incImportContainerCommitBytes(-importer.getDefaultContainerSize() * 2);
Review Comment:
Some failure case doesn't require this deduction.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -84,6 +84,8 @@ public class HddsVolume extends StorageVolume {
private final AtomicLong committedBytes = new AtomicLong(); // till Open
containers become full
+ private final AtomicLong containerImportCommittedBytes = new AtomicLong();
Review Comment:
Please reuse the committedBytes as there is no difference from HddsVolume
point of view.
--
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]