-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix metrics Worker.ActiveClients counter error #14088
Fix metrics Worker.ActiveClients counter error #14088
Conversation
Hi @xichen01, thanks for your contribution! In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. |
Automated checks report:
Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks. |
91af1af
to
49a54d5
Compare
Automated checks report:
All checks passed! |
@xichen01 thanks for this fix! Really appreciate it as I introduced this metrics and glad to see you fixed it. |
Codecov Report
@@ Coverage Diff @@
## master #14088 +/- ##
============================================
- Coverage 43.28% 43.19% -0.09%
+ Complexity 9210 9195 -15
============================================
Files 1425 1425
Lines 82512 82518 +6
Branches 9983 9984 +1
============================================
- Hits 35715 35645 -70
- Misses 43832 43910 +78
+ Partials 2965 2963 -2
Continue to review full report at Codecov.
|
@xichen01 Can you sign the CLA https://cla.alluxio.org/ ? |
You did it @xichen01! Thank you for signing the Contribution License Agreement. |
@@ -638,6 +638,13 @@ public void closeUfsBlock(long sessionId, long blockId) | |||
// the sessionId. | |||
LOG.debug("Invalid worker state while committing block.", e); | |||
} | |||
} else { | |||
// When getTempBlockMeta() return null, such as a block readType NO_CACHE writeType THROUGH. |
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.
@xichen01 Would you please show the cause why counter was not be decreased in the commitblock()?
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.
Because the block metadata is not in memory (mLocalBlockStore.getTempBlockMeta() will return null). So, the branch commitblock() will not be executed.
alluxio/core/server/worker/src/main/java/alluxio/worker/block/DefaultBlockWorker.java
Lines 629 to 631 in 49a54d5
if (mLocalBlockStore.getTempBlockMeta(sessionId, blockId) != null) { | |
try { | |
commitBlock(sessionId, blockId, false); |
Why block metadata is not in memory?
When executing the test case: allxuio runTest --readType NO_CACHE --writeType THROUGH. the counter metric
alluxio/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockReader.java
Lines 385 to 388 in fceea2a
if (mBlockWriter == null && offset == 0 && !mBlockMeta.isNoCache()) { | |
BlockStoreLocation loc = BlockStoreLocation.anyDirInTier(mStorageTierAssoc.getAlias(0)); | |
mLocalBlockStore.createBlock(mBlockMeta.getSessionId(), mBlockMeta.getBlockId(), | |
AllocateOptions.forCreate(mInitialBlockSize, loc)); |
The block metadata will not update to memory, because is no_cache IO
@apc999 @maobaolong PTAL |
@apc999 PTAL |
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.
It LGTM.
Hi @apc999 , PTAL, thank you. |
Executing: As shown below, because the readType is example: executing: |
alluxio-bot, check this please |
Automated checks report:
All checks passed! |
alluxio-bot, test this please |
alluxio-bot triggering jenkins retest: 0/3 |
jenkins, test this please |
alluxio-bot, merge this please |
Mentioning that this PR fixes #14412 for posterity. |
@dbw9580 Is this needed for 2.7? |
Yes, I think backporting bug fixes is always desirable. |
alluxio-bot, cherry-pick this to branch-2.7 please |
Auto cherry-pick to branch |
### What changes are proposed in this pull request? Fix metrics Worker.ActiveClients counter error ### Why are the changes needed? When executing end-to-end test: allxuio runTest --readType NO_CACHE --writeType THROUGH. the counter metric Worker.ActiveClients.xxx will change to 2 instead of 0. ### Does this PR introduce any user facing changes? No pr-link: #14088 change-id: cid-9bfb67ba59896c03827a0bc8c84901f931a41ba6
…lluxio#14088 Fix metrics Worker.ActiveClients counter error Fix metrics Worker.ActiveClients counter error When executing end-to-end test: allxuio runTest --readType NO_CACHE --writeType THROUGH. the counter metric Worker.ActiveClients.xxx will change to 2 instead of 0. No pr-link: Alluxio#14088 change-id: cid-9bfb67ba59896c03827a0bc8c84901f931a41ba6
What changes are proposed in this pull request?
Fix metrics Worker.ActiveClients counter error
Why are the changes needed?
When executing end-to-end test: allxuio runTest --readType NO_CACHE --writeType THROUGH. the counter metric Worker.ActiveClients.xxx will change to 2 instead of 0.
Does this PR introduce any user facing changes?
No