-
Notifications
You must be signed in to change notification settings - Fork 508
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
HDDS-10907. DataNode StorageContainerMetrics numWriteChunk is counted multiple times #6835
Conversation
It seem that adding the test in TestContainerMetrics is better. I'll update it later. |
...service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerMetrics.java
Outdated
Show resolved
Hide resolved
ContainerTestHelper.getWriteChunkRequest( | ||
pipeline, blockID, 1024); | ||
ContainerCommandResponseProto response = | ||
client.sendCommand(writeChunkRequest); | ||
ContainerCommandResponseProto response = client.sendCommand(writeChunkRequest); | ||
assertEquals(ContainerProtos.Result.SUCCESS, |
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.
we should check the related metrics in containerMetrics are correct. In specific, make sure numWriteChunk is expected.
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.
Here are some assertions for containerMetrics:
Lines 214 to 217 in ad4c17c
assertCounter("NumOps", 3L, containerMetrics); | |
assertCounter("numCreateContainer", 1L, containerMetrics); | |
assertCounter("numWriteChunk", 1L, containerMetrics); | |
assertCounter("numReadChunk", 1L, containerMetrics); |
Is it enough?
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 merging it
@jojochuang CI passed, in case you want to merge |
… multiple times (apache#6835) Co-authored-by: Doroszlai, Attila <adoroszlai@apache.org> (cherry picked from commit 63a232b)
What changes were proposed in this pull request?
StorageContainerMetrics.incContainerOpsMetrics() updates operation counts. It is incremented not just once for WriteChunk, because it is called by HddsDispatcher.dispatchRequest() during WRITE_DATA (by ContainerStateMachine.writeStateMachineData()) and COMMIT_DATA phase.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10907
How was this patch tested?
Add assertion of containerMetrics in
TestBlockOutputStream