sumitagrawl commented on code in PR #8827:
URL: https://github.com/apache/ozone/pull/8827#discussion_r2230308446
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/protocol/StorageContainerLocationProtocolServerSideTranslatorPB.java:
##########
@@ -712,6 +714,14 @@ public ScmContainerLocationResponse processRequest(
getResetDeletedBlockRetryCount(
request.getResetDeletedBlockRetryCountRequest()))
.build();
+ case GetDeletedBlocksTransactionSummary:
Review Comment:
same code changes are present in HDDS-13184 , either can remove from that or
from here
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java:
##########
@@ -313,16 +314,30 @@ private static void populateContainerMetadata(
// Set pending deleted block count.
final long blockPendingDeletion;
+ long blockPendingDeletionBytes = 0L;
+ Long pendingDeletionBlockBytes = metadataTable.get(kvContainerData
+ .getPendingDeleteBlockBytesKey());
Long pendingDeleteBlockCount =
metadataTable.get(kvContainerData
.getPendingDeleteBlockCountKey());
- if (pendingDeleteBlockCount != null) {
+ if (pendingDeleteBlockCount != null && pendingDeletionBlockBytes != null) {
Review Comment:
there might be case that, pendingDeleteBlockCount is not null but
pendingDeletionBlockBytes is null
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -315,6 +319,40 @@ public synchronized VolumeCheckResult check(@Nullable
Boolean unused)
return checkDbHealth(dbFile);
}
+ /**
+ * This method can be used to get total bytes pending for deletion
+ * in cached interval of time. This can be utilized by either storage
+ * report or other services.
+ */
+ public long getPendingDeletionBytes() {
Review Comment:
can not find any caller using this for all containers.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/DeleteBlocksCommandHandler.java:
##########
@@ -639,8 +639,13 @@ private void updateMetaData(KeyValueContainerData
containerData,
// update pending deletion blocks count and delete transaction ID in
// in-memory container status
+ long pendingBytes = delTX.getTotalBlockSize();
containerData.updateDeleteTransactionId(delTX.getTxID());
- containerData.incrPendingDeletionBlocks(newDeletionBlocks);
+ containerData.incrPendingDeletionBlocks(newDeletionBlocks, pendingBytes);
+ metadataTable
Review Comment:
parallel thread can update same key, deleteCommandHandler and
Blockdeletingservice, need use some lock with container as being used for
update containerdata.
--
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]