Skip to content
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

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

xichen01
Copy link
Contributor

@xichen01 xichen01 commented Sep 17, 2021

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

@alluxio-bot
Copy link
Contributor

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.

@alluxio-bot
Copy link
Contributor

Automated checks report:

  • Commits associated with Github account: FAIL
    • It looks like your commits can't be linked to a valid Github account.
      Your commits are made with the email maritanchen@tencent.com, which does not allow your contribution to be tracked by Github.
      See this link for possible reasons this might be happening.
      To change the author email address that your most recent commit was made under, you can run:
      git -c user.name="Name" -c user.email="Email" commit --amend --reset-author
      See this answer for more details about how to change commit email addresses.
      Once the author email address has been updated, update the pull request by running:
      git push --force https://github.com/xichen01/alluxio.git fix-metrics-activeclient-error
  • PR title follows the conventions: PASS

Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks.

@xichen01 xichen01 force-pushed the fix-metrics-activeclient-error branch from 91af1af to 49a54d5 Compare September 17, 2021 13:10
@alluxio-bot
Copy link
Contributor

Automated checks report:

  • Commits associated with Github account: PASS
  • PR title follows the conventions: PASS

All checks passed!

@apc999
Copy link
Contributor

apc999 commented Sep 18, 2021

@xichen01 thanks for this fix! Really appreciate it as I introduced this metrics and glad to see you fixed it.
can you sign the CLA https://cla.alluxio.org/ ?

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2021

Codecov Report

Merging #14088 (49a54d5) into master (4a5801f) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
.../java/alluxio/worker/block/DefaultBlockWorker.java 67.82% <100.00%> (+0.22%) ⬆️
...lluxio/worker/block/UnderFileSystemBlockStore.java 59.16% <100.00%> (+1.40%) ⬆️
...a/alluxio/exception/status/CancelledException.java 0.00% <0.00%> (-42.86%) ⬇️
...rc/main/java/alluxio/worker/block/PinListSync.java 76.92% <0.00%> (-23.08%) ⬇️
...e/common/src/main/java/alluxio/AbstractClient.java 59.86% <0.00%> (-12.50%) ⬇️
...luxio/worker/block/meta/StorageDirEvictorView.java 69.69% <0.00%> (-12.13%) ⬇️
.../src/main/java/alluxio/retry/TimeBoundedRetry.java 84.61% <0.00%> (-11.54%) ⬇️
.../worker/block/management/tier/SwapRestoreTask.java 62.83% <0.00%> (-10.62%) ⬇️
...worker/block/management/BlockTransferExecutor.java 87.93% <0.00%> (-6.90%) ⬇️
...er/block/management/ManagementTaskCoordinator.java 78.08% <0.00%> (-5.48%) ⬇️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a5801f...49a54d5. Read the comment docs.

@maobaolong
Copy link
Contributor

@xichen01 Can you sign the CLA https://cla.alluxio.org/ ?

@alluxio-bot
Copy link
Contributor

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.
Copy link
Contributor

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()?

Copy link
Contributor Author

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.

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

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

@yuzhu
Copy link
Contributor

yuzhu commented Sep 27, 2021

@apc999 @maobaolong PTAL

@yuzhu
Copy link
Contributor

yuzhu commented Oct 13, 2021

@apc999 PTAL

Copy link
Contributor

@maobaolong maobaolong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It LGTM.

@maobaolong
Copy link
Contributor

Hi @apc999 , PTAL, thank you.

@xichen01
Copy link
Contributor Author

Executing: allxuio runTest --readType NO_CACHE --writeType THROUGH.

As shown below, because the readType is NO_CACHE,so mLocalBlockStore.getTempBlockMeta() will return null. Therefore, the branch with commitBlock() will not be executed, so Metrics.WORKER_ACTIVE_CLIENTS.dec() in commitBlock() will not be executed, after the Worker Active Clients metric can exceed 0

example: executing: allxuio runTest --readType NO_CACHE --writeType THROUGH

image

image

@ZhuTopher
Copy link
Contributor

alluxio-bot, check this please

@alluxio-bot
Copy link
Contributor

Automated checks report:

  • Commits associated with Github account: PASS
  • PR title follows the conventions: PASS

All checks passed!

@ZhuTopher
Copy link
Contributor

alluxio-bot, test this please

@alluxio-bot
Copy link
Contributor

alluxio-bot triggering jenkins retest: 0/3

@alluxio-bot
Copy link
Contributor

jenkins, test this please

@yuzhu yuzhu closed this Jan 25, 2022
@yuzhu yuzhu reopened this Jan 25, 2022
@yuzhu
Copy link
Contributor

yuzhu commented Jan 25, 2022

alluxio-bot, merge this please

@alluxio-bot alluxio-bot merged commit 7b64a95 into Alluxio:master Jan 25, 2022
@ZhuTopher
Copy link
Contributor

Mentioning that this PR fixes #14412 for posterity.

@jiacheliu3
Copy link
Contributor

@dbw9580 Is this needed for 2.7?

@dbw9580
Copy link
Contributor

dbw9580 commented Jan 30, 2022

Yes, I think backporting bug fixes is always desirable.

@jiacheliu3
Copy link
Contributor

alluxio-bot, cherry-pick this to branch-2.7 please

@alluxio-bot
Copy link
Contributor

Auto cherry-pick to branch branch-2.7 successfully opened PR: #14941

alluxio-bot pushed a commit that referenced this pull request Jan 30, 2022
### 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
flaming-archer pushed a commit to flaming-archer/alluxio that referenced this pull request Sep 1, 2022
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants