Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-8888. Consider Datanode queue capacity when sending DeleteBlocks command #4939
HDDS-8888. Consider Datanode queue capacity when sending DeleteBlocks command #4939
Changes from 1 commit
75a6a0f
4578b3c
84e601a
75c2021
a3a41dd
f31cf19
092c852
7580f2f
48852c8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The basic idea looks good, but I have a concern that the queued cmd size from the last dn heartbeat has a potential delay. If the delete operation is frequent, there might be a case that the service cannot find idle data nodes to send cmd until the next heartbeat comes. The deletion process might not be smooth as you expect.
Pls correct me if i am wrong.
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.
By default the SCM generates a delete command every 60s and sends it to the DN. The DN reports a heartbeat every 30s. So normally SCM can get the newer DN status.
getTotalDatanodeCommandCount
returns the number ofDeleteBlocksCommand
, each time SCM executesDeletedBlockTransactionScanner
, only oneDeleteBlocksCommand
is sent to a specific DN.DeletedBlockTransactionScanner
execution frequency is fixed, the limit here is 5, so the SCM must execute at least 5 times before the DN's queue is full, which needs 5 min. as long as the DN can send a heartbeat of before all these commands are executed, then the SCM can continue to send delete commands to the DN.If the queue of all DNs is full, SCM should not continue to send new commands to DN
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 see. Most of the time it should be fine.
The worst case:
A If DN reported the HB at time A with a full cmd queue.
A+ 29.9s. SCM DeletedBlockTransactionScanner executes and cannot send cmd to DN, needs to wait for next
round.
A+ 90s. SCM has updated the latest HB from DN and DeletedBlockTransactionScanner executes, and finally
send cmd to DN again.
It could lead to at most a 90-sec gap.
Right now it seems to be trivial compared to the interval of DeletedBlockTransactionScanner.
Thx for the explanation.
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.
Yes, and when A+ 29.9s ~ A+ 90s the DN can continue to process the
DeleteBlocksCommand
in its command queue. And the DN's command queue is full, DN will not be idle. Because this PR is determine whether to continue sendingDeleteBlocksCommand
to DN according to the command queue length of DN.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
Considering parallel HB and SCM deleteBlock processing, they are synchronized using lock,
So below sequence,
Scenario 1: - No issue as queue empty and next command can be added
Scenario 2: Here, adding same command will be duplicate and there is retry
Considering this, we need not have queue at SCM and above changes not required.