ChenSammi commented on code in PR #6547:
URL: https://github.com/apache/ozone/pull/6547#discussion_r1570798062
##########
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:
Yes, I keep the same INFO log as current code for I think at the current
Ozone stage, it will help to save us time for finding/investigating issues.
Nowadays, issues are usually come from customer/user's environment. If using
DEBUG level log, then we need to ask user to change the configuration, restart
the service, wait for issue to reproduce and then get the log files for
analysis. This communication round trip will take time. With the block
deletion flow becomes more stable and mature in future, we can revisit these
logs and lower their log level if needed.
And this issue is found casually when I gone through user's DN logs. If it's
DEBUG level, I won't find it now.
--
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]