ayushtkn commented on code in PR #6547:
URL: https://github.com/apache/ozone/pull/6547#discussion_r1569248268
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/DeleteBlocksCommandHandler.java:
##########
@@ -626,20 +630,27 @@ private void updateMetaData(KeyValueContainerData
containerData,
}
}
- private void logDeleteTransaction(long containerId,
- KeyValueContainerData containerData, DeletedBlocksTransaction delTX) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Processing Container : {}, DB path : {}, transaction {}",
- containerId, containerData.getMetadataPath(), delTX.getTxID());
- }
+ public static boolean isDuplicateTransaction(long containerId,
KeyValueContainerData containerData,
+ DeletedBlocksTransaction delTX, BlockDeletingServiceMetrics metrics) {
+ boolean duplicate = false;
- if (delTX.getTxID() <= containerData.getDeleteTransactionId()) {
- blockDeleteMetrics.incOutOfOrderDeleteBlockTransactionCount();
+ if (delTX.getTxID() < containerData.getDeleteTransactionId()) {
+ metrics.incOutOfOrderDeleteBlockTransactionCount();
LOG.info(String.format("Delete blocks for containerId: %d"
- + " is either received out of order or retried,"
- + " %d <= %d", containerId, delTX.getTxID(),
+ + " is received out of order, %d < %d", containerId,
delTX.getTxID(),
containerData.getDeleteTransactionId()));
+ } else if (delTX.getTxID() == containerData.getDeleteTransactionId()) {
+ duplicate = true;
+ LOG.info(String.format("Delete blocks with txID {} for containerId: %d"
+ + " is retried.", delTX.getTxID(), containerId,
+ containerData.getDeleteTransactionId()));
Review Comment:
does this log line work properly? not sure if String.format is needed
itself, it has three arguments and one {} and other %d
--
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]