You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ChenSammi (via GitHub)" <gi...@apache.org> on 2025/10/15 04:04:58 UTC
Re: [PR] HDDS-13664. Handle metadata read while restarting considering feature finalization. [ozone]
ChenSammi commented on code in PR #9036:
URL: https://github.com/apache/ozone/pull/9036#discussion_r2431051400
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/DeleteBlocksCommandHandler.java:
##########
@@ -645,12 +645,16 @@ private void updateMetaData(KeyValueContainerData containerData,
// update pending deletion blocks count and delete transaction ID in
// in-memory container status
- long pendingBytes = containerData.getBlockPendingDeletionBytes() + delTX.getTotalBlockSize();
+ long pendingBytes = containerData.getBlockPendingDeletionBytes();
+ if (delTX.hasTotalBlockSize()) {
Review Comment:
It's better to include all pendingBytes operations under the if scope, like this
// update in-memory pending deletion blocks size container status and persistent
If (VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.DATA_DISTRIBUTION)) && delTX.hasTotalBlockSize()) {
long pendingBytes = containerData.getBlockPendingDeletionBytes();
pendingBytes += delTX.getTotalBlockSize();
metadataTable
.putWithBatch(batchOperation,
containerData.getPendingDeleteBlockBytesKey(),
pendingBytes);
}
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org