-
Notifications
You must be signed in to change notification settings - Fork 590
HDDS-8010. Improve DN warning message when getBlock does not find the block #4350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dineshchitlangia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 LGTM, pending CI
| if (log.isDebugEnabled()) { | ||
| log.debug(logInfo, request.getCmdType(), request.getTraceID(), | ||
| log.warn(logInfo, request.getCmdType(), request.getTraceID(), | ||
| request.getGetBlock().getBlockID(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be still logged at DEBUG level if it is under the isDebugEnabled() condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your comment
I commit new version that if it is under the condition still logged at DEBUG level.
if it's not under the condition logged at Warn level.
# Conflicts: # hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GAOJHIHCYUAN have you observed the updated message in the log?
| } else { | ||
| log.info(logInfo, request.getCmdType(), request.getTraceID(), | ||
| log.warn(logInfo, request.getCmdType(), request.getTraceID(), | ||
| request.getGetBlock().getBlockID(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request.getGetBlock() is only applicable to GetBlock requests. Also, not all commands are related to blocks anyway.
Looking at HDDS-8010, I think the goal is to change the message in:
Lines 353 to 364 in 4afa68e
| private BlockData getBlockByID(DBHandle db, BlockID blockID, | |
| KeyValueContainerData containerData) throws IOException { | |
| String blockKey = containerData.getBlockKey(blockID.getLocalID()); | |
| BlockData blockData = db.getStore().getBlockDataTable().get(blockKey); | |
| if (blockData == null) { | |
| throw new StorageContainerException(NO_SUCH_BLOCK_ERR_MSG, | |
| NO_SUCH_BLOCK); | |
| } | |
| return blockData; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request.getGetBlock()is only applicable toGetBlockrequests. Also, not all commands are related to blocks anyway.Looking at HDDS-8010, I think the goal is to change the message in:
Lines 353 to 364 in 4afa68e
private BlockData getBlockByID(DBHandle db, BlockID blockID, KeyValueContainerData containerData) throws IOException { String blockKey = containerData.getBlockKey(blockID.getLocalID()); BlockData blockData = db.getStore().getBlockDataTable().get(blockKey); if (blockData == null) { throw new StorageContainerException(NO_SUCH_BLOCK_ERR_MSG, NO_SUCH_BLOCK); } return blockData; }
public class StorageContainerException extends IOException {
private final ContainerProtos.Result result;
private final BlockID blockID = getLocalID();
public BlockID getLocalID() {return blockID;}
if (log.isDebugEnabled()) {
log.debug(logInfo, request.getCmdType(), request.getTraceID(),
ex.getLocalID(),
ex.getMessage(), ex.getResult().getValueDescriptor().getName(), ex);
}
} else {
log.warn(logInfo, request.getCmdType(), request.getTraceID(),
ex.getLocalID(),
ex.getMessage(), ex.getResult().getValueDescriptor().getName(), ex);
}
because the log was logged when StorageContainerException occurred
my opinion was adding the getLocalID() in StorageContainerException.java
and then we can call function in getBlockByID() getting the block ID.
Idk is it a good soultion.
thanks you so much
@GAOJHIHCYUAN have you observed the updated message in the log?
No,I haven't
I will try how could I observe the updated message.
sorry,i was a newbie. I'm still learning.
thanks you so much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can update message in getBlockByID while throwing StorageContainerException to print the blockID. Can you update the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can update message in getBlockByID while throwing StorageContainerException to print the blockID. Can you update the PR?
okay,I will update the PR.
appreciate
|
Thanks again @GAOJHIHCYUAN for working on this. Will you update the patch to make the change in |
|
/pending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking this issue as un-mergeable as requested.
Please use /ready comment when it's resolved.
Please note that the PR will be closed after 21 days of inactivity from now. (But can be re-opened anytime later...)
/pending
I will update the patch. |
What changes were proposed in this pull request?
adding the log message information about block id and logged at WARN level
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8010
How was this patch tested?
CI tests